Installing CKAN from Package

This section describes how to install CKAN from package. This is the quickest and easiest way to install CKAN, but it requires Ubuntu 12.04 64-bit. If you’re not using Ubuntu 12.04 64-bit, or if you’re installing CKAN for development, you should follow Installing CKAN from Source instead.

1. Install the CKAN Package

On your Ubuntu 12.04 system, open a terminal and run these commands to install CKAN:

  1. Update Ubuntu’s package index:

    sudo apt-get update
  2. Install the Ubuntu packages that CKAN requires:

    sudo apt-get install -y nginx apache2 libapache2-mod-wsgi libpq5
  3. Download the CKAN package:

    wget http://packaging.ckan.org/python-ckan_2.0_amd64.deb

    Note

    If wget is not present, you can install it via:

    sudo apt-get install wget
  4. Install the CKAN package:

    sudo dpkg -i python-ckan_2.0_amd64.deb

Note

If you get the following error it means that for some reason the Apache WSGI module was not enabled:

Syntax error on line 1 of /etc/apache2/sites-enabled/ckan_default:
Invalid command 'WSGISocketPrefix', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
   ...fail!

You can enable it by running these commands in a terminal:

sudo a2enmod wsgi
sudo service apache2 restart

2. Install PostgreSQL and Solr

Tip

You can install PostgreSQL, Solr and CKAN on different servers. Just change the sqlalchemy.url and solr_url settings in your /etc/ckan/default/production.ini file to reference your PostgreSQL and Solr servers.

  1. Install PostgreSQL and Solr, run this command in a terminal:

    sudo apt-get install -y postgresql solr-jetty

    The install will whirr away, then towards the end you’ll see this:

    * Not starting jetty - edit /etc/default/jetty and change NO_START to be 0 (or comment it out).
  2. Follow the instructions in Single Solr instance or Multiple Solr cores to setup Solr.

  3. Follow the instructions in 3. Setup a PostgreSQL database to setup PostgreSQL, then edit the sqlalchemy.url option in your /etc/ckan/default/production.ini file and set the correct password, database and database user.

  4. Initialize your CKAN database by running this command in a terminal:

    sudo ckan db init
  5. Optionally, setup the DataStore by following the instructions in DataStore Extension.

  6. Also optionally, you can enable file uploads by following the instructions in FileStore and File Uploads.

3. You’re done!

Open http://localhost in your web browser. You should see the CKAN front page, which will look something like this:

_images/9.png

You can now move on to Getting Started to begin using and customizing your CKAN site.