CartoDB works with Ubuntu 16.04 x64. This documentation describes the process to install CartoDB in this specific OS version.
CARTO 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+.
You will find notes along this guide explaining some of the Ubuntu 16.04 specifics, and pointing to alternative solutions for other environments.
System requirements
-------------------
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.
@ -36,17 +38,18 @@ Although we try to maintain packaged versions of almost every part of the stack,
CARTO requires PostgreSQL 10+. The PPA packages also provide some additional patches, which are not needed but help improve the experience in production environments.
PostgreSQL access authorization is managed through pg_hba.conf configuration file, which is normally in ``/etc/postgresql/10/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 CARTO apps.
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:
Edit ``/etc/postgresql/10/main/pg_hba.conf``, modifying the existing lines to use ``trust`` authentication (no password access from localhost):
..code-block:: bash
@ -101,11 +94,10 @@ For these changes to take effect, you'll need to restart postgres:
..code-block:: bash
sudo service postgresql restart
sudo systemctl restart postgresql
* Create some users in PostgreSQL. These users are used by some CartoDB apps internally
* Create some users in PostgreSQL. These users are used by some CARTO 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.
By default redis server is configured to only have periodic snapshotting to disk. If stopped or restarted some data stored in redis since the last snahpshot can be lost. In CARTO 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`
For data safety, make sure to have proper values of *save*, *appendonly* and *appendfsync* config attributes. For more information check `http://redis.io/topics/persistence`
NodeJS
------
NodeJS is required by different parts of the stack. The more significant are the Maps and SQL APIs. It's also used to install and execute some dependencies of the editor.
* Add the PPA
..code-block:: bash
@ -237,11 +207,8 @@ NodeJS is required by different parts of the stack. The more significant are the
nodejs -v
npm -v
If npm version is wrong you should update it:
..code-block:: bash
npm install npm@3.10.9 -g
..warning::
CARTO uses Node JS v6.9.2 and npm 3.10.9. You must use these precise versions to avoid problems.
We will also install some development libraries that will be necessary to build some Node modules:
* Maps API dependencies are managed using yarn. Install it:
..code-block:: bash
npm install
sudo npm install -g yarn@0.27.5
* Install yarn dependencies
..code-block:: bash
yarn install
* Create configuration. The name of the filename of the configuration must be the same than the environment you are going to use to start the service. Let's assume it's development.
* 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
* Install ruby 2.2
..code-block:: bash
export PATH=/opt/rubies/ruby-2.2.3/bin:$PATH
sudo apt-get install ruby2.2 ruby2.2-dev
* Install bundler. Bundler is an app used to manage ruby dependencies. It is needed by CartoDB's editor
* Install bundler. Bundler is an app used to manage ruby dependencies. It is needed by CARTO Builder
..code-block:: bash
sudo gem install bundler
sudo apt-get install ruby-bundler
* Install compass. It will be needed later on by CartoDB's editor
* Install compass. It will be needed later on by CARTO's editor
..code-block:: bash
@ -360,7 +319,10 @@ Ruby
Editor
------
* Download the editor code
..note::
CARTO users Python 2.7+. Python 3 will not work correctly.
* Download Builder's code
..code-block:: bash
@ -378,14 +340,14 @@ Editor
..code-block:: bash
sudo apt-get install python-all-dev
sudo apt-get install python-pip
* Install dependencies
..code-block:: bash
sudo apt-get install imagemagick unp zip
sudo apt-get install imagemagick unp zip libicu-dev
If gdal keeps failing, see more information here: http://gis.stackexchange.com/questions/28966/python-gdal-package-missing-header-file-when-installing-via-pip
* Add the grunt command to the PATH
..code-block:: bash
export PATH=$PATH:$PWD/node_modules/grunt-cli/bin
* Install all necesary gems
@ -419,11 +376,17 @@ Editor
bundle install
* Compile static assets
..code-block:: bash
npm run carto-node && npm run build:static
* Precompile assets. Note that the last parameter is the environment used to run the application. It must be the same used in the Maps and SQL APIs
* (Optional) Precompile assets. Needed if you don't want to use CARTO's CDN for assets.