How to install koha on Ubuntu Linux

Installing Koha needs some basic steps, but things can go wrong and you can break quickly if the initial settings are incorrect. So here’s my guide on how I normally do it minimally. This screen-cast has been captured for demonstration, and will soon be transferred to a sophisticated version. The video doesn’t have a voice-over coz I sound like Darth Vader, hence I decided not to scar your ears. However, every part of the video is self-explaining.


The video is for pure instruction and educational purposes only. For alerts and troubleshooting, please see the official Koha website. However, when my lazy ego allows me to spend some time there, I will try to write more about these. But find out now and try it yourself, please. This is the command which I use in the video, so you don’t have to type all of it, copy it and paste.

For adding Software Sources :

echo deb stable main | sudo tee /etc/apt/sources.list.d/koha.list

Add the key in gpg.asc to your APT trusted keys

wget -O- | sudo apt-key add -

You should update the software repositories to include newly listed sources and packages:

sudo apt-get update && sudo apt-get upgrade
sudo apt-get clean

Now download and install Koha Common Code by

sudo apt-get install koha-common

Then you need to edit the koha-sites.conf file to include your desired port on which you want your OPAC and Staff client to run on.

sudo nano /etc/koha/koha-sites.conf

I recommend using INTRAPORT=”8080″ and OPACPORT=”80. The file is quite self-explanatory, you can just go through and chose as per your requirements. after making the changes, just save the file and quit the editor.

Also, you need to tell apache about the ports you have configured in the koha-sites.conf file. so that apache cand listen to incoming requests on those ports. Open the ports.conf file in a text editor

sudo nano /etc/apache2/ports.conf

Assuming that you are following this documentation precisely, mention ”Listen 8080″ in the file too. so now your apache will be receiving incoming requests on port 80 and 8080 as well.

Then install MySQL Server :

sudo apt-get install mysql-server

Because there are some issues/bugs with MySQL pertaining to the old issues table in user records. you may go with MariaDB as it is also recommended and an authorized database for Koha. But chose either one of them.

sudo apt-get install mariadb-server

To enable some Apache Modules

sudo a2enmod rewrite 
sudo a2enmod cgi 
sudo service apache2 restart

To Create an Instance for your Library:

sudo koha-create --create-db library

To enable the newly created webpage for Koha:

sudo a2enmod deflate 
sudo a2ensite library 
sudo service apache2 restart

To get the default password of the user “Koha_library” to proceed with the web installation of Koha.

sudo xmlstarlet sel -t -v 'yazgfs/config/pass' /etc/koha/sites/library/koha-conf.xml

In case there is some indexing problem in the software use the following command:

koha-rebuild-zebra -v -f {instance}

in our case the name of the instance is library, and if you followed the steps precisely, the command would be :

sudo koha-rebuild-zebra -v -f library

You can use whatever you feel comfortable with to edit configuration files that I have used the default Gedit text editor. If you have any installation issues, please give me an e-mail to In the Koha community, there are many wise geeks, and for more information or documentation, you can visit the koha community website.

But please… Do not spam me, nobody likes spammers.

Few Recommendations




2nd HDD Caddy Container