What is Dokku?
Dokku is the smallest PaaS implementation you've ever seen. It's a self-hosted Heroku alternative that runs on a single server. Push code with git push — Dokku builds, deploys, and manages your apps.
100% free. 100% open source.
Install
wget -NP . https://dokku.com/bootstrap.sh
sudo DOKKU_TAG=v0.34.8 bash bootstrap.sh
Deploy Your First App
# On your local machine:
git remote add dokku dokku@your-server:my-app
git push dokku main
That's it. Dokku detects your language, builds the app, and deploys it.
The CLI API
App Management
# Create app
dokku apps:create my-app
# List apps
dokku apps:list
# Destroy app
dokku apps:destroy my-app
# View logs
dokku logs my-app -t # Follow logs
# Run one-off command
dokku run my-app python manage.py migrate
dokku run my-app rails console
Domains & SSL
# Add domain
dokku domains:add my-app myapp.com
dokku domains:add my-app www.myapp.com
# Auto SSL with Let's Encrypt
dokku letsencrypt:enable my-app
# Auto-renewal
dokku letsencrypt:cron-job --add
Environment Variables
# Set env vars
dokku config:set my-app DATABASE_URL=postgres://... SECRET_KEY=abc123
# View env vars
dokku config:show my-app
# Unset
dokku config:unset my-app DEBUG
Databases (Plugins)
# Install PostgreSQL plugin
sudo dokku plugin:install https://github.com/dokku/dokku-postgres.git postgres
# Create database
dokku postgres:create my-db
# Link to app (sets DATABASE_URL automatically)
dokku postgres:link my-db my-app
# Backup
dokku postgres:export my-db > backup.sql
# Redis
sudo dokku plugin:install https://github.com/dokku/dokku-redis.git redis
dokku redis:create my-cache
dokku redis:link my-cache my-app
Scaling
# Scale processes
dokku ps:scale my-app web=2 worker=1
# Set resource limits
dokku resource:limit my-app --memory 512m --cpu 1
Docker Options
# Mount volumes
dokku storage:mount my-app /var/lib/dokku/data/storage:/app/uploads
# Set Docker options
dokku docker-options:add my-app deploy "--restart=always"
Network & Ports
# Set port mapping
dokku ports:add my-app http:80:3000
dokku ports:add my-app https:443:3000
# View ports
dokku ports:list my-app
Buildpacks vs Dockerfile
# Use buildpacks (auto-detect)
# Just push code — Dokku detects Node.js, Python, Ruby, etc.
# Use Dockerfile
# Just include a Dockerfile in your repo — Dokku uses it automatically
# Use Docker image
dokku git:from-image my-app myorg/my-image:latest
Zero-Downtime Deploys
# Enable zero-downtime checks
dokku checks:enable my-app
# Custom health check
# In your app root, create CHECKS:
# /health 200 OK
Popular Plugins
| Plugin | Purpose |
|---|---|
| postgres | PostgreSQL databases |
| redis | Redis instances |
| letsencrypt | Auto SSL certificates |
| mongo | MongoDB databases |
| mysql | MySQL databases |
| rabbitmq | Message queues |
| elasticsearch | Search engine |
Dokku vs Alternatives
| Feature | Dokku | Coolify | CapRover |
|---|---|---|---|
| Interface | CLI | Web UI | Web UI |
| Deploy | git push | Git/Docker | Git/Docker |
| Footprint | ~256MB | ~1GB | ~512MB |
| Plugins | 100+ | Built-in | Limited |
| Maturity | 10+ years | 3 years | 5 years |
Need a lightweight deployment solution or server automation?
📧 spinov001@gmail.com
🔧 My tools on Apify Store
git push to deploy — is Dokku the best PaaS for indie hackers? Let me know!
Top comments (0)