Quick and Cheap Deployments with Dokku
***

Quick and Cheap Deployments with Dokku

Est. 2m read

Juggling Deployments

A couple months ago I was hosting a Discord bot1 and a DB on a PaaS (Platform as a Service) and the platform gave me $5 to host my first app, but for every app after was another $5 per month and that’s not accounting for persistent volume costs… seems expensive.

My first thought was to buy a second PC and just host everything on a shelf in my bedroom, but this comes with its own costs and concerns.

After some tinkering with a VPS, I’ve got a solution I’m happy with: $5 VPS + Dokku = Personal PaaS

Dokku Perks

  • Has Redis, MongoDB, RabbitMQ plugins (and many more)
  • Has domain and subdomain support out-of-the-box
  • Supports Heroku-style deployments, Docker-style deployments, and a few other styles

The Setup

Getting started was as simple as setting up Dokku once and then just pushing code. I create an app with dokku apps:create app-name, add a new remote with git remote add dokku dokku@ip-addr, and git push dokku branch. It shows the deployment log in the git push command and will let me know if it successfully deployed.

So no more renting multiple servers or wasting $5 more for one more app. With Dokku, I could host at least 10 applications on a low-spec VPS.

Takes Some Effort

Dokku is not too complicated. I’ve got 3 Redis instances, 2 MongoDBs and ~3 apps running in one VPS without any fuss. Some are using Dockerfiles to deploy, others are using “Herokuish buildpacks” which require only a Procfile with a single line for startup. Herokuish is my preferred builder, I’ll only use Docker if the startup command requires more than a single line.

Quick Reference

Switching to Dockerfile deployment

$ dokku builder:set <my-app> selected dockerfile