Table of Content
- What is Dokku?
- How does Dokku Work?
- What is the Benefit of Dokku?
- Disadvantage of Using Dokku
- How to Set Up Dokku on Digital Ocean
- Wrap Off
Dokku is a piece of open-source software that “helps you build and manage the lifecycle of applications”.
It uses Docker under the hood to create and run applications inside containers and supports Ubuntu 14.04/16.04, Debian 8.2, and CentOS 7 platforms with a very small team of core maintainers.
In this tutorial, you will learn how to install and set up Dokku on Digital Ocean as a convenient and budget-friendly way to deploy apps to DigitalOcean.
What is Dokku?
Dokku is a free and open-source tool for creating a personal docker-powered PaaS (Platform as a Service) that helps you build and manage the lifecycle of your applications easily.
If you are familiar with Heroku, you can think of it as your own self-hosted Heroku, but way cheaper.
Dokku can be installed on any hardware, which makes it super easy to manage your server.
How does Dokku Work?
Dokku installs Docker and then uses it to manage deployments of applications.
It allows you as a developer to push applications to it using Git.
Then it will build those applications for you, package them into a Docker container, and then manage the lifetime of that container on your behalf.
It will also automatically configure Nginx so that your application can be reached, with its virtual hostname support.
What is the Benefit of Dokku?
There are a lot of benefits that come with using Dokku, however, here are the top ones that resonate with us:
Dokku makes it super easy to create containers for each app in the terminal.
You can also create free SSL certificates with let's encrypt that are auto-renewed just before they expire.
Once you've set up your host, you can use Git to push your application to the server.
When you make an update to the application and push it to git, your container environment is torn down and recreated once again according to your configuration.
When used for deployment, Dokku supports zero-down-time deploys, as it can keep your old environment alive until the new one is fully built.
You can control Dokku through simple CLI commands or through a web interface using third-party libraries.
Disadvantage of Using Dokku
There is no official web interface for managing an application through a browser.
Everything is done via the command-line only.
For some people, that may be a turn-off.
However, to supplement this, Dokku CLI is very simple to learn using the Bash scripting language.
How to Set Up Dokku on Digital Ocean
1. Get an Account on DigitalOcean
To begin, you will be required to have an account with Digital Ocean.
If already have an account with Digital Ocean, you may skip this step, otherwise use the link: Digital Ocean to create a new account and receive $200 worth of credit for your project in the first two months!
While setting up your Digital Ocean account, you may be required to enter your card details for verification.
That said, we can move to the next step.
2. Create a New DigitalOcean Project
Once you have created your account, you can go ahead and create a new project from within the DigitalOcean dashboard.
Click “Create Project” in the menu and follow the instructions provided by DigitalOcean.
3. Set Up DigitalOcean Droplet in the Project
After creating a new project, we can go ahead and create a new droplet.
DigitalOcean Droplets are simply the name DigitalOcean calls the VPS instances.
It's just your server.
Fortunately, the DigitalOcean marketplace provides pre-configured versions of Linux Ubuntu and Dokku.
We can use this to save some valuable time, as it requires less server configuration.
You find it under the marketplace tab while searching for “Dokku”.
During the time of this tutorial, the current version of Dokku was 0.21.4 and the version of Ubuntu is 20.04.
Hence, the actual version numbers may vary when you follow this tutorial.
When you search, select “Dokku 0.21.4 on Ubuntu 20.04”.
Select a suitable region for the server.
Once you have selected a region suited for you, we can go ahead and select an SSH key that we want to associate with our new server.
We choose to authenticate via SSH keys as it is generally much more secure than using a one-time password.
4. Add your SSH key to DigitalOcean
When you got your SSH key at hand, you will have to open your DigitalOcean cloud dashboard and navigate to Settings > security or the URL
cloud.digitalocean.com/account/security and click the button Add SSH Key.
Here is how you can create, access, and use SSH on Mac and Linux OS platforms.
5. Access the SSH of your droplet
Once your droplet has booted up, we can go ahead and open our terminal and SSH into the newly created droplet.
Follow the instruction and choose yes if asked to add the host to the list of hosts on your computer.
If your authentication is successful, you will be greeted with the following prompt.
6. Update Dokku to the Latest Version
Update to the latest version of Dokku. We can install the latest version with wget.
To make sure you are updating to the latest version of Dokku you can check the release page.
7. Configure Dokku
When the update is done, you can configure Dokku by navigating to our IP address in the browser (http://123.456.789.101).
Here you will be greeted with the Dokku setup page.
Verify that the SSH key is correct and add your domain name and click the checkbox to use virtual host naming for apps.
The next thing you need to do is decide whether to use virtual host naming for your apps.
If you opt to use virtual host naming for apps, your applications will be available at http://appname.yourdomain.com, and you can redirect individual apps to specific domains later.
Virtual host naming does not restrict you from serving your final application from the “appname” subdomain.
If you have a domain that you want to use (e.g.
example.com), then you can turn on virtual host naming by ticking the box so that your apps are accessed as subdomains.
For example, creating an app called “Test” will mean that you will be able to access your application at
If you do not have a domain that you wish to use for your Dokku server, then you should leave this box unticked.
This will mean that your apps would become available on a specific port number, e.g.
You will need to configure the firewall to open specific application ports.
I have a domain I'm going to use, so I will tick the box.
One thing you should know is that for this to work, you must configure your domain's DNS with an A record that points to your Dokku server.
In my example, I'm using a domain
nsikakimoh.com with an A record of
* that points to my server at
This means that any traffic that goes to a subdomain e.g.
http://test.nsikakimoh.com will be routed to my Dokku server and Nginx will route it to the correct place.
Also, note that changing your DNS settings may require a bit of time for the changes to fully take effect.
With that done, click “Finish Setup” to proceed. Your Dokku server is now ready to go!
That's basically all there is to it.
If done correctly, you should have now installed Dokku on DigitalOcean and are now ready to start serving our docker-powered containerized applications.
If you learned from this tutorial, or it helped you in any way, please consider sharing and subscribing to our newsletter.
Please share this post and for more insightful posts on business, technology, engineering, history, and marketing, subscribe to our newsletter.