Install Koha on Ubuntu
Install Ubuntu 22.04 and update
Koha can install various Ubuntu flavours like Xubuntu/Lubuntu. Xubuntu and Lubuntu are lightweight (fast-performance) Ubuntu flavours. Download the Linux iso file from either Xubuntu/Lubuntu from websites. Burn in a DVD or pen drive/DVD. Install the Linux operating system.
Open the Terminal and get ready for installation
Open Applications > System Tools > Terminal and apply the commands one by one mentioned on this page.
This process will update the Linux operating system latest by downloading new packages.
sudo apt update
sudo apt upgrade
sudo apt upgrade
Install Mousepad text editor
The mousepad is a lightweight text editor, which requires opening configuration files during the installation process of Koha.sudo apt -y install mousepad
Add Koha community repository
Add Koha software channel into
Ubuntu. Here we add the old stable version of Koha. We can define which
version to install when adding the repository. Visit the Koha Wiki for details. Apply the following two commands one by one:
sudo sh -c 'wget -qO - https://debian.koha-community.org/koha/gpg.asc | gpg --dearmor -o /usr/share/keyrings/koha-keyring.gpg'
sudo
sh -c 'echo "deb [signed-by=/usr/share/keyrings/koha-keyring.gpg]
https://debian.koha-community.org/koha oldstable main" >>
/etc/apt/sources.list.d/koha.list'
Update the software repository.
sudo apt update
sudo apt update
Install MariaDB server
sudo apt install -y mariadb-server
Assign Root password for MariaDB
If
the password asks during installation, enter the password in the
window. Apply the following command, if the password window did not
appear during the installation,
sudo mysqladmin -u root password newpass [Replace 'newpass']
Install Koha
The following command will install the latest release of Koha.
sudo apt install -y koha-common
Server configuration
In this step, need to edit network information like domain name and port numbers.
sudo mousepad /etc/koha/koha-sites.conf
Here I change the port number of the Koha staff client to 8080. Find the following line in the file and make changes.
INTRAPORT="8080"
Koha instance creation
Apply the following commands to create Apache configuration files.
sudo a2enmod rewrite
sudo a2enmod cgi
sudo service apache2 restart
Create a Koha instance with the name library.
sudo koha-create --create-db library
Add new port
We have assigned 8080 port for the Koha staff client and 80 for OPAC.
Open the following file and add a new port.
sudo mousepad /etc/apache2/ports.conf
Copy-paste following line below Listen 80
Listen 8080
Restart Apache,
sudo service apache2 restart
Enable modules and sites
sudo a2dissite 000-default
sudo a2enmod deflate
sudo a2ensite library
sudo service apache2 restart
Setup the library
After the successful installation, you need to create initial parameters (e.g. branch, item type, superuser creation etc) to start with Koha. We need to open the web interface of Koha and start the configuration of Koha to start.Restart the Memcached service to open Koha web installer.
sudo service memcached restart
Open the following link in the web browser to open the staff client of Koha and set up the library,
http://127.0.1.1:8080
Enter into the Koha staff client using the Database username and password of koha_library. It can find from the file, /etc/koha/sites/library/koha-conf.xml. Apply the following file in a terminal.
sudo mousepad /etc/koha/sites/library/koha-conf.xml
Search (Ctrl+F) for the segment MySQL in the text editor. Note down the database username and password and log into Koha web installer.
Reference