How to Install Dokku on Debian Latest

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.

Prerequisites

Before we proceed with the installation of Dokku, you need to ensure that you have the following prerequisites:

Step 1: Update the System

The first step is to update the system packages. To do this, run the following command:

sudo apt update && sudo apt upgrade -y

Step 2: Install Dokku

To install Dokku, we need to add the Dokku repository to our system. To do this, follow the steps below:

  1. Add the Dokku repository key:
wget -qO - https://packagecloud.io/dokku/dokku/gpgkey | sudo apt-key add -
  1. Add the Dokku repository to the system:
echo "deb https://packagecloud.io/dokku/dokku/debian/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/dokku.list
  1. Update the packages list:
sudo apt update
  1. Install Dokku:
sudo apt install dokku

Step 3: Configure Dokku

After installing Dokku, we can start configuring it. To do this, follow the steps below:

  1. Configure the hostname:

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.

  1. Configure SSH:

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.

Step 4: Create and Deploy an Application

Now that Dokku is configured, we can create and deploy an application. To do this, follow the steps below:

  1. Create an application:
dokku apps:create myapp

Replace myapp with a name for your application.

  1. Deploy the 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.

Step 5: Access the 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!