LinuxCommandLibrary

dokku

Deploy and manage applications using Docker

TLDR

List running apps

$ dokku apps
copy

Create an app
$ dokku apps:create [app_name]
copy

Remove an app
$ dokku apps:destroy [app_name]
copy

Install plugin
$ dokku plugin:install [full_repo_url]
copy

Link database to an app
$ dokku [db]:link [db_name] [app_name]
copy

SYNOPSIS

dokku [<command>] [<args>...] [--help] [--version] [--trace] [--rm]

PARAMETERS

--help
    Display usage and list subcommands

--version
    Print Dokku version

--trace
    Enable trace/debug logging

--rm
    Remove containers after run (one-off)

apps
    Create/list/destroy apps

config
    Manage app environment variables

domains
    Add/remove custom domains

logs
    Tail app logs

plugin
    Install/list/uninstall plugins

ps
    Restart/stop processes

ps:report
    Show process status

ps:scale
    Scale app processes

ssh-keys
    Manage deploy SSH keys

DESCRIPTION

Dokku is an extensible, open-source PaaS that enables easy deployment and management of applications on a single server, mimicking Heroku's git-based workflow. It uses Docker for containerization, buildpacks for app building, and plugins for databases, monitoring, and more.

Install on Ubuntu/Debian via the official script: sudo dokku-installer sets up SSH, domains, and basics. Create an app with dokku apps:create <app>, link your git repo via git remote add dokku dokku@server:<app>, then git push dokku main to build/deploy automatically.

Key features include process scaling (dokku ps:scale), config vars (dokku config:set), custom domains/SSL (dokku domains:add, dokku letsencrypt plugin), logs (dokku logs <app>), and one-off tasks (dokku tasks:add). Plugins like postgres, redis, and http-auth add services. It's lightweight, runs on VPS like DigitalOcean/Droplet, and avoids vendor lock-in/costs.

Perfect for devs/teams deploying web apps, APIs, or static sites with zero-downtime deploys and rolling updates.

CAVEATS

Requires Ubuntu 20.04+/Debian 11+; root/sudo access; single-node only (no clustering); git push deploys block until complete; plugins may need manual config.

INSTALLATION

curl -sL https://dokku.com/install.sh | sudo bash
Run dokku domain:set <server-ip> and add SSH key: cat ~/.ssh/id_rsa.pub | dokku ssh-keys:add admin

PLUGINS

Core: dokku plugin:install https://github.com/dokku/dokku-postgres.git postgres
Enable services: dokku postgres:create mydb; dokku postgres:link mydb myapp

HISTORY

Created in 2012 by Jose Diaz-Gonzalez as a Heroku clone using buildpacks. First release 0.1; evolved with Docker support by v0.3 (2013). Now at v0.34+ (2024), with plugin ecosystem, Procfiles, multi-app support, and CI/CD integrations. Widely used for cost-effective PaaS on VPS.

SEE ALSO

docker(1), git(1), ssh-keygen(1)

Copied to clipboard