Deploy Your Rails Applications with Dokku and Linode.

Aws4 request&x amz signedheaders=host&x amz signature=7d07b050acabfa10d7950a28021978a8607f74708929941c177d6c6d4c43e2ec
Denys Kurets
14 January 2017

Dokku version:  v0.7.2

There are a lot of articles on how to deploy Rails with Dokku on DigitalOcean, but not so many about Linode. So the following article is another article on how to deploy Rails with Dokku to Linode server, based on docs,  and own experience.

Domain Settings

In case you want to connect domain to your application and you want to avoid possible problems in the future,  it is better to change domain NS servers before deploying.

Linode NS servers:


Before the start you should create an account on Linode. You could do it here:  signup . You could use my ref link (I don’t know how it works but signup referral link)

Then you should add your billing information. And probably Linode will ask you what amount of money you want to transfer to your account, 5$ is a minimum. Also, you could search in google promocodes. I found a promocode for 20$ here: retailmenot.

Creating “Linode”

Go to Linodes, and choose a plan and location


According to the tutorial, take the following steps:

Open your server's dashboard in the Linode Manager. Make sure your Linode is using KVM, not Xen, for virtualization.

In the "Rebuild" tab, select "Ubuntu 16.04 LTS", set a root password, choose SWAP size(I chose 256MB), setup Deployment Disk Size(I choose all available space) and press Rebuild.

Once your Linode has been created, click "Boot" and wait for it to complete.  SSH into your Linode as a root and run the following commands:

apt-get update
apt-get -qq upgrade
apt-get install linux-image-virtual linux-image-extra-virtual

When prompted, install Grub onto the first hard drive. Back in your server's dashboard, click "Edit" on its Configuration Profile, change the "Kernel" option to "GRUB 2" and save your changes and reboot the Linode.

Connecting Domain to Linode

Go to DNS manager zone, fill in the fields and save. In the section “Insert Default Records” choose the first option and select linode where you will deploy the application.

Go to Remote Process, click “Reverse DNS”.


And look up your domain.

Installing Dokku

ssh root@ip_address #ssh to server


DOKKU_TAG=v0.7.2 bash


After the installation go to the browser http://<your_server_ip>

Enter your ssh key. In case before the installation you copied ssh key to the server, this field will be prefilled with it.

Type hostname(your domain). In case you don’t have a domain, you could enter your server ip address.   

Dokku Configuration

First of all you need to create a dokku application. SSH to your server and make:

dokku apps:create app_name

Then we should create a database. Dokku has a lot of plugins. In our case we will use Postgres.

Install plugins, create a database service, link the database with your application.

dokku plugin:install postgres

dokku postgres:create db_name

dokku postgres:link db_name app_name

It is possible that you need to set “config vars”. In case you have in gitignore the configs that you don’t share in your repository, set config vars, it is easy.

dokku config:set app_name PASSWORD='password'

I also recommend you to change timeout configs. At least I had a problem with it during deployment.

dokku config:set --global CURL_TIMEOUT=600
dokku config:set --global CURL_CONNECT_TIMEOUT=30

Deploying Application

Deploying to dokku is pretty similar to heroku. You could check the instruction Getting Started with Rails 4.x on Heroku.

git remote add dokku dokku@ip_addres:app_name

git push dokku master


In case of any troubles, please look at the special page on dokku site troubleshooting

I had one problem related to permissions while connecting database with app.

Fixed it*:

cd /home/dokku/app_name


Thank you for attention!