Today we will learn how we can install and set up the Koha free library system in our Ubuntu Linux.
In this tutorial, we will show you the complete installation process of koha, after which you will be able to easily install it on your Ubuntu Linux by yourself.
Login as Root/Admin –
First of all we will open our terminal and there we will log in as root user/admin for which we have to type the below command in terminal and then we have to enter our password.
Update and Upgrade –
After this we have to update and upgrade our ubuntu system. To do this, we will first type the commands given below in our terminal.
sudo apt-get update
sudo apt-get upgrade
Now we will have to flush our apt cache files, for which we have to type the following commands –
sudo apt-get clean
Add Koha Repo and Source package key –
To install Koha’s repository address and its source key package, we first have to type or copy paste the following command in our terminal.
We will install the stable version of koha here, if you want, you can also download the old version of koha.
sudo echo deb https://debian.koha-community.org/koha stable main | sudo tee /etc/apt/sources.list.d/koha.list
Type the command given above and after that press enter and after which type the command given below which will download the source package key.
wget --no-check-certificate -qO - https://debian.koha-community.org/koha/gpg.asc | sudo apt-key add -
If this command is not working then it means that you have not installed wget. To install wget copy the command below after that try again.
To install wget in ubuntu you have to use this command – “apt-get install wget” using which wget will be installed in your system.
Now we will update our ubuntu system again with the help of sudo apt-get update command.
Install Koha –
Now we will install koha in our ubuntu system, to do that type the command given below which will download the latest version of koha in our computer.
sudo apt install koha-common -y
It will take some time to download depending upon your internet connection.
Now we have to change the port number in it for the staff client, to change the port number we have to open one of its conf file and edit it.
To open the conf file we will type the command given below and give the address of the directory where our conf file is located. The path will be same for everyone.
sudo gedit /etc/koha/koha-sites.conf
Now we have to edit this file a bit, here we will get a line where we will get this written ” INTRAPORT=”80″ ” below which we will have to add one more INTRAPORT ” INTRAPORT = “8080″ ” After which we will save this conf file and exit from the file editor.
Install MySQL Server –
Now we will download MySQL server for the database which we need to run koha.
sudo apt-get install mysql-server
After typing this command, the MySQL server will be installed in your ubuntu, if it asks you for a password, then type your password in it.
Setup Apache –
Now we will enable CGI and rewrite in our Apache server, for which we will type the following two commands in the terminal.
We will type this command to enable rewrite.
sudo a2enmod rewrite
And to enable cgi will use this command.
sudo a2enmod cgi
After typing these two commands, we will restart our apache server once.
sudo systemctl restart apache2
With the help of this command, our apache server will be restarted. If you face any error then try this command.
sudo service apache2 restart
Create Koha instance –
Now we have to create an instance of koha. To create an instance of koha, we will type the following command in our terminal which is –
sudo koha-create --create-db library
Here library is the name of our instance, which you can give anything you want, but we recommend you to give the name library as it will be easier to remember and follow the tutorial.
After this we have to add a port in our apache’s ports conf file just like we previously added in koha’s conf file. For this we will edit the ports conf file of our apache server.
sudo gedit /etc/apache2/ports.conf
Inside this file, we have to add the port we had previously added in koha’s conf file under “listen 80”, which in our case is “listen 8080”. After that we will save it and then hit exit from the file editor.
After this we have to restart our apache server again.
sudo systemctl restart apache2
If the above command does not work then you can also try the command given below.
sudo service apache2 restart
Enable Koha Instance –
Now we will have to disable the default site of our apache server and enable our koha instance for which we have to type the commands given below.
sudo a2dissite 000-default
sudo a2enmod deflate
sudo a2ensite library
After typing these commands, we will restart the apache server once again.
sudo systemctl restart apache2
Install Locale Language Perl module –
Now we have to install the Locale Language perl module, for this we will type the command given below –
sudo apt install liblocale-codes-perl
Know Master Password –
Now you have to type the command given below to know the master password of your koha installation, from which you will get its password which you will need later to log in to koha web installer.
sudo koha-passwd library
As soon as you type this command in the terminal, you will see the master password of your koha in your terminal, which you will have to write somewhere or copy paste it somewhere because it is very important.
Koha is now installed in our ubuntu and now we have to set it up, keep reading below for the setup process.
Setup Koha –
Now we have to open any web browser in which we will go to localhost, for which we will type “localhost:8080” in the browser, if you had given a different port then, remove 8080 then give the port you added.
Now we have to type our username and password. Here in the username, by default it is “ koha_library ” and the master password we copied a while back is our password. After that we will click on login.
After this we will follow the instructions of the web installer and click on continue to the next step. And when we get the option to select your marc flavor then we have to select any one of the two options and then click on continue to the next step.
Now, here we have to select all the things that we want in our koha installation and then we will scroll down and click on import.
Now we have to scroll down a bit here and click on “set up some of koha basic requirements”. After clicking on this option our koha will be installed successfully.
Web Installer Setup –
Whatever password and username you provide here, keep them well noted somewhere because you will need them to login to koha.
Create Library –
Now we have to create a library in the web installer. Here we have to give library code which you can give anything and you can give anything in name also. And then we will click on submit button here. The library code will be “library” and the name will be “library”.
Create patron category –
After this we have to type the code of our library in the category code and we can write anything in the description. Select yes in Overdue notice required. Enrollment period we can enter anything after which we will click on submit button.
Create administrator patron –
Now we have to enter our identity here i.e. we have to enter our name and card number. The card number can be anything like “1” or “001” “000001” etc.
Now we will scroll down a bit and there we will confirm our administrator password and then click on submit.
Create item type –
Now we have to create a new item type here where we can give anything in the item type code and then we will give a description in it. You can also use the library name here and then we will submit it.
Create circulation rule –
In the circulation rule, you can change things by yourself, select the things you want and then click on submit.
Web Installer Setup Complete –
Now the setup of our web installer is complete and now we will click on start using koha. Here now we will login with the username and password of our library by selecting our library. Now we are logged in to our koha admin dashboard and we can use it now.
In this tutorial we have shown you how you can install and setup koha on your ubuntu 20.04. If you have any question then you can ask it in comment below.
[lyte id=’9XteSeSAJbA’ /]
Frequently asked questions –
How to fix Perl modules missing error.
If you also get the error of Perl modules missing then you will get the option of recheck dependencies below which if you click then it will recheck dependencies again and this time your error will be fixed.
Here is the command to install perl modules – “sudo apt install liblocale-codes-perl”
Which ubuntu version is used in this tutorial.
For this tutorial, we have used ubuntu version 20.04, LTS version has been used. You can also use a different version of ubuntu that has LTS support to install koha.
What is Koha?
Koha is an integrated library system that is open source and free and is used by schools, colleges and libraries around the world.
Can we install koha on windows?
Yes, you can install koha in your windows computer also. It is very easy to install koha in windows as compared to ubuntu. You will find many videos on YouTube that how you can install koha in windows, Search on YouTube and you will definitely get a good video.
If you liked this post, then do comment below and share it with your friends who want to install koha in ubuntu 20.04.