Saturday, November 1, 2025
Friday, October 17, 2025
Koha Command Line Installation on Ubuntu 24.04
Step-by-Step Koha Installation on Ubuntu
This process requires administrative access (sudo) and uses the terminal for all steps.
Phase 1: Preparation and Package Installation
| Step | Command | Description |
| 1. Update System | sudo apt update sudo apt upgrade | Ensure your Ubuntu server is running the latest packages. |
| 2. Add Koha Repository Key | `wget -O- https://debian.koha-community.org/koha/gpg.asc | sudo apt-key add -` |
| 3. Add Koha Repository | `echo 'deb http://debian.koha-community.org/koha stable main' | sudo tee /etc/apt/sources.list.d/koha.list` |
| 4. Re-update Package List | sudo apt update | Fetches the package information from the newly added Koha repository. |
| 5. Install Core Dependencies | sudo apt install mariadb-server apache2 | Installs the MariaDB database server and the Apache web server, which are prerequisites for Koha. |
| 6. Install Koha Software | sudo apt install koha-common | Installs the main Koha application and its required dependencies. |
| Step | Command | Description |
| 7. Enable Apache Modules | sudo a2enmod rewrite cgi sudo systemctl restart apache2 | Enables the required Apache modules and restarts the web server. |
| 8. Create Koha Instance | sudo koha-create --create-db mylibrary | Creates a new Koha instance named mylibrary. This automatically sets up a database (koha_mylibrary) and a configuration file. (Replace mylibrary with your desired instance name). |
| 9. Configure Ports (Optional but Recommended) | sudo nano /etc/apache2/ports.conf | Open the Apache port configuration file. Add Listen 8080 below Listen 80 to ensure the Staff Client can use this port. |
| 10. Enable Koha Site | sudo a2dissite 000-default sudo a2ensite mylibrary sudo service apache2 restart | Disables the default Apache welcome page, enables the new mylibrary Koha configuration, and restarts Apache to apply changes. |
| 11. Retrieve Password | sudo xmlstarlet sel -t -v 'yazgfs/config/pass' /etc/koha/sites/mylibrary/koha-conf.xml ; echo | Executes a command to print the randomly generated database password for your instance. Copy and save this password. |
| 12. Restart Services | sudo service memcached restart | Restarts the caching service, which is often necessary before accessing the web installer. |
Installing Koha on Ubuntu involves a series of steps executed in the terminal, as the recommended method is using the Koha Community Debian Packages. This approach ensures you get a stable, well-maintained version of the software.
Here is a step-by-step guide on how to install Koha on an Ubuntu server (or desktop):
⚙️ Step-by-Step Koha Installation on Ubuntu
This process requires administrative access (sudo) and uses the terminal for all steps.
Phase 1: Preparation and Package Installation
| Step | Command | Description |
| 1. Update System | sudo apt update sudo apt upgrade | Ensure your Ubuntu server is running the latest packages. |
| 2. Add Koha Repository Key | `wget -O- https://debian.koha-community.org/koha/gpg.asc | sudo apt-key add -` |
| 3. Add Koha Repository | `echo 'deb http://debian.koha-community.org/koha stable main' | sudo tee /etc/apt/sources.list.d/koha.list` |
| 4. Re-update Package List | sudo apt update | Fetches the package information from the newly added Koha repository. |
| 5. Install Core Dependencies | sudo apt install mariadb-server apache2 | Installs the MariaDB database server and the Apache web server, which are prerequisites for Koha. |
| 6. Install Koha Software | sudo apt install koha-common | Installs the main Koha application and its required dependencies. |
Phase 2: Configuration and Instance Creation
| Step | Command | Description |
| 7. Enable Apache Modules | sudo a2enmod rewrite cgi sudo systemctl restart apache2 | Enables the required Apache modules and restarts the web server. |
| 8. Create Koha Instance | sudo koha-create --create-db mylibrary | Creates a new Koha instance named mylibrary. This automatically sets up a database (koha_mylibrary) and a configuration file. (Replace mylibrary with your desired instance name). |
| 9. Configure Ports (Optional but Recommended) | sudo nano /etc/apache2/ports.conf | Open the Apache port configuration file. Add Listen 8000 below Listen 80 to ensure the Staff Client can use this port. |
| 10. Enable Koha Site | sudo a2dissite 000-default sudo a2ensite mylibrary sudo service apache2 restart | Disables the default Apache welcome page, enables the new mylibrary Koha configuration, and restarts Apache to apply changes. |
| 11. Retrieve Password | sudo xmlstarlet sel -t -v 'yazgfs/config/pass' /etc/koha/sites/mylibrary/koha-conf.xml ; echo | Executes a command to print the randomly generated database password for your instance. Copy and save this password. |
| 12. Restart Services | sudo service memcached restart | Restarts the caching service, which is often necessary before accessing the web installer. |
Phase 3: Web Installer Setup
Open your browser and navigate to the Staff Client URL:
http://127.0.0.1:8000(If installing on the same machine)http://[Your Server IP Address]:8000(If accessing remotely)2
The Koha web installer will open.
3 You will be prompted to log in using:Username:
koha_mylibrary(Your instance name prefixed withkoha_)4 Password: The random password you retrieved in Step 11.
Follow the on-screen prompts to complete the final steps:
Select your MARC flavor (e.g., MARC21).
5 Import necessary data (sample patrons, item types).
Create your first Super Librarian account.
6
Once these steps are complete, your Koha installation is finished and ready for use.
-
To download Latest Version of Koha click on below link Koha 21.11 iso After downloading the above ISO file, make a bootable USB from this is...
-
Step-by-Step Koha Installation on Ubuntu This process requires administrative access ( sudo ) and uses the terminal for all steps. Phase 1...
-
> Open Terminal > Type: sudo su > type your root password and press enter > root@localhost:/opt# sudo /opt/dspace/bin/dspace cr...
.png)