ClimateCompatibleGrowth / ukpact_data_repository

Project management of the UK PACT data repository
0 stars 0 forks source link

CKAN Setup and Deployment Guide πŸš€

Overview πŸ“‹

This guide provides a step-by-step process for setting up and deploying a CKAN instance, an open-source data management system that simplifies publishing, sharing, and accessing data. The setup instructions are geared towards a Linux-based server, such as Ubuntu, and cover everything from installation to configuration and deployment, utilizing Docker and following best practices.

Table of Contents


Prerequisites πŸ› 

Before starting the installation, make sure you have the following:


Installing CKAN from Package πŸ“¦

This guide supports the automatic installation of CKAN 2.11 using the install-from-package.sh script, tested on Ubuntu 22.04 LTS.

Installation Steps πŸͺœ

  1. Set Environment Variables:

    • Create a .env file in the root directory with the following parameters:
      CKAN_DB_PASSWORD=
      CKAN_SITE_URL=
      CKAN_SYSADMIN_NAME=
  2. Make the Script Executable:

    • Set the correct permissions for the script:
      chmod +x install-from-package.sh
  3. Run the Installation Script:

    • Execute the script to start the installation:
      ./install-from-package.sh
    • Note: Running this script will uninstall any existing CKAN installation and drop the associated databases and roles.

Post-Installation πŸ”§

Upon successful installation, the process will automatically:

Logs: Installation logs are saved to /var/log/ckan/install.log. If any issues arise, review this log for details. In case of failure, the script will perform cleanup, stopping services, removing partial installations, and deleting the Solr container. For script details, refer to install-from-package.sh.


Installing Extensions 🧩

CKAN extensions can be installed after the core installation is complete to add additional features and enhance functionality. Use the install-extensions.sh script for a streamlined setup. Before installing the extensions, log into the CKAN sysadmin to generate an API key which would be used by some of the extensions for authentification.

Steps for Installing Extensions

  1. Update the Environment Variables:

    • Add the following SMTP and API configuration variables to your .env file:
      API_KEY=
      CKAN_SMTP_SERVER=
      CKAN_SMTP_STARTTLS=
      CKAN_SMTP_USER=
      CKAN_SMTP_PASSWORD=
      CKAN_SMTP_MAIL_FROM=
  2. Make the Script Executable:

    • Set appropriate permissions for the extension installation script:
      chmod +x install-extensions.sh
  3. Run the Extension Installation Script:

    • Start the script to install and configure extensions:
      ./install-extensions.sh

This script will:

Logs: Check /var/log/ckan/extensions.log for the installation log. If an issue arises, the script will halt, perform cleanup, and stop all services.


Troubleshooting βš™οΈ

For more troubleshooting tips, consult CKAN’s documentation.