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:
- Debian latest
- Python 2.7
- PostgreSQL
- Apache Solr
Installation Steps
Update your system:
sudo apt-get update && sudo apt-get upgradeInstall the necessary packages:
sudo apt-get install -y python-dev postgresql libpq-dev python-pip python-virtualenv git-core solr-jettyNext, 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/defaultActivate the virtual environment:
. /usr/lib/ckan/default/bin/activateInstall the CKAN package:
pip install -e git+https://github.com/ckan/ckan.git#egg=ckanInstall the CKAN requirements:
pip install -r /usr/lib/ckan/default/src/ckan/requirements.txtCreate 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;" exitCopy the configuration file to the right place:
sudo cp /usr/lib/ckan/default/src/ckan/ckan/config/who.ini /etc/ckan/default/who.iniEdit the CKAN configuration file:
Edit
/etc/ckan/default/who.iniusing 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/solrCreate the CKAN tables:
paster --plugin=ckan db init -c /etc/ckan/default/who.ini
- Change the owner of the installation directory:
sudo chown -R www-data:www-data /usr/lib/ckan/default
- 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.