Dokku is a simple, easy-to-use Platform as a Service (PaaS) that allows you to deploy and manage your applications. It is easy to install and can run on a variety of systems. In this tutorial, we will show you how to install Dokku on Debian Latest.
Before we proceed with the installation of Dokku, you need to ensure that you have the following prerequisites:
The first step is to update the system packages. To do this, run the following command:
sudo apt update && sudo apt upgrade -y
To install Dokku, we need to add the Dokku repository to our system. To do this, follow the steps below:
wget -qO - https://packagecloud.io/dokku/dokku/gpgkey | sudo apt-key add -
echo "deb https://packagecloud.io/dokku/dokku/debian/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/dokku.list
sudo apt update
sudo apt install dokku
After installing Dokku, we can start configuring it. To do this, follow the steps below:
Dokku requires a fully-qualified domain name (FQDN) or IP address to function correctly. To set the hostname, run the following command:
sudo dokku config:set --global DOKKU_HOSTNAME=dokku.example.com
Replace dokku.example.com
with your own FQDN or IP address.
By default, Dokku allows you to deploy code via Git over SSH. To do this, we need to configure SSH. Dokku automatically installs and configures an SSH key for you during installation. However, you need to add your public SSH key to Dokku to enable deployment via SSH. To do this, run the following command:
cat ~/.ssh/id_rsa.pub | sudo sshcommand acl-add dokku dokku
Replace id_rsa.pub
with the name of your SSH public key.
Now that Dokku is configured, we can create and deploy an application. To do this, follow the steps below:
dokku apps:create myapp
Replace myapp
with a name for your application.
To deploy your application, push your Git repository to the Dokku server. To do this, run the following command inside your Git repository:
git remote add dokku dokku@dokku.example.com:myapp
git push dokku main
Replace dokku.example.com
with your own FQDN or IP address, and myapp
with the name of your application.
After deploying the application, you can access it using your web browser. To do this, go to http://myapp.dokku.example.com
(replace myapp
and dokku.example.com
with your own values).
Congratulations! Now you know how to install Dokku on Debian Latest and deploy your first application.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!