How to Install and Configure KOHA Library System on Ubuntu

KOHA for Library

KOHA is a free and open-source Integrated Library System (ILS) that helps manage libraries efficiently. This guide will walk you through installing and configuring KOHA on your Ubuntu server step by step.

How to start?

In Ubuntu, users typically execute commands in a terminal window. To access the Terminal: Use Shortcut: Press Ctrl + Alt + T simultaneously. This is the default shortcut on most Ubuntu systems.

  • Search : Alternatively, you can find the terminal application through the search bar in your desktop environment. Look for “Terminal” or “Command Prompt” in the search bar and click on the application icon.

  • Command Prompt : Once the terminal window opens, you’ll see a prompt that might look something like username@hostname:~$ (where username is your login name and hostname is your computer’s name). This is where you type the commands you want to execute.

  • Running Commands : Type the desired command in the prompt and press Enter

Step 1 : Add the Koha Community Repository :

First, you need to add the Koha community repository to your system's package sources. This allows you have access to the latest Koha packages. You can install either the latest version or a specific version.

Use code :

  • For Current /Latest Version :

  • sudo bash -c ‘echo “deb http://debian.koha-community.org/koha stable main” > /etc/apt/sources.list.d/koha.list’


  • For Specific version :

    sudo bash -c ‘echo “deb http://debian.koha-community.org/koha version numbermain” > /etc/apt/sources.list.d/koha.list’


  • For example :

  • sudo bash -c ‘echo “deb http://debian.koha-community.org/koha 22.11main” > /etc/apt/sources.list.d/koha.list’


    Any version can be given like this (24.05,23.11,23.05,22.11,22.05,..etc)

Step2 : Add the Koha GPG Key

curl -s https://debian.koha-community.org/koha/gpg.asc | sudo apt-key add –

This command downloads the GPG key and adds it to your system’s trusted key list. APT will use this key to verify the integrity of Koha packages during installation.

Step3 : Update package lists and upgrade all upgradable packages

sudo apt update &&sudo apt upgrade –y

This command ensures your system has the latest information about available packages, including those from the Koha repository and it also upgrades system packages which can improve security and compatibility.

Step4: Install Koha Common package

sudo apt update &&sudo apt upgrade –y

This command installs the koha common package (Core KOHA Components), which provides essential libraries and dependencies for Koha to function.

Step5: Install Latest Version of MySQL

#sudo apt install mysql-server -y

#sudomysql

>ALTER USER ‘root’@’localhost’ IDENTIFIED WITH caching_sha2_password BY ‘Gan7Pass@Cqrr_2_8A_sH’;

>exit

This command Installs MySQL server and attempts to set a root password.

Step6: Web Configuration

# sudonano /etc/koha/koha-sites.conf

Find the line INTRAPORT=”80″ and change 80 to 8080 so that it looks like INTRAPORT=”8080″.

So, to save and close a file in nano:

Press Ctrl + O, then Enter.

Press Ctrl + X.

#sudonano /etc/apache2/ports.conf

Add a new line below Listen 80

Listen 8080

So, to save and close a file in nano:

Press Ctrl + O, then Enter.

Press Ctrl + X.

This step configures the web server for your KOHA library system. By default, web servers listen for requests on port 80. However, if you already have another web service running on port 80, this could cause conflicts. To avoid this, the code does two things: Checks and adjusts the KOHA port: It first edits the KOHA configuration file to see if the internal port used by KOHA is set to 80. If so, it changes it to a different port, like 8080. It Configures web server to listen on the new port (8080) that is set for KOHA. Remember to save the changes to both files using the instructions provided (Ctrl+O, Enter, Ctrl+X). By following these steps, you ensure that KOHA and any other web service can operate on your system without interfering with each other.

Step7: Enable Apache mod_rewrite and mod_cgi modules

# sudo a2enmod rewrite &&sudo a2enmod cgi

Restart apache2

#/etc/init.d/apache2 restart

This command enables 2 important modules .By enabling these modules, you ensure that KOHA can use the necessary functionalities provided by mod_rewrite and mod_cgi

Step 8: Create a KOHA Library instance

# sudokoha-create –create-db library

This step creates a new KOHA library instance, which acts as the core data structure for your library management system. It essentially sets up the database and configures essential system-wide settings specific to your library.

Step 9: Secure the MySQL Database

#sudomysql_secure_installation

Securing the MySQL server deployment.

Enter password for user root: Gan7Pass@Cqrr_2_8A_sH

By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go smoother. You should remove them before moving into a production environment.

Remove anonymous users? (Press y|Y for Yes, any other key for No): Y

Success.

Normally, root should only be allowed to connect from ‘localhost’. This ensures that someone cannot guess the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No): Y

Success.

By default, MySQL comes with a database named ‘test’ that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment.

Remove test database and access to it? (Press y|Y for Yes, any other key for No): Y

 – Dropping test database…

Success.

 – Removing privileges on test database…

Success.

Reloading the privilege tables will ensure that all changes made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No): Y

Success.

All done!

#mysql -u root -p

PWD: My7Pass@Word_9_8A_zE

> ALTER USER ‘root’@’localhost’ IDENTIFIED WITH caching_sha2_passwordBY ‘mysqlroot’;

>exit;

This Runs mysql secure installation to set a strong root password and remove unnecessary access points for improved security.

Step 10: Enable the Apache modules

# sudo a2enmod deflate &&sudo a2ensite library

Restart apache2

#/etc/init.d/apache2 restart

This step configures Apache, the web server software, to work with your KOHA library system.

Step 11: Finalize the web setup process

On your server, open a browser and navigate to `localhost:8080` or `your_ipaddress:8080`. The KOHA login page will open.

Username: koha_library

To obtain the password, run the command “ sudokoha-passwd library ” in the terminal. The password will be displayed; copy and paste it into the password field.

Koha Login page
Looking for KOHA Installation / Integration services ? , Contact us @ https://2cqr.in/contact-us/

Book a free Koha demo with 2CQR @ https://2cqr.in/libray-lms-koha/

Visit our Koha page to know more

Reference Url: https://wiki.koha-community.org/wiki/Koha_on_ubuntu_-_packages
Share :

Leave a Reply

Your email address will not be published. Required fields are marked *