What is Dokku?
Erick Wachira
📖 2 min read
August 19, 2020

So what is Dokku, another bit, another TL;DR;.

Let's jump into it.

You might know Heroku, (my opinion) the greatest platform to ever make it easy to deploy server and client side applications so fast and easy.

Well Heroku is a business and they have to make their money, so it has a pricing plan, and the free tier can only get so far.

So what if..., this is about to blow your mind. blow your mind.

You can have your own Heroku-ish, host as many applications as you want(might dent your wallet), set your own rules and still keep the Heroku's simplicity on deployments.

Its Dokku 🙌

I mean when I discovered Dokku man, been using it ever since -> I frigging love it. Everything basic feature that Heroku offers Dokku offers and its free to host your own Dokku(it's Open-source).

Okay I know if the deal is too good think twice.

So let's jump into the pros and cons of Dokku.

Pros

  1. Allow deployment of apps faster and easier just like Heroku

  2. Allows installation of plugins such as Postgres/MongoDB and more

  3. Allocate certificate with Let's encrypt for free using their plugin

  4. No learning curve if you worked with Heroku CLI

  5. It's cheaper to run Dokku than pay for Dyno hours.

  6. Your apps aren't shutdown on inactivity

Cons

  1. Well it's all CLI not UI(Heroku kills it here), there are tools that give dokku a UI, will list them in the future.

  2. Cloud version control integrations like Github/BitBucket.

  3. Review app -> Heroku allows branch deploys, Dokku doesn't do that out of the box.

  4. Having your apps run on Heroku let's you worry about other things other than maintaining a server.

Conclusion

  • If you want to setup Dokku to your web service here

We will dive into more Bits the next one.


Setting up Dokku
Erick Wachira
📖 3 min read
August 19, 2020

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:
    • Buy a domain from Namecheap/Godaddy for 0.99\$ for first time accounts
    • Create an A record to point to your VPS Ip

      - 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.

    •   ssh username@ip-address
  3. Change the server hostname

    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 to get the script.

    • The script was created Dokku and they one for each linux os

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

    curl -s https://packagecloud.io/install/repositories/dokku/dokku/script.deb.sh | sudo bash
    • Select Yes when this window pops up

    • Check if dokku is installed by typing id dokku

    • Start the Dokku service

     sytemctl status dokku-installer.service
    • Confirm the service is running by typing systemctl is-enabled dokku-installer.service the result is enabled if its running

    • Let's install core dependencies

     dokku plugin:install-dependencies --core
  6. Install docker

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

    Check if docker is installed by running

    docker version
     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 host name we provided the step 3 just paste on the Hostname input and check the virtualized host checkbox.
    • The value for the input of virutalized hostname will now be.

      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.