README
ΒΆ
Doku CLI
Local development environment manager with Docker, Traefik, and SSL
Doku is a CLI tool that simplifies running and managing Docker-based services locally with automatic service discovery, DNS routing, and SSL certificates.
Features
- π One-command setup - Get services running in seconds
- π HTTPS by default - Local SSL certificates that just work
- π Clean URLs - Access services via
service.doku.localinstead oflocalhost:port - π Service discovery - Automatic connection string generation
- π¦ Version management - Run multiple versions of the same service
- π― Local development focus - Optimized for developer productivity
- πͺ Resource control - Set CPU and memory limits per service
- ποΈ API Gateway pattern - Internal-only services for microservices architecture
- π Environment management - Secure environment variable handling with masking
- π Service catalog - Curated collection of 24+ popular development services
- π Full lifecycle management - Start, stop, restart, and remove services with ease
- π§© Multi-container services - Deploy complex services with multiple containers
- π Dependency management - Automatic installation of service dependencies
- π Port mapping - Map container ports to host for direct access via localhost
- π³ Custom projects - Build and run from your own Dockerfiles with
--pathflag - β‘ Dynamic configuration - Update environment variables without rebuilding containers
Quick Start
Installation
Quick Install (Recommended):
# Using curl
curl -fsSL https://raw.githubusercontent.com/dokulabs/doku-cli/main/scripts/install.sh | bash
# Or using wget
wget -qO- https://raw.githubusercontent.com/dokulabs/doku-cli/main/scripts/install.sh | bash
Using Go:
# Install latest release
go install github.com/dokulabs/doku-cli/cmd/doku@latest
# Install from main branch
go install github.com/dokulabs/doku-cli/cmd/doku@main
# Install specific version
go install github.com/dokulabs/doku-cli/cmd/doku@v0.2.0
More Options:
See INSTALL.md for detailed installation instructions including:
- Installing specific versions
- Building from source
- Custom installation directories
- Platform-specific instructions
Verify installation:
doku version
First-Time Setup
# Initialize Doku on your system
doku init
This will:
- Check Docker availability
- Install SSL certificates (mkcert)
- Configure DNS for
*.doku.local - Set up Traefik reverse proxy
- Download service catalog
Install Your First Service
# Install PostgreSQL
doku install postgres
# Install with specific version
doku install postgres:14 --name postgres-14
# Install with custom environment variables
doku install postgres \
--env POSTGRES_PASSWORD=mysecret \
--env POSTGRES_DB=myapp
# Install with resource limits
doku install redis --memory 512m --cpu 1.0
# Install with port mapping for direct access
doku install postgres --port 5432
# Install with multiple port mappings (e.g., RabbitMQ)
doku install rabbitmq --port 5672 --port 15672
# Install as internal service (no external access)
doku install redis --internal
Install Custom Projects
Run your own applications from Dockerfiles:
# Install a custom frontend application
doku install frontend --path=./my-frontend-app
# Install backend as internal service
doku install api --path=./backend --internal --port 4000
# Install with environment variables
doku install myapp --path=./myapp \
--env DATABASE_URL=postgresql://postgres@postgres:5432/mydb \
--env API_KEY=secret123 \
--port 8080
π See the complete guide: Custom Projects Guide
Manage Environment Variables
Update configuration dynamically without rebuilding:
# View environment variables
doku env frontend
# Set new variables
doku env set frontend API_KEY=newsecret DEBUG=true
# Auto-restart after changes
doku env set frontend API_KEY=newsecret --restart
# Remove variables
doku env unset frontend OLD_KEY
Manage Services
# List running services
doku list
# List all services (including stopped)
doku list --all
# Start a service
doku start postgres
# Stop a service
doku stop postgres
# Restart a service
doku restart postgres
# View logs
doku logs postgres -f
# Get detailed service info
doku info postgres
# View environment variables
doku env postgres
# Remove a service
doku remove postgres
Upgrade Doku CLI
Keep your doku CLI up to date with the latest features and fixes:
# Check current version
doku version
# Upgrade to the latest version
doku self upgrade
# Upgrade without confirmation prompt
doku self upgrade --force
The upgrade command will:
- Check for the latest version on GitHub
- Download the appropriate binary for your platform
- Replace the current binary with the new version
- Verify the installation
Architecture
βββββββββββββββββββββββββββββββββββββββββββ
β User (Browser/CLI) β
β https://service.doku.local β
ββββββββββββββββββ¬βββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β Traefik Proxy β
β (Port 80/443) β
ββββββββββββ¬ββββββββββββ
β
βββββββββββββββ΄ββββββββββββββ
β doku-network (bridge) β
β β
β ββββββββββ ββββββββββ β
β βpostgresβ β redis β β
β ββββββββββ ββββββββββ β
ββββββββββββββββββββββββββββββ
Available Services
π See the complete and up-to-date service catalog: β Doku Service Catalog
The catalog includes 24+ services across multiple categories:
- Databases: PostgreSQL (with pgvector), MySQL, MongoDB, MariaDB, ClickHouse, Redis, Memcached
- Message Queues: RabbitMQ, Apache Kafka
- Search & Analytics: Elasticsearch
- Monitoring: Dozzle, Prometheus, Grafana, Jaeger, SigNoz, Sentry
- Web Servers: Nginx
- Development Tools: MailHog, Adminer, phpMyAdmin, LocalStack
- Storage: MinIO
- Security: HashiCorp Vault
- Coordination: Zookeeper
Browse services locally:
# List all services in a compact table
doku catalog
# List services with detailed information
doku catalog --verbose
# Filter by category
doku catalog --category database
# Search for services
doku catalog search postgres
# Show service details
doku catalog show postgres --verbose
Quick examples:
# Install PostgreSQL with pgvector extension
doku install postgres:17-pgvector
# Install Redis
doku install redis
# Install multiple services
doku install postgres redis rabbitmq
Usage Examples
Multiple Versions
Run multiple versions of the same service simultaneously:
# Install PostgreSQL 14
doku install postgres:14 --name postgres-14
# Install PostgreSQL 16
doku install postgres:16 --name postgres-16
# Both are now running on the same network
# Access via:
# - https://postgres-14.doku.local
# - https://postgres-16.doku.local
Service Discovery
Automatic connection string generation:
$ doku info postgres-14
Connection:
postgresql://postgres@postgres-14.doku.local:5432
# Use this in your application
DATABASE_URL=postgresql://postgres@postgres-14.doku.local:5432
Environment Variables
View and export environment variables configured for services:
# View environment variables (sensitive values masked by default)
$ doku env postgres
Environment Variables for postgres
==================================================
π Sensitive values are masked. Use --show-values to display actual values.
POSTGRES_DB = myapp
POSTGRES_PASSWORD π = po***rd
POSTGRES_USER = postgres
Tip: Use 'doku env postgres --show-values' to see actual values
Tip: Use 'doku env postgres --export' for shell export format
# Show actual values (unmask sensitive data)
doku env postgres --show-values
# Export format for shell sourcing
doku env postgres --export > postgres.env
# Export with actual values
doku env postgres --export --show-values > postgres.env
# Source directly into your shell
eval $(doku env postgres --export --show-values)
Port Mapping
Map container ports to your host machine for direct access via localhost:
# Install PostgreSQL with port mapping
doku install postgres --port 5432
# Connect directly via localhost
psql -h localhost -p 5432 -U postgres
# Install with custom host port (avoid conflicts)
doku install postgres:16 --name postgres-16 --port 5433:5432
# Connect to custom port
psql -h localhost -p 5433 -U postgres
Multiple Port Mappings
Services like RabbitMQ require multiple ports (AMQP + Management UI):
# Map both AMQP and Management UI ports
doku install rabbitmq --port 5672 --port 15672
# Access RabbitMQ
# - AMQP: localhost:5672
# - Management UI: http://localhost:15672
# Map to different host ports
doku install rabbitmq \
--port 5673:5672 \
--port 15673:15672
# Now accessible at:
# - AMQP: localhost:5673
# - Management UI: http://localhost:15673
Viewing Port Mappings
# List services with port mappings
$ doku list
β postgres [running]
Service: postgres (v16)
Port: localhost:5432 β container:5432
β rabbitmq [running]
Service: rabbitmq
Port: localhost:5672 β container:5672
Port: localhost:15672 β container:15672
# Detailed port information
$ doku info rabbitmq
Network
Port Mappings:
localhost:5672 β container:5672
localhost:15672 β container:15672
API Gateway Pattern
Build microservices architectures with internal-only services:
# Install backend services as internal (not exposed externally)
doku install user-service --internal
doku install order-service --internal
doku install payment-service --internal
# Install API Gateway as public service
doku install spring-gateway --name api \
--env USER_SERVICE_URL=http://user-service:8081 \
--env ORDER_SERVICE_URL=http://order-service:8082 \
--env PAYMENT_SERVICE_URL=http://payment-service:8083
# Now only the API Gateway is accessible externally:
# https://api.doku.local
# Backend services communicate internally via container names
This pattern mirrors enterprise microservices architectures where:
- API Gateway handles authentication, authorization, and routing
- Backend services are isolated and only accessible within the network
- Services communicate using container names (service discovery)
Multi-Container Services
Deploy complex services that require multiple containers:
# Install SigNoz (3 containers: otel-collector, query-service, frontend)
# Automatically installs dependencies: Zookeeper and ClickHouse
doku install signoz
# List all containers
doku list
# Shows:
# β zookeeper [running]
# β clickhouse [running]
# β signoz [running]
# - otel-collector
# - query-service
# - frontend
# Access the UI
# https://signoz.doku.local
Multi-container services automatically:
- Install required dependencies in correct order
- Configure network aliases for inter-container communication
- Set up proper startup dependencies
- Mount configuration files from the catalog
Dependency Management
Services automatically install their dependencies:
# Installing SignOz automatically installs:
# 1. Zookeeper (required by ClickHouse)
# 2. ClickHouse (required by SignOz for data storage)
# 3. SignOz (the main service with 3 containers)
doku install signoz --yes
# Output:
# π¦ Dependencies required:
# β’ zookeeper (latest)
# β’ clickhouse (latest)
# β’ signoz (latest)
#
# Installing dependency: zookeeper...
# β zookeeper installed
#
# Installing dependency: clickhouse...
# β clickhouse installed
#
# Installing dependency: signoz...
# β signoz installed
Dependencies are defined in the catalog and automatically resolved:
- Prevents circular dependencies
- Installs in correct topological order
- Skips already-installed dependencies
- Configures inter-service communication
Configuration
Doku stores configuration in ~/.doku/:
~/.doku/
βββ config.toml # Main configuration
βββ catalog/ # Service catalog
βββ traefik/ # Traefik config
βββ certs/ # SSL certificates
βββ services/ # Service definitions
Custom Domain
By default, Doku uses doku.local. You can customize:
doku init --domain mydev.local
Commands Reference
| Command | Description |
|---|---|
doku init |
Initialize Doku on your system |
doku version |
Show version information |
| CLI Management | |
doku self upgrade |
Upgrade doku to the latest version |
| Catalog | |
doku catalog |
Browse available services |
doku catalog search <query> |
Search for services |
doku catalog show <service> |
Show service details |
doku catalog update |
Update catalog from GitHub |
| Service Management | |
doku install <service> |
Install a service from catalog |
doku install <name> --path=<dir> |
Install a custom project from Dockerfile |
doku list |
List all running services |
doku list --all |
List all services (including stopped) |
doku info <service> |
Show detailed service information |
doku env <service> |
Show environment variables |
doku env set <service> KEY=VALUE |
Set environment variables |
doku env unset <service> KEY |
Remove environment variables |
doku start <service> |
Start a stopped service |
doku stop <service> |
Stop a running service |
doku restart <service> |
Restart a service |
doku logs <service> |
View service logs |
doku logs <service> -f |
Follow service logs in real-time |
doku remove <service> |
Remove a service and its data |
| Cleanup | |
doku uninstall |
Uninstall Doku and clean up everything |
Common Flags
--help, -h- Show help for any command--verbose, -v- Verbose output--quiet, -q- Quiet mode (minimal output)--yes, -y- Skip confirmation prompts (for remove/uninstall)--force, -f- Force operation
Install Flags
--path- Path to project directory with Dockerfile (for custom projects)--name, -n- Custom instance name--env, -e- Environment variables (KEY=VALUE)--memory- Memory limit (e.g., 512m, 1g)--cpu- CPU limit (e.g., 0.5, 1.0)--port, -p- Port mappings (can be specified multiple times)- Format:
--port 5432(maps container port to same host port) - Format:
--port 5433:5432(maps container port 5432 to host port 5433)
- Format:
--volume- Volume mounts (host:container)--internal- Install as internal service (no external access)--skip-deps- Skip dependency installation--no-auto-install-deps- Prompt before installing dependencies
Uninstalling
To completely remove Doku from your system:
# Uninstall with confirmation prompt
doku uninstall
# Force uninstall without prompts
doku uninstall --force
# Uninstall and remove mkcert CA certificates
doku uninstall --all
What Gets Removed Automatically:
- β All Docker containers managed by Doku
- β All Docker volumes created by Doku
- β Doku Docker network
- β
Configuration directory (
~/.doku/) - β
Doku binaries (
dokuanddoku-cli)
Manual Cleanup (Optional):
The uninstall command provides OS-specific instructions for:
- DNS entries - Remove
*.doku.localentries from/etc/hostsor resolver - mkcert CA certificates - Optionally remove with
mkcert -uninstall
Complete Removal:
# Run uninstall and immediately remove the binary
doku uninstall --force && rm -f ~/go/bin/doku ~/go/bin/doku-cli
Requirements
- Docker (Desktop or Engine)
- macOS, Linux, or Windows
- Ports 80 and 443 available
Development
# Clone the repository
git clone https://github.com/dokulabs/doku-cli
cd doku-cli
# Install dependencies
go mod download
# Build
make build
# Run
./bin/doku version
Contributing
Contributions are welcome! Please see CONTRIBUTING.md.
License
MIT License - see LICENSE for details.
Support
- π Documentation
- π Report Issues
- π¬ Discussions
Project Status
Status: β Production Ready (v0.2.0)
Completed Features β
Core Infrastructure:
- β Configuration management (TOML-based)
- β Docker SDK integration with full container lifecycle
- β SSL certificate generation (mkcert)
- β Traefik reverse proxy setup with automatic routing
- β DNS configuration (hosts file integration)
- β Network management (doku-network bridge)
Service Catalog:
- β GitHub-based catalog system
- β Version management for services
- β Service metadata (icons, descriptions, tags, links)
- β Catalog browsing and search
- β Automatic catalog updates
Service Management:
- β Service installation with interactive prompts
- β Service listing with filtering and status
- β Service lifecycle (start, stop, restart)
- β Service removal with cleanup
- β Service information display
- β Environment variable management with masking
- β Log viewing with follow mode
- β Resource limits (CPU/memory)
- β Volume management
- β Internal-only services (API Gateway pattern)
- β Port mapping (single and multiple ports)
Multi-Container & Dependencies (Phase 3 Complete!):
- β Multi-container service support
- β Automatic dependency resolution
- β Topological sorting for installation order
- β Network alias automation for inter-container communication
- β Configuration file mounting from catalog
- β Container startup order management
- β Dependency-aware removal (keeps dependencies)
Custom Projects & Dynamic Configuration (Phase 4 Complete!):
- β
Custom project installation with
--pathflag - β Automatic Dockerfile build and run
- β Dynamic environment variable management
- β
doku env setcommand for updating variables - β
doku env unsetcommand for removing variables - β Auto-restart option for environment changes
Installation & Distribution:
- β One-line installation via curl/wget
- β Pre-built binaries for multiple platforms
- β Go install support (@latest, @main, @version)
- β Build from source option
- β Self-upgrade command
Utilities:
- β Complete uninstallation with automatic cleanup
- β Fixed uninstall to remove all containers and volumes
- β Version information
- β Help system
Planned Enhancements π
- π Service health checks and monitoring
- π Multi-project workspace support
- π Service templates and custom definitions
- π Environment profiles (dev/staging/prod)
- π Backup/restore functionality
- π Service update command
- π Dashboard UI (web-based management)
Made with β€οΈ for developers who want a better local development experience.