koha

How to Install Koha 24 on Ubuntu 24.04 or Newer

Welcome to the Greenhost.cloud blog! In today’s post, we will guide you through the installation of Koha 24 on Ubuntu 24.04 or newer. Koha is an open-source Integrated Library System (ILS) that is widely used by libraries around the world. With its powerful features, Koha helps libraries manage their collections, patrons, and various library operations effectively. Let’s get started!

Prerequisites

Before we dive into the installation process, ensure you have the following:

  1. Ubuntu 24.04 or Newer: Make sure your system is up-to-date. You can check this by running:
   sudo apt update && sudo apt upgrade
  1. Sufficient System Resources: Koha requires at least 1GB of RAM and 2GB of disk space. For better performance, more resources are advisable.
  2. Root or Sudo Access: You will need administrative privileges to install packages and make system changes.
  3. Dependencies: Ensure that you have the necessary packages installed. We will install these during the process.

Step 1: Install Required Packages

Open a terminal and install the required packages using the following command:

sudo apt install mariadb-server libdbix-class-migration-perl libxml-libxml-perl libxml-libxslt-perl libemail-valid-perl libdate-manip-perl libmarc-charset-perl libtemplate-perl libtemplate-toolkit-perl libcgi-pm-perl libcgi-session-perl libdate-calc-perl libdbi-perl libdbd-mysql-perl libapache2-mod-perl2 libapache2-request-perl libimage-exiftool-perl libjson-perl libdigest-sha-perl libsoap-lite-perl libnet-ldap-perl libnet-openssh-perl libnet-ssleay-perl

This command installs the necessary packages required for Koha to function properly.

Step 2: Set Up the Database

Next, we need to set up the MariaDB database for Koha.

  1. Log into MariaDB:
   sudo mysql -u root -p
  1. Create a Database and User:
    In the MariaDB shell, run the following commands to create a database and user for Koha:
   CREATE DATABASE koha_library CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
   CREATE USER 'kohauser'@'localhost' IDENTIFIED BY 'your_password';
   GRANT ALL PRIVILEGES ON koha_library.* TO 'kohauser'@'localhost';
   FLUSH PRIVILEGES;
   EXIT;

Replace your_password with a strong password of your choice.

Step 3: Download and Install Koha

  1. Download Koha:
    Visit the official Koha website to find the latest version or use the following commands in your terminal to download Koha 24:
   wget https://download.koha-community.org/koha/24.00/koha-24.00.00.tar.gz
  1. Extract the Package:
   tar -xzf koha-24.00.00.tar.gz
  1. Move Koha to the Desired Directory:
   sudo mv koha-24.00.00 /usr/share/koha

Step 4: Configure Apache

Now, we need to configure Apache to serve Koha.

  1. Create a New Apache Configuration File:
   sudo nano /etc/apache2/sites-available/koha.conf
  1. Add the Following Configuration:
   <VirtualHost *:80>
       ServerName koha.local
       DocumentRoot /usr/share/koha/koha-tmpl/intranet-tmpl/prog/en

       <Directory /usr/share/koha/koha-tmpl/intranet-tmpl/prog/en>
           Options FollowSymLinks
           AllowOverride All
           Require all granted
       </Directory>

       ErrorLog ${APACHE_LOG_DIR}/koha_error.log
       CustomLog ${APACHE_LOG_DIR}/koha_access.log combined
   </VirtualHost>
  1. Enable the Koha Site and Required Apache Modules:
   sudo a2ensite koha.conf
   sudo a2enmod rewrite
   sudo systemctl restart apache2

Step 5: Configure Koha

  1. Set Up Koha:
    Navigate to the Koha installation directory and run the following command to set up the Koha instance:
   sudo koha-create --create-db library

Replace library with your desired library name.

  1. Edit the Koha Configuration File:
   sudo nano /etc/koha/koha-sites.conf

Update the database connection settings with the credentials you created earlier.

Step 6: Access Koha

Now that everything is set up, you can access your Koha installation by navigating to http://koha.local in your web browser. You should see the Koha login page.

Conclusion

Congratulations! You have successfully installed Koha 24 on Ubuntu 24.04 or newer. Koha is a powerful tool that can help you manage library resources effectively. Don’t forget to explore the rich features that Koha offers and customize it to meet your library’s needs.


We hope you found this guide helpful. For more tips and tutorials on managing your cloud environment effectively, stay tuned to the Greenhost.cloud blog!