How to Install Dokku on Ubuntu 26.04
Dokku is a free, self-hosted platform-as-a-service (PaaS) you run on your own single server. It’s essentially a DIY alternative to Heroku. You still deploy with a plain git push, but the underlying machine and everything running on it are entirely yours.
Behind the scenes, each application runs in its own Docker container, while Nginx routes requests as needed. Most popular languages and frameworks work right away thanks to automatic buildpack detection. Alternatively, you can hand it a Dockerfile to take full control of the build process.
Dokku's appeal comes down to two things: what you save and what you control. Instead of per-app or per-dyno (lightweight, isolated container) pricing, you pay for a server, often as little as $5-20/month, with no overhead for a management layer on top.
In addition to reduced running costs, you get full root access to your server so you can install anything and configure it with a plugin system to add databases, SSL certificates, and backups.
This tutorial walks you through installing Dokku on Ubuntu 24.04, step by step, from initial server setup to deploying your first app.
#Prerequisites
Here is what you need before getting started:
-
A VPS running Ubuntu 24.04. You can deploy a high-performance and scalable cloud VPS on Cherry Servers to follow along.
-
A fully qualified domain name pointing to the server's IP address. For illustration, we will use
example.comas our domain. -
1 GB RAM is generally the baseline for a comfortable experience. For an enhanced experience, 2GB or more is encouraged.
-
A sudo user configured on the instance.
-
A firm grasp of the Linux command line.
Scalable VPS Hosting
Deploy fast, secure VPS for websites, apps, and dev environments. Scale on demand, manage with full root access, and get 24/7 expert support.
#Installing Dokku on Ubuntu 24.04
Installing Dokku is quite simple. A single bootstrap script from the official Dokku website handles the entire setup, so you don't have to configure each component manually.
To make sure everything works correctly, we'll wrap up this tutorial by deploying a sample application and running a few quick checks. That way, you'll know your Dokku setup is solid before putting it to real use.
#Step 1: Update the system
Best practice recommends starting with a fresh VPS server. You can easily set up a VPS from scratch by following our step-by-step tutorial.
Once your VPS is up and running, connect to it via SSH and update the local package index.
sudo apt update
#Step 2: Configure Hostname
Next, configure the hostname for your VPS instance. You can achieve this using the hostnamectl command:
sudo hostnamectl set-hostname example.com
Next, update the /etc/hosts file with the server’s public IP and fully qualified domain name for hostname resolution. To do this, switch to the root user.
sudo su -
Then update the file as follows.
echo "server-public-ip example.com" >> /etc/hosts
Confirm the hostname by running the command:
hostname -f
The output should confirm your server’s hostname.
#Step 3: Install Dokku on Ubuntu
Next, download the bootstrap script to install Dokku as shown below.
wget -NP . https://dokku.com/install/v0.38.25/bootstrap.sh
This doesn't install Dokku yet. It simply downloads the installation script into your current directory.
Next, run the following command to install Dokku.
sudo DOKKU_TAG=v0.38.25 bash bootstrap.sh
Here, the DOKKU_TAG=v0.38.25 directive pins the current Dokku version and instructs the script to use it during installation. The bash bootstrap.sh portion executes the script.
When executed, the command performs the following actions:
Runs environment checks
Before installing anything, the bootstrap script calls the ensure-environment function, which acts as a pre-flight check. This function verifies that the server's hostname resolves properly to a fully qualified domain name by running hostname -f. If that check fails, the script stops right away and throws an error pointing you to fix your /etc/hosts file.
Next, it checks the total system memory in the /proc/meminfo file. If it's under the ~1 GB threshold, it prints two warning lines suggesting you set up swap, with a link to Dokku's docs on that. It's just a warning, and the installation continues regardless of how little memory you have.
Detects the OS and architecture
The script then reads the /etc/os-release file to obtain the Linux distribution and version. This information is provided by the DOKKU_DISTRO variable, which fetches the distribution name (e.g., ubuntu), and the DOKKU_DISTRO_VERSION variable, which fetches the release (e.g., 24.04).
Installs DOKKU requirements
Next, the script calls the install-requirements function and installs the dependencies required to install Dokku. It then adds Ubuntu's Universe repository.
Installs DOKKU itself
Finally, the script validates your OS version, installs Docker (if not already present), and installs Dokku from the Dokku APT repository. Dokku's GPG signing key is fetched, and a new source list entry is added, pointing at packagecloud.io/dokku/dokku, scoped to your Ubuntu codename (noble for 24.04).
The script then runs apt update to refresh the package index and pick up the new repository. It installs the Nginx web server and configures a virtual host file, along with the other system dependencies required by Dokku's core plugins.
Once the installation is complete, you will find instructions for setting up the public SSH key for app deployment.
echo 'CONTENTS_OF_ID_RSA_PUB_FILE' | dokku ssh-keys:add admin
#Step 4: Configure server domain and add the public SSH key
Before adding the public SSH key, set your global server domain by running the following command:
Replace example.com with your actual domain name.
dokku domains:set-global example.com
If successful, you will get a confirmation as shown.
Output-----> Set example.com
For Dokku, SSH keys are the deployment authentication system. It relies on SSH to execute git operations, such as git push, to deploy code.
From your local machine, generate an SSH key pair (if none exists) with no passphrase and accept the default path.
ssh-keygen
Once done, print the public SSH key and copy it.
cat ~/.ssh/id_ed25519.pub
Head back to the Dokku server and switch to the root user.
sudo su -
Then register the public key copied from your local machine as shown. Replace ** admin ** with any label you prefer.
echo "ssh-ed25519 AAAA...yourkeytexthere yourname@laptop" | dokku ssh-keys:add admin
Next, confirm the added SSH keys:
dokku ssh-keys:list
You should get output similar to what is displayed below.
OutputSHA256:dPSwcpGn4CYahHEqWa/7nZYzt2cPO897+2N1WpewlKY NAME="admin" SSHCOMMAND_ALLOWED_KEYS="no-agent-forwarding,no-user-rc,no-X11-forwarding,no-port-forwarding"
In addition, confirm the domain name has been successfully registered.
dokku domains:report --global
Output=====> --global domains information
Domains global enabled: true
Domains global vhosts: example.com
#Step 5: Confirm Dokku installation
At this point, Dokku is already installed and ready to accept applications. Confirm the version installed by running:
dokku version
At the time of publishing this guide, the latest version is 0.38.25, though this will naturally change over time.
Outputdokku version 0.38.25
Additionally, check all the enabled plugins.
dokku plugin:list
Docker and Nginx are installed alongside Dokku. To verify their statuses, run the following commands:
For Docker
sudo systemctl status docker
For Nginx
sudo systemctl status nginx
In both cases, you should observe that the services are up and running.
#Step 5: Deploy a sample app on Dokku
Let’s now deploy a trivial app to the Dokku server. We’ll download a simple app called smoke-test-app from GitHub and deploy it to the server.
First, create an internal app record on the Dokku server before it can accept a git push from that name.
dokku apps:create smoke-test-app
The command creates a virtual host file for the app and configures the Nginx web server to serve it.
Output-----> Creating smoke-test-app...
-----> Creating new app virtual host file...
! No web listeners specified for smoke-test-app
-----> Configuring smoke-test-app.example...(using built-in template)
-----> Creating http nginx.conf
Reloading nginx
On your local machine (not the Dokku server), clone Dokku's official smoke-test app locally. This is a tiny web app with no real dependencies to get in the way.
git clone https://github.com/dokku/smoke-test-app
Navigate into the cloned directory.
cd smoke-test-app
Next, add your Dokku server as a git remote.
git remote add dokku dokku@yourserver-ip:smoke-test-app
Replace server-ip with your actual server's hostname or public IP. The dokku user here is the SSH user Dokku creates for itself — this is why your SSH key needed to be added via dokku ssh-keys:add during setup. Without it, this push will be rejected.
Now it’s time to push the app to Dokku for deployment. But first, confirm your branch name as follows.
git branch
This prints out either master or main. Using your branch’s name, push the app to Dokku.
git push dokku master
The command displays Dokku's build process in real time. It detects the buildpack/Dockerfile, builds a container image, runs it, and configures nginx as a reverse proxy in front of it. Finally, it prints the URL your app is now reachable at.
Here's a snippet of the output.
Enumerating objects: 40, done.
Counting objects: 100% (40/40), done.
Delta compression using up to 2 threads
Compressing objects: 100% (34/34), done.
Writing objects: 100% (40/40), 10.37 KiB | 5.19 MiB/s, done.
Total 40 (delta 18), reused 23 (delta 3), pack-reused 0
remote: -----> Cleaning up...
remote: -----> Building smoke-test-app from herokuish
remote: -----> Setting config vars
remote: CURL_CONNECT_TIMEOUT: 90
remote: -----> Setting config vars
remote: CURL_TIMEOUT: 600
remote: -----> Adding BUILD_ENV to build environment...
remote: BUILD_ENV added successfully
-----> Fetching custom buildpack dokku/buildpack-null
remote: Cloning into '/tmp/buildpacks/custom'...
-----> null app detected
Performing no commands for null buildpack
-----> Discovering process types
Procfile declares types -> web
#Step 6: Verify App Deployment
On the Dokku server, run the following commands to confirm the app deployed successfully.
dokku apps:report smoke-test-app
Output=====> smoke-test-app app information
App created at: 1786658286
App deploy source: git-push
App deploy source metadata: 96f6ba2db912c93707080a358016d1febb7c560a
App dir: /home/dokku/smoke-test-app
App global disable autocreation:
App locked: false
Run the following dokku command to retrieve detailed information.
dokku ps:report smoke-test-app
To view the app's logs, run:
dokku logs smoke-test-app
Output2026-08-13T22:05:49.619310283Z app[web.1]: 172.17.0.1 - - [13/Aug/2026 22:05:49] "GET / HTTP/1.1" 200 -
Run this command to check the status of domains and see what URLs route to the deployed app.
dokku domains:report smoke-test-app
Output=====> smoke-test-app domains information
Domains app enabled: true
Domains app vhosts: smoke-test-app. example.com
Domains global enabled: true
Domains global vhosts: example.com
The tests above confirm we successfully deployed the application to the Dokku server.
#Setting up Let's Encrypt SSL For Dokku
Dokku is successfully installed and working as expected. However, data between your apps and users currently travels in plain text. Anyone with the right tools and skills can intercept and read sensitive information such as passwords, API tokens, and session cookies.
It's, therefore, crucial to secure your server with an SSL/TLS certificate. This enables the HTTPS protocol, which encrypts data exchanged between your server and app users, keeping sensitive information safe from malicious actors.
Let's Encrypt is a free, automated, and open certificate authority (CA) that provides a TLS layer to secure web traffic, ensuring sensitive information stays safe. It's a near-perfect fit for Dokku due to its cost-effectiveness (totally free) and the fact that it can be configured to renew the SSL/TLS certificate automatically after 90 days.
Before proceeding, ensure you have satisfied the following requirements:
- Your domain must have a DNS A record pointing at the server's IP address.
- The app must already be deployed and responding (
dokku ps:report myappshould show it running). - Port 80 (and 443) must be open on your firewall/security group.
1. Install Let's Encrypt Plugin
On your Dokku server, run the following:
sudo dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git
When executed, Dokku downloads the plugin's source code from the provided GitHub repository. It then installs the plugin alongside dependencies like `certbot ', which automates the process of fetching and renewing SSL/TLS security certificates.
2. Configure an E-mail Address
Next, set up a global default email address that the Let's Encrypt plugin will use when requesting SSL/TLS certificates for any app on your server.
sudo dokku letsencrypt:set --global email [email protected]
Output=====> Setting email to [email protected]
3. Configure a Domain for Your Application
Let's assume your application is called:
smoke-test-app
And you want to access it using the domain:
example.com
First, make sure your domain’s DNS record points to your server:
example.com → YOUR_SERVER_PUBLIC_IP
Then run the following command to configure the domain in Dokku:
sudo dokku domains:set smoke-test-app example.com
Output-----> Set example.com for smoke-test-app
! Please run dokku letsencrypt:enable to add https support to the new domain
-----> Configuring example.com...(using built-in template)
-----> Creating http nginx.conf
Reloading nginx
4. Request the SSL/TLS Certificate
Once the domain is configured for your application, enable Let's Encrypt for your application by running the following command:
sudo dokku letsencrypt:enable smoke-test-app
The Let's Encrypt plugin performs the following tasks:
- Checks the domain configured for your application.
- Contacts Let's Encrypt and requests a certificate.
- Confirms that you control the domain using an ACME validation challenge.
- Fetches the SSL/TLS certificate once validation succeeds.
- Configures the certificate for your Dokku application.
You should see the following lines towards the end of the output.
Output-----> Certificate retrieved successfully.
-----> Installing let's encrypt certificates
-----> Configuring example.com...(using built-in template)
-----> Creating https nginx.conf
Enabling HSTS (using built-in template)
Reloading nginx
-----> Ensuring network configuration is in sync for smoke-test-app
-----> Configuring example.com...(using built-in template)
-----> Creating https nginx.conf
Enabling HSTS (using built-in template)
Reloading nginx
-----> Disabling ACME proxy for smoke-test-app...
-----> Done
To check that the SSL/TLS certificate is active, run:
sudo dokku letsencrypt:active smoke-test-app
This should print true as the output, confirming Let’s Encrypt has been enabled.
Outputtrue
You can now access your application from a web browser using the HTTPS protocol.
Outputhttps://example.com
5. Configure Automatic Certificate Renewal
Let's Encrypt certificates have a 90-day lifetime, after which they expire. Thankfully, you can enable automatic renewal to keep your server secure — just add a cron job that renews the certificate on a schedule.
sudo dokku letsencrypt:cron-job --add
Output-----> Added cron job to dokku's crontab.
Confirm the renewal cron job has been enabled by running:
sudo dokku letsencrypt:cron-job
You should get the following output.
Output=====> Auto-renew cron job is enabled
Run 'dokku letsencrypt:cron-job --remove' to disable.
#Conclusion
You've now got Dokku up and running on Ubuntu 26.04, taking you from a fresh server to a fully functional platform-as-a-service. Along the way, you installed the necessary dependencies, ran the Dokku installation script, configured your SSH keys for deployment access, and set up your domain and web server settings.
With this foundation in place, you have a self-hosted alternative to services like Heroku, one that gives you full control over your infrastructure while still allowing you to enjoy the simplicity of git push deployments. From here, the next step is putting your Dokku instance to work. Try deploying your first application to see the workflow in action, whether that's a Node.js, Python, Ruby, or PHP project.
Read Next
Starting at just $3.51 / month, get virtual servers with top-tier performance.