How to Install Koha on Ubuntu 20.04 LTS | Install Koha on Ubuntu (with easy steps)

By Technical Digit

You can easily install Koha on Ubuntu Operating system using below process. In this process we will install latest stable version of Koha on Ubuntu.

Open Terminal in your Ubuntu machine for Koha Installation.

Update Ubuntu OS using below commands:

sudo su
apt-get update
apt-get upgrade

Install Leafpad Text Editor

apt-get install leafpad

Add Koha Community Repository & Trusted Repository Key

sudo echo deb http://debian.koha-community.org/koha stable main | sudo tee /etc/apt/sources.list.d/koha.list
sudo wget -O- http://debian.koha-community.org/koha/gpg.asc | sudo apt-key add -

Update Software Repository

apt-get update

Install Koha Software

sudo apt install koha-common -y

Port Configuration: Open following file to change port number.

sudo gedit /etc/koha/koha-sites.conf
Change Port of Koha Staff Client to 8099. Edit following line in opened file, save & close the file.

Install MariaDB Server: We will use MariaDB server for Koha Database. Execute following commands one by one to Install MariaDB Server.

sudo apt install mariadb-server mariadb-client -y

Secure MariaDB server using following command:

sudo mysql_secure_installation
It will ask for password, setup root password for MariaDB. And answer “Y” (yes) to all questions.

Apply the following commands to enable rewrite & cgi

sudo a2enmod rewrite cgi && sudo systemctl restart apache2

Create a Koha instance with the name ‘library’.

sudo koha-create --create-db library

We have assigned 8099 port for the Koha staff client and 80 for OPAC.

Open the following file and add a new port.

sudo gedit /etc/apache2/ports.conf

Add following line below Listen 80

Listen 8099

Run following command to enable vhost & restart apache server.

sudo a2dissite 000-default && sudo a2enmod deflate && sudo a2ensite library
sudo systemctl restart apache2

Run the following command to install “Locale::Language” perl module.

sudo apt install liblocale-codes-perl

Run following Command to locate Koha default master password

sudo xmlstarlet sel -t -v 'yazgfs/config/pass' /etc/koha/sites/library/koha-conf.xml;echo
Note: Password will display in terminal, please copy and save it for future use. You will require this password on login into Koha Web Installer.

Restart memcached server:

sudo systemctl restart memcached

Enable & Start Plack for Koha Performance Improvement (Only enable it if you have sufficient RAM):

sudo koha-plack --enable library && sudo koha-plack --start  library

Now open web-browser and go to following links to setup  Koha Web Installer. (Staff Client) (Online OPAC)

When you access Koha Staff Client for first time, It will ask you to setup your Koha Configuration in various steps. So please follow on screen instructions and create a library and a super librarian account to complete the Installation Process. Good Luck.

Koha Software Installation has been completed.


If you see perl modules missing’ error, then execute following command to install missing dependencies.

sudo perl -MCPAN -e 'install Bundle::KohaSupport'


Total Views: 14588