On this page
- What makes Dokku different from other panels?
- Which server and system should you use?
- How do you install Dokku?
- How do you add keys and set the global domain?
- How do you create and push your first app?
- How do you add a PostgreSQL database?
- How do you enable HTTPS with Let's Encrypt?
- How do you scale, read logs and upgrade?
- What goes wrong most often?
- Questions
What makes Dokku different from other panels?
Dokku has no web dashboard; everything happens through a command line over SSH and through git push. That keeps it small and scriptable. Under the hood each app runs in Docker containers, nginx routes domains to them, and builds use Heroku style buildpacks, Cloud Native Buildpacks or your own Dockerfile. If you like working in a terminal and want each deploy tied to a commit, Dokku fits well. If you prefer clicking through a browser, look at Dokploy or CapRover instead.
Which server and system should you use?
Use a fresh Ubuntu 24.04, Ubuntu 22.04 or Debian 12 server with at least 1 GB of memory; buildpack builds are hungry, so 2 GB is a safer floor. Dokku installs its own Docker packages and nginx, so do not start from an image that already runs a web server. Log in with your sudo user as described in the first SSH session tutorial and set a proper hostname and DNS record first. If you want each app on its own subdomain, add a wildcard A record such as *.example.net pointing at 198.51.100.24 (see DNS records).
How do you install Dokku?
Ask the project for its newest release tag, then download and run the bootstrap script for that exact tag, so you always know which version went on the server:
DOKKU_TAG=$(curl -fsSL https://api.github.com/repos/dokku/dokku/releases/latest | grep -oP '"tag_name": "\K[^"]+')
echo "$DOKKU_TAG" # for example v0.36.x; stop if this is empty
wget -NP . https://dokku.com/install/$DOKKU_TAG/bootstrap.sh
less bootstrap.sh
sudo DOKKU_TAG=$DOKKU_TAG bash bootstrap.shThe script adds the Dokku apt repository, installs Docker if needed, nginx and the dokku package. Then confirm it:
dokku version
sudo systemctl is-active docker nginxHow do you add keys and set the global domain?
Pushes authenticate with SSH keys registered in Dokku, which are separate from your normal login keys. Add your own public key and set the base domain for apps:
cat ~/.ssh/authorized_keys | sudo dokku ssh-keys:add admin
sudo dokku ssh-keys:list
sudo dokku domains:set-global example.netWith the global domain set, an app named notes is served at notes.example.net by default. If your login uses a different key from your laptop, add that public key instead. Creating and protecting the key pair itself is covered in SSH keys and hardening.
How do you create and push your first app?
Create the app on the server, then add a Git remote on your computer and push. Dokku detects the language from the files in the repository:
# on the server
sudo dokku apps:create notes
sudo dokku config:set notes NODE_ENV=production SECRET_KEY=change-me
# on your computer
cd ~/code/notes
git remote add dokku dokku@example.net:notes
git push dokku mainThe push prints the build output, runs the app and reports the URL. Later pushes repeat the same steps, and healthchecks declared in app.json let Dokku confirm the new release is answering before traffic moves to it. If your branch is not called main, push with git push dokku mybranch:main or set sudo dokku git:set notes deploy-branch mybranch. To build from a Dockerfile instead of buildpacks, keep a Dockerfile in the repository root and Dokku will use it.
How do you add a PostgreSQL database?
Install the official Postgres plugin, create a service and link it to the app. Linking sets a DATABASE_URL variable and restarts the app:
sudo dokku plugin:install https://github.com/dokku/dokku-postgres.git postgres
sudo dokku postgres:create notesdb
sudo dokku postgres:link notesdb notes
sudo dokku config:show notesTake a dump with sudo dokku postgres:export notesdb > notesdb.dump and restore with postgres:import. Similar plugins exist for MySQL, Redis and other services, all installed the same way.
How do you enable HTTPS with Let's Encrypt?
Install the letsencrypt plugin, set a contact email, enable it per app and add the renewal job:
sudo dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git
sudo dokku letsencrypt:set --global email admin@example.net
sudo dokku letsencrypt:enable notes
sudo dokku letsencrypt:cron-job --addThe app domain must resolve to the server and port 80 must be reachable. Open only the needed ports in ufw:
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enableHow do you scale, read logs and upgrade?
Scale process types defined in your Procfile and watch logs live:
sudo dokku ps:scale notes web=2 worker=1
sudo dokku ps:report notes
sudo dokku logs notes -tDokku upgrades through apt like any package. Read the release notes for migration steps, then run sudo apt update && sudo apt install --only-upgrade dokku and rebuild apps with sudo dokku ps:rebuild --all if the notes ask for it. Plugins update with sudo dokku plugin:update postgres.
What goes wrong most often?
A push rejected with a permission error means the key on your computer is not registered with dokku ssh-keys:add. A build killed midway usually ran out of memory; add swap or use a bigger plan. If the app starts but the URL returns 502, the process is not listening on the port Dokku passes in the PORT variable. Certificate requests fail when DNS still points elsewhere, so check with dig +short notes.example.net.
Plans that fit this guide
Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.
Questions about Dokku git push deploys
Does Dokku have a web interface?
No. It is managed from the command line. Community dashboards exist, but the core tool is SSH and git.
Can Dokku run Dockerfile projects?
Yes. If the repository has a Dockerfile, Dokku builds with it instead of buildpacks, and you can also deploy a prebuilt image with git:from-image.
Can several apps share one server?
Yes. Each app gets its own containers and domain, and nginx routes requests by host name.
Which port does git push use?
The normal SSH port 22, as the dokku user. Keep SSH open in the firewall.
How do I move Dokku to a bigger server?
Install Dokku on the new server, recreate apps and plugins, import database dumps and push again. The migration tutorial covers the server side.
More in Containers and PaaS
- Docker Compose stacks
- Docker volumes and bind mounts
- Read and limit Docker logs
- Free disk space used by Docker
- Build, tag and push Docker images
- Run and manage containers
- Podman and rootless containers
- Docker Swarm across servers
- Automatic updates with Watchtower
- Portainer CE web UI
- Dokploy self-hosted PaaS
- CapRover PaaS
- Coolify on your own server