PaaS with Dokku

Build your own PaaS (with Dokku)

One of the most popular PaaS providers today is Heroku. Heroku, along with other PaaS providers like Engine Yard is loved by developers because it makes the deployment of a new application extremely fast and simple. It’s not hard that most developers would rather write code than setting up and troubleshoot servers. So it’s not hard to figure out why this approach is compelling.

One fundamental piece of technology in Heroku’s stack is Docker. For those not familiar with Docker, it is a wrapper for LinuX Containers (LXC). (The concept is certainly not new; it has been around for for about more than a decade in FreeBSD Jails and Solari’s Zones.) In short, this technology gives you many of the benefits Virtual Machines (VM) can offer (compartmentalization and isolation). All while escaping the complexity and overhead.

If you don’t want to rely on a PaaS service like Heroku or Engine Yard, you can now with the help of tools like Dokku and Fig quickly set up your own PaaS service that will work much the same way (but without the pretty web interface). There is also a much more ambitions project called Flynn, which aspires to create a full PaaS with support for multiple servers.

In this article however, we’ll use Dokku. In order to start, you need the following:

  • An Ubuntu 12.04 VM
  • An FDQN properly configured (‘some.domain.com’ pointing to the server)
  • Optional: A static IP (used with the FQDN)

Depending on what you intend to run in your containers, the resources you need to allocate will differ. If you’re just testing out 2GB RAM, 2GHz CPU and 20GB storage should be sufficient. If you don’t have a CloudSigma account already you can get one instantly.

Once you have the system up and running, all you need to do is to run the following commands (from the installation instructions):

Once you have installed Dokku, you need to follow the configuration steps.

Dokku installed and configured, you can easily deploy your first application in a very similar way that you would on Heroku (via Git). This how it looks in action.

That’s it. You now have your own PaaS up and running that you can easily deploy your own project to. Please note that in order to use this for something more production-like environment, you would most likely want to install something like Nginx on host, and have it act as a reverse proxy for the application (i.e. proxy between ‘http://some.domain.com’ and ‘http://your.server:portnumber’).

C770b64f01d6b9360b59e8470c2754f4?s=80&r=g

About Viktor Petersson

Former VP of Business Development at CloudSigma. Currently CEO at WireLoad and busy making a dent in the Digital Signage industry with Screenly. Viktor is a proud geek and loves playing with the latest technologies.