Main extension for CKAN is DataStore, which is built-in, but not enabled by default

This extension enables some data preview and search for data, all without downloading full data files.

In ckan.ini search for ckan.plugins and add datastore to list.

Next is database. DataStore stores metadata and data to database, which need to be different from main CKAN’s database. Create user and database in PostgreSQL server

sudo -u postgres createuser -S -D -R -P -l datastore_default
sudo -u postgres createdb -O ckan_default datastore_default -E utf-8

In ckan.ini find ckan.datastore.write_url and ckan.datastore.read_url, and update theirs values

ckan.datastore.write_url = postgresql://ckan_default:pass@localhost/datastore_default
ckan.datastore.read_url = postgresql://datastore_default:pass@localhost/datastore_def

And fix permissions for this database

ckan -c /opt/ckan/etc/ckan.ini datastore set-permissions | psql --set ON_ERROR_STOP=1 -U postgres -h db_host

After this, you need to restart CKAN, and check for errors. If everything is OK, continue…


Next extension is ckanext-xloader, which downloads any tabular and similar data from CKAN resources, parses them, and uploads them to DataStore database. This extension is installed from git repo, because version available on PyPi is too old.

If you are not in CKAN’s venv, enter into it

sudo pkgin in rust
. /opt/ckan/default/bin/activate
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
export TZ="Europe/Zagreb"

And clone and install extension

cd /opt/ckan/default/src
git clone https://github.com/ckan/ckanext-xloader.git
cd ckanext-xloader
python3.6 setup.py install
pip install -r requirements.txt
pip install -r dev-requirements.txt

In ckan.ini search for ckan.plugins and add xloader to list. After this, you need to restart CKAN, and check for errors. If everything is OK, continue…

This plugin relies on CKAN’s job queue, which needs to be run separetly. Create daemon with full path to CKAN binary inside venv.

/opt/ckan/default/bin/ckan -c /opt/ckan/etc/ckan.ini jobs worker

If you want PDF viewer integrated into resource view, follow next steps

If you are not in CKAN’s venv, enter into it

sudo pkgin in rust
. /opt/ckan/default/bin/activate
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
export TZ="Europe/Zagreb"

And install PDF extension

pip install ckanext-pdfview

In ckan.ini search for ckan.plugins and add pdf_view to list. If you want to viewer be automatically created when you open compatible resource, add pdf_view to ckan.views.default_views. After this, you need to restart CKAN, and check for errors. If everything is OK, continue…


Another usefull extension is Office documents viewer. This one uses MS Office Web Viewer so your CKAN instance must be available to Internet, and documents cannot be private, they need to be public.

If you are not in CKAN’s venv, enter into it

sudo pkgin in rust
. /opt/ckan/default/bin/activate
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
export TZ="Europe/Zagreb"

And install Office extension

cd /opt/ckan/default/src
git clone https://github.com/jqnatividad/ckanext-officedocs.git
python3.6 setup.py install

In ckan.ini search for ckan.plugins and add officedocs_view to list. If you want to viewer be automatically created when you open compatible resource, add officedocs_view to ckan.views.default_views. After this, you need to restart CKAN, and check for errors. If everything is OK, continue…