- A User Interface for uploading, creating, editing, visualizing,
and exporting geospatial data.
- A geospatial database built on PostgreSQL and PostGIS 2.1
- An SQL API for running SQL queries over HTTP with results formatted
using GeoJSON and KML
- A Map tiler that supports SQL and tile styling using CartoCSS
- Authentication using OAuth if required
# How do I install CartoDB? #
This README is intended for Ubuntu 12.04. This doesn't mean that it can't
be installed on other Linux versions or OSX systems, but that it's guaranteed
to work only in Ubuntu 12.04.
If anyone wants to share with us the installation process for any other system
we will be more than happy to point it from this README.
That said, there are also many successful installations on Amazon EC2, Linode,
dedicated instances and development machines running OS X and Ubuntu 12.04+.
CartoDB is under heavy development. This means that this README
can fail at some point. If see any issues, please let us know and we will fix
them as soon as we can. Also if you feel that something is wrong or even
missing we will be happy to fix it.
For any doubt about the process you can ask in our [Google
Group](https://groups.google.com/forum/#!forum/cartodb). See **Installation diagnosis** section in order to send valuable information if you're already running the CartoDB server.
If you want to give it a try, download CartoDB by cloning this repository:
Currently there is an error with credential-based connections for development, and all connections must be performed using method "trust" inside config file `pg_hba.conf`.
```bash
cd /etc/postgresql/9.3/main
sudo vim pg_hba.conf
```
And change inside all local connections from peer/md5/... to trust.
Then restart postgres and you're done.
```bash
sudo /etc/init.d/postgresql restart
```
## Install PostGIS ##
[PostGIS](http://postgis.net) is
the geospatial extension that allows PostgreSQL to support geospatial
sudo PGUSER=postgres make installcheck # to run tests
```
**NOTE:** if test_ddl_triggers fails it's likely due to an incomplete installation of schema_triggers.
You need to add schema_triggers.so to the shared_preload_libraries setting in postgresql.conf :
```
$ sudo vim /etc/postgresql/9.3/main/postgresql.conf
...
shared_preload_libraries = 'schema_triggers.so'
$ sudo service postgresql restart # restart postgres
```
After this change the 2nd installcheck of cartodb-postresql should be OK.
Check https://github.com/cartodb/cartodb-postgresql/ for further reference
## Install Ruby ##
We implemented CartoDB in the [Ruby](http://ruby-lang.org) programming language, you'll need to install Ruby 1.9.3. You can use rbenv or a system install, up to you.
For rbenv:
### rbenv
Follow the official guide on https://github.com/sstephenson/rbenv#installation
For bundler simply run:
```bash
gem install bundler
```
## Install Node.js ##
The tiler API and the SQL API are both [Node.js](http://nodejs.org) apps.
```bash
sudo add-apt-repository ppa:cartodb/nodejs-010
sudo apt-get update
sudo apt-get install nodejs
```
We currently run our node apps against version 0.10. You can install [NVM](https://github.com/creationix/nvm)
to handle multiple versions in the same system.
Then you can install and use any version, for example:
```bash
nvm install v0.10
nvm use 0.10
```
## Install Redis ##
Components of CartoDB, like Windshaft or the SQL API depend on [Redis](http://redis.io).
```bash
sudo apt-get install redis-server
```
## Install Python dependencies ##
This needs to be done from the cartodb local copy.
To install the Python modules that CartoDB depends on, you can use
`easy_install`.
You need to have some dependencies installed before using pip:
To run Windshaft-cartodb in development mode, simply type:
```bash
node app.js development
```
## Install ImageMagick ##
```bash
sudo apt-get install imagemagick
```
## Optional components
The following are not strictly required to run CartoDB:
### Varnish
[Varnish](https://www.varnish-cache.org) is a web application
accelerator. Components like Windshaft use it to speed up serving tiles
via the Maps API.
Add CartoDB Varnish PPA and install it:
```bash
sudo add-apt-repository ppa:cartodb/varnish
sudo apt-get update
sudo apt-get install varnish=2.1.5.1-cdb1 #or any version <3.x
```
Varnish should allow telnet access in order to work with CartoDB, so you need to edit the `/etc/default/varnish` file and in the `DAEMON_OPTS` variable remove the `-S /etc/varnish/secret \` line.
### Raster import support
Raster importer needs `raster2pgsql` to be in your path. You can check whether it's available by running `which raster2pgsql`. If it's not, you should link it: `$ sudo ln -s /usr/local/src/postgis-2.1.7/raster/loader/raster2pgsql /usr/bin/`.
Access to temporary dir is also needed. Depending on your installation you might also need to run `sudo chown 501:staff /usr/local/src/postgis-2.1.7/raster/loader/.libs` (maybe replacing `501:staff` with your installation /usr/local/src/postgis-2.1.7/raster/loader/ group and owner).
## Install problems and common solutions #
Installing the full stack might not always be smooth due to other component updates, so if you run into problems installing CartoDB, please check [this list of problems and solutions](https://github.com/CartoDB/cartodb/wiki/Problems-faced-during-CartoDB-install-&-solutions-if-known) first to see if your problem already happened in the past and somebody else found a workaround, solution or fix to it.
## Install local instance of cold beer ##
Congratulations!
Everything you need should now be installed.
Celebrate by drinking a cold beer before continuing. :)