How to setup Dokku
Tags: dokku, docker, devops, heroku
Published: 2020-08-22 21:02:14

Let's jump into it... fast. You got here because you want to setup Dokku and the other ways don't work... let's goooo

> I will setup for Dokku only

1. Point your domain to the VPS of choice

   - Spin up new VPS server here:
     - [Digital Ocean](https://m.do.co/c/9ab46f18949d)
     - [Linode](https://www.linode.com/?r=d641e21b07fe411699a6dd52f801945caf9da408)
   - Buy a domain from Namecheap/Godaddy for 0.99\$ for first-time accounts
   - Create an `A` record to point to your VPS Ip

     ```txt
     - Type -> A
     - Name -> *.your-domain-name.com
     - Value -> <your.vps.ip>
     ```

   - Just a note pick a VPS server with 1GB RAM memory that will probably cost you \$5

2. `SSH` into your server through IP and pass or SSH key if you provided one. 
```bash
ssh username@ip-address
```

3. Change the server hostname
```bash
hostnamectl set-hostname <your-domain.com>

echo "<your.vps.ip> <your-domain.com> dokku" >> /etc/hosts
```

4. So we gonna use a script to get this thing installed, we will head over to [Package cloud](https://packagecloud.io/dokku/dokku/install) to get the script.

   - The script was created Dokku and they one for each Linux os

     ![](https://res.cloudinary.com/duoxba7n1/image/upload/v1598032551/blog/Screenshot_at_2020-08-21_20-50-21.png)

5. Let's run that script on our Ubuntu server

   ```bash
   curl -s https://packagecloud.io/install/repositories/dokku/dokku/script.deb.sh | sudo bash
   sudo apt-get install dokku
   ```

   - Select `Yes` when this window pops up
     ![](https://computingforgeeks.com/wp-content/uploads/2018/07/install-dokku-ubuntu-18.04-enable-web.png?ezimgfmt=ng:webp/ngcb8)

   - Check if `dokku` is installed by typing `id dokku`

   - Start the Dokku service

   ```bash
    sytemctl status dokku-installer.service
   ```

   - Confirm the service is running by typing `systemctl is-enabled dokku-installer.service` the result is `enabled` if it's running

   - Let's install core dependencies

   ```bash
    dokku plugin:install-dependencies --core
   ```

6. Install docker

   ```bash
   wget -nv -O - https://get.docker.com/ | sh
   ```

   Check if Docker is installed by running

   ```bash
   docker version
   ```

   ```txt
    Client:
    Version:           18.06.0-ce
    API version:       1.38
    Go version:        go1.10.3
    Git commit:        0ffa825
    Built:             Wed Jul 18 19:09:54 2018
    OS/Arch:           linux/amd64
    Experimental:      false
    Server:
    Engine:
    Version: 18.06.0-ce
    API version: 1.38 (minimum version 1.12)
    Go version: go1.10.3
    Git commit: 0ffa825
    Built: Wed Jul 18 19:07:56 2018
    OS/Arch: linux/amd64
    Experimental: false
   ```

   > Versions may vary

7. Configure Dokku by visiting your IP on your browser
   - Remember the hostname we provided step 3 just paste on the `Hostname` input and check the `virtualized host` checkbox.
   - The value for the input of the virtualized hostname will now be.

     ```bash
     http://<app-name>.<your-host-name.com>
     ```

   - Click on `Finish Setup` you will be redirected to the `dokku` docs.

### Conclusion

In the next **Bits** I will look into more Dokku or something else.