How to Install CKAN on Debian Latest

CKAN is an open-source data management platform that enables organizations to publish, share, and find datasets. This tutorial will guide you through the process of installing CKAN on Debian latest.

Prerequisites

Before you get started, it's essential that you have the following installed on your system:

Installation Steps

  1. Update your system:

    sudo apt-get update && sudo apt-get upgrade
    
  2. Install the necessary packages:

    sudo apt-get install -y python-dev postgresql libpq-dev python-pip python-virtualenv git-core solr-jetty
    
  3. Next, create a virtual environment:

    sudo mkdir -p /usr/lib/ckan/default
    sudo chown `whoami` /usr/lib/ckan/default
    virtualenv --no-site-packages /usr/lib/ckan/default
    
  4. Activate the virtual environment:

    . /usr/lib/ckan/default/bin/activate
    
  5. Install the CKAN package:

    pip install -e git+https://github.com/ckan/ckan.git#egg=ckan
    
  6. Install the CKAN requirements:

    pip install -r /usr/lib/ckan/default/src/ckan/requirements.txt
    
  7. Create a PostgreSQL user and database:

    sudo su - postgres
    psql -U postgres -c "CREATE USER ckandb WITH PASSWORD 'mypassword';"
    psql -U postgres -c "CREATE DATABASE ckan_default WITH OWNER ckandb ENCODING 'utf-8';"
    psql -U postgres -c "ALTER USER ckandb CREATEDB;"
    exit
    
  8. Copy the configuration file to the right place:

    sudo cp /usr/lib/ckan/default/src/ckan/ckan/config/who.ini /etc/ckan/default/who.ini
    
  9. Edit the CKAN configuration file:

    Edit /etc/ckan/default/who.ini using your favorite text editor and update the following values:

    sqlalchemy.url = postgresql://ckandb:mypassword@localhost/ckan_default
    solr_url = http://127.0.0.1:8983/solr
    
  10. Create the CKAN tables:

paster --plugin=ckan db init -c /etc/ckan/default/who.ini
  1. Change the owner of the installation directory:
sudo chown -R www-data:www-data /usr/lib/ckan/default
  1. Restart Apache and Solr:
sudo service apache2 restart
sudo service jetty restart

Congratulations, you have now successfully installed CKAN on Debian Latest! You can access CKAN by visiting http://localhost:5000.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!