Dokku is the smallest PaaS implementation — a Docker-powered Heroku alternative in about 200 lines of Bash. Git push to deploy, buildpacks, and plugins.
Why Dokku?
-
Heroku workflow:
git push dokku mainto deploy - Buildpacks: Auto-detect Node, Python, Ruby, Go, etc.
- Plugins: PostgreSQL, Redis, MongoDB, Let's Encrypt
- Tiny footprint: Runs on 512MB RAM
- Free: Open source
- Battle-tested: 10+ years, 25K+ GitHub stars
Install
wget -NP . https://dokku.com/install/v0.34.4/bootstrap.sh
sudo DOKKU_TAG=v0.34.4 bash bootstrap.sh
Create and Deploy
# On server
dokku apps:create my-app
# On your laptop
git remote add dokku dokku@server:my-app
git push dokku main
Dokku auto-detects your language and builds.
Add Database
# Install PostgreSQL plugin
sudo dokku plugin:install https://github.com/dokku/dokku-postgres.git
# Create database
dokku postgres:create my-db
# Link to app (auto-sets DATABASE_URL)
dokku postgres:link my-db my-app
Environment Variables
dokku config:set my-app SECRET_KEY=abc123 NODE_ENV=production
dokku config:show my-app
Custom Domains + HTTPS
# Add domain
dokku domains:add my-app app.example.com
# Enable HTTPS
sudo dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git
dokku letsencrypt:enable my-app
Scale
# Scale web processes
dokku ps:scale my-app web=3 worker=1
# Check status
dokku ps:report my-app
Docker Deploy
# Deploy from Docker image
dokku git:from-image my-app myregistry/my-app:v1.2
# Or from Dockerfile
# Just have a Dockerfile in your repo and git push
View Logs
dokku logs my-app -t # tail logs
dokku logs my-app -n 100 # last 100 lines
Backups
dokku postgres:export my-db > backup.sql
dokku postgres:import my-db < backup.sql
Real-World Use Case
A solo developer hosts 8 side projects on a $6 DigitalOcean droplet with Dokku. Each project deploys with git push, has its own PostgreSQL database, and automatic HTTPS. Total cost: $6/mo instead of $200+/mo on Heroku.
Need to automate data collection? Check out my Apify actors for ready-made scrapers, or email spinov001@gmail.com for custom solutions.
Top comments (0)