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. Since most developers rather write code than setting up and troubleshoot servers, 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), but without 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 howerver, we’ll use Dokku. In order to get started, you need the following:
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):
$ sudo apt-get update $ sudo apt-get install -y python-software-properties $ wget -qO- https://raw.github.com/progrium/dokku/v0.2.2/bootstrap.sh | sudo DOKKU_TAG=v0.2.2 bash
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’).