CKAN is an open-source data management system used to manage and publish datasets. In this tutorial, we will guide you on how to install CKAN on OpenSUSE Latest.
Before proceeding with the installation, make sure you have the following prerequisites:
The first step is to install the dependencies needed to run CKAN. You can do this by executing the following commands:
sudo zypper install -y gcc make python-devel python-virtualenv \
python-psycopg2 libxslt-devel libxml2-devel git-core
CKAN is usually run behind Apache, so we need to install it. To do this, run the following command:
sudo zypper in apache2
Once you have installed Apache, we need to set up the virtual environment for CKAN. We will create a new directory named CKAN and create a virtual environment inside that directory.
mkdir CKAN
cd CKAN
virtualenv --no-site-packages ckanenv
source ckanenv/bin/activate
With the virtual environment set up, you can now install CKAN by running the following command:
pip install -e 'git+https://github.com/ckan/ckan.git#egg=ckan'
Now that CKAN is installed, we need to create the necessary configuration files. To do this, run the following commands:
sudo mkdir -p /etc/ckan/default
sudo chown -R $USER /etc/ckan/
sudo chmod u+rwx /etc/ckan/
cd /etc/ckan/default/
Next, create a new file named production.ini
using your favorite editor.
sudo vi production.ini
Then copy and paste the following code into the file.
[server:main]
use = egg:gunicorn
host = 0.0.0.0
port = 80
[app:main]
# In this section, configure CKAN's main application.
# Set the secret key used to sign sessions and cookies.
# Generate one with `openssl rand -g 128`.
ckan.session.secret = YOUR_SECRET_KEY_HERE
# Set the local directory to which CKAN saves uploaded files.
# This must be writable by the CKAN web server user.
ckan.storage_path = /var/lib/ckan
# Set the maximum size of file uploads in bytes.
ckan.max_resource_size = 1000000000
# Set the PostgreSQL database URI.
ckan.sqlalchemy.url = postgresql://ckanuser:ckanpassword@localhost/ckan
[plugin:statsd]
use = egg:statsd
[ckanext-geoview]
mapquest.apikey = YOUR_MAPQUEST_APIKEY_HERE
[ckan:geoview]
geom_type = MultiPolygon
leaflet.tilelayer = MapQuest OpenStreetMap
Be sure to replace YOUR_SECRET_KEY_HERE
with a 128-bit secret key generated by openssl, and YOUR_MAPQUEST_APIKEY_HERE
with your own MapQuest API key (you can get one from MapQuest's website).
Finally, you need to create the database and user for CKAN. To do this, run the following command:
sudo -u postgres createuser -S -D -R ckanuser
sudo -u postgres createdb -O ckanuser ckan -E utf-8
With everything set up, you can now start CKAN. To do this, run the following commands:
ckan -c /etc/ckan/default/production.ini run
Then point your browser to http://localhost/
to access CKAN.
That's it! You've successfully installed CKAN on OpenSUSE Latest. You can now use CKAN to manage and publish datasets.
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!