Install Koha on Debian

Koha officially supports Debian GNU/Linux. Download ISO file of the stable version of Debian GNU/Linux with XFCE Desktop environment from  here

Install Debian Operating System

If you are not familiar with Debian installation, I do recommend this video 

Open Applications > System Tools > Terminal and execute the below commands one by one. NB: If you are not familiar with the VIM editor better use gedit/mousepad/leafpad.

Add the Debian software repository to sources.list file
sudo vim /etc/apt/sources.list
Replace all entries with the following

###### Debian Main Repos
deb stable main contrib non-free
deb-src stable main contrib non-free
deb stable-updates main contrib non-free
deb-src stable-updates main contrib non-free
deb stable/updates main
deb-src stable/updates main
deb buster-backports main
deb-src buster-backports main

Save and close the file

Update Debian using apt

sudo apt update && sudo apt upgrade -y

Install LAMP stack and a few required packages not available with Debian.

sudo apt install -y software-properties-common dirmngr file-roller unzip wget git curl vimapache2 mariadb-server php libapache2-mod-php php-{bcmath,bz2,intl,gd,mbstring,mysql,zip,cli,fpm,opcache,xml,curl,intl,xsl,soap,json,apcu,imap}

Clear the apt-get packager manager cache

sudo apt clean

Securing MariaDB

Run this command to improve the security of the MariaDB installation:

sudo mysql_secure_installation

(The script will prompt you to set up the root user password, remove the anonymous user, restrict root user access to the local machine and remove the test database. In the end, the script will reload the privilege tables ensuring that all changes take effect immediately. All steps are explained in detail and it is recommended to answer “Y” (yes) to all questions.)

Add Koha community repository ( For stable - latest version )

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

Add Koha community repository ( For oldstable - previous version )

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

Add trusted repository key

sudo wget -O- | sudo apt-key add -

Update software repository

sudo apt update

Install Koha and dependencies

sudo apt install -y koha-common

(takes 5 mins on a reasonably fast internet connection)

Edit initial config file

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

Edit INTRAPORT as 8080, OPACPORT as 80, domain, and Memcached [for database, makes Koha faster] settings depending on install

Ensure rewrite and cgi are enabled

sudo a2enmod rewrite cgi && sudo systemctl restart apache2

Setup the database for Koha

sudo koha-create --create-db library

Add new 8080 port (for IP based install) to Apache

sudo vim /etc/apache2/ports.conf

(need to add Listen 8080 below Listen 80)

Enable vhost on Apache

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

Test to ensure everything is working

In the web browser, visit {Koha maintenance message} and visit It will prompt for username & password

username --> koha_library
password --> get it executing this command –>

sudo koha-passwd library

Follow onscreen instructions/wizard create a library and a super librarian

Change Koha Master Password

Koha master password can be changed by editing the koha-conf.xml file

(for single click changing password, use this command)

sudo sed -i 's/1MvFLNny4naCWmo@/kohalib/g' /etc/koha/sites/library/koha-conf.xml


sudo vim /etc/koha/sites/library/koha-conf.xml

Under config, section find out the line password and change it


(change default password 1MvFLNny4naCWmo@ to kohalib) save it

Change MariaDB privileges

sudo mariadb -uroot -p

[enter the MariaDB Root password]

use mysql;
SET PASSWORD FOR 'koha_library'@'localhost' = PASSWORD('kohalib');
flush privileges;

Restart Memcached Apache2 and MariaDB

sudo systemctl restart memcached apache2 mariadb

Enable Plack with Koha and Improve the Performance

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

Restart server

sudo reboot


0 Komentar