Introduction
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:
|
|
Next, we’ll ssh
in and install the Dokku control plane and upload our ssh key
so that we can push to the respository:
|
|
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:
|
|
We’re now ready to clone and push our first application. We’ll pick the ruby-getting-started
app:
|
|
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!