CartoDB works with Ubuntu 16.04 x64. This documentation describes the process to install CartoDB in this specific OS version.

However this doesn’t mean that it won’t work with other Operating Systems or other Ubuntu. There are also many successful installations on Amazon EC2, Linode, dedicated instances and development machines running OS X and Ubuntu 12.04+.

Besides the OS version mentioned in the introduction, there are some system requirements needed before starting with the installation of the stack. Also this process assumes that you have enough permissions in the system to run successfully most part of the commands of this doc.

Although we try to maintain packaged versions of almost every part of the stack, there are some parts like gems or npm packages that need some development tools in the system in order to compile. You can install all the needed build tools by doing this:

sudo apt-get install autoconf binutils-doc bison build-essential flex

You will also need to install GCC 4.9 in order to build some Node modules later. You can install it doing this:

PostgreSQL access authorization is managed through pg_hba.conf configuration file, which is normally in /etc/postgresql/9.5/main/pg_hba.conf. Here it’s defined how the users created in postgresql cluster can access the server. This involves several aspects like type of authentication (md5, no password, etc..) or source IP of the connection. In order to simplify the process of the installation we are going to allow connections with postgres user from localhost without authentication. Of course this can be configured in a different way at any moment but changes here should imply changes in database access configuration of CartoDB apps.

This is the pg_hba.conf with the no password access from localhost:

local all postgres trust
local all all trust
host all all 127.0.0.1/32 trust

For these changes to take effect, you’ll need to restart postgres:

sudo service postgresql restart

Create some users in PostgreSQL. These users are used by some CartoDB apps internally

Initialize template postgis database. We create a template database in postgresql that will contain the postgis extension. This way, every time CartoDB creates a new user database it just clones this template database

By default redis server is configured to not have any type of disk persistence. If stopped or restarted everything stored in redis will be lost. In CartoDB redis is not just a simple cache storage. It stores information that need to be persisted.

Make sure to have proper values of save, appendonly and appendfsync config attributes. For more information check http://redis.io/topics/persistence

Ruby-install will leave everything in /opt/rubies/ruby-2.2.3/bin. To be able to run ruby and gem later on, you’ll need to add the Ruby 2.2.3 bin folder to your PATH variable. It’s also a good idea to include this line in your bashrc so that it gets loaded on restart

exportPATH=/opt/rubies/ruby-2.2.3/bin:$PATH

Install bundler. Bundler is an app used to manage ruby dependencies. It is needed by CartoDB’s editor