Blog

Building CKAN Debian Packages

  • James Gardner
  • 20 Apr 2021
As I'm sure you are aware, it has been possible to install CKAN from Debian packages on an Ubuntu 10.04 system using apt-get for some time. As part of the release of CKAN 1.5 we had a community meeting about CKAN's Debian packaging approach and how it could be improved. As a result of the meeting, two key changes were recommended:
  • Multiple CKAN instances on the same machine needed to be supported
  • A Python virtualenv should be created for each instance so that different instances could run different versions of extensions
I'm pleased to announce that both these changes have been made in CKAN 1.5 along with full support for setting up Solr search as part of the install as well as the following improvements:
  • Eggs are cached by the build system for quicker builds
  • You don't need to be root to install CKAN (you now use sudo)
  • All the old bugs/permission issues/edge cases I was aware of are fixed
  • All the subtleties I'm aware of are documented
  • You can now specify the CKAN instance hostname when you create an instance rather than fiddling with /etc/hosts and apache configs
  • Solr and Postgres are now optional to support the case when you host them on different machines such as with datacatalogs.org
  • The packaging version an instance was created with is saved in /var/lib/ckan/$INSTANCE/packaging_version.txt so we have a chance of doing upgrades in future if we wish
The whole process of installing CKAN from packages and setting up new CKAN instances is now documented in detail the URL below: CKAN Package Install: http://docs.ckan.org/docs/ckan/en/ckan-1.5/install-from-package.html#run-the-package-installer I won't duplicate the instructions or advice in the docs here, but I do want to talk a bit more about how I built the packages. The CKAN packages are built with a tool I wrote for the purpose called "buildkit". I'm pleased to announce that this tool is now available as an open source tool too that anyone wishing to package CKAN themselves, rather than relying on the official packages, can do so. There are some instructions on how to do this at the URL below: Building and testing CKAN Ubuntu Packages: http://packages.python.org/buildkit/manual.html#example-building-and-testing-the-ckan-package-install The important thing is that the entire process can be boiled down to a single script. CKAN 1.5 includes such a script, and you can see it here: https://bitbucket.org/okfn/ckan/src/release-v1.5/build.sh If you are interested in building Debian packages for CKAN, have a go at installing buildkit and then try to run the script above. You can get buildkit from the buildkit page on the Python Package Index or you can clone the git source with git clone git://git.3aims.com/buildkit. That should get you started!