Featured Tutorial

Build like Heroku with Dokku and Entrywan App Platform

Entrywan App Platform (Beta) logo
Aaron Groom | entrywan
October 17, 2024
Dokkku Entrywan

Over 15 years ago, Heroku pioneered the git push heroku master workflow – take your source code repository, push to them, and have it be built and deployed for you.

The idea caught on quickly, and Heroku became a popular PaaS for individuals and teams who don’t want to focus on the underlying infrastructure. Even today with modern CI/CD workflows, Heroku remains a popular place to test out ideas and “get something working” quickly.

This blogpost is a summary of the video below. All commands issued in the video can be found in the post.

Self-host your own PaaS on Entrwan with Dokku video

The Cheap and Reliable alternative to Heroku

At $43/month for a 1GB RAM dyno, though, running production workloads on Heroku is prohibitely expensive for many. Modern cloud providers like Entrywan allowing provisioning compute intances for $2/GB of RAM, and provide Heroku “enterprise-only” features like VPCs for free.

Since Heroku’s launch, a number of open-source implementations have sprung up. One of them being Dokku. These platforms give people the ability to self-host a PaaS with many of the same features as Heroku.

In this post, we’ll set up a Dokku instance and make a few initial observations.

Setting up Dokku on Entrywan

First, we’ll need a suitable host running either Debian or Ubuntu with at least 1GB of RAM. We can set up an Entrywan instance for that using the command line interface:

1
$ entrywan instance create --hostname dokku --location us1 --os debian --sshkey demo --cpus 2 --ram 4 --disk 20

Next, we’ll ssh in and install the Dokku control plane and upload our ssh key so that we can push to the respository:

1
2
3
dokku$ wget -NP . https://dokku.com/install/v0.35.5/bootstrap.sh
dokku$ sudo DOKKU_TAG=v0.35.5 bash bootstrap.sh
dokku$ cat ~/.ssh/authorized_keys | dokku ssh-keys:add admin

Pushing an App

At this stage, you’ll want to point an A record in your DNS settings to the IP address of your host, and then register it with Dokku:

1
dokku$ dokku domains:set-global dokku.me

We’re now ready to clone and push our first application. We’ll pick the ruby-getting-started app:

1
2
3
4
5
dokku$ dokku apps:create ruby-getting-started
$ git clone https://github.com/heroku/ruby-getting-started
$ cd ruby-getting-started
$ git remote add dokku dokku:ruby-getting-started
$ git push dokku main

Build, Deploy, Profit

At this point, Dokku will build and deploy our application. As we make changes to it and push to the remote Dokku instance, it will rebuild and redeploy our app.

Dokku provides many built in commands to let us manage our application. You can list applications with dokku apps and fetch application logs with dokku logs.

Try it for yourself and let us know what you end up building!