Koha Library Management System is the world’s first and most popular open-source library software, used by thousands of libraries worldwide. From small community libraries to large academic institutions like New York University, Koha is a reliable and cost-effective solution that delivers enterprise-class features, modules, and performance.
Compared to commercial options like Symphony, Millennium, and Horizon, Koha offers significant cost savings. For instance, some commercial library systems cost over $1 million for 25 licenses with limitations on catalog items and require paying more than $170,000 per year for support services. In contrast, Koha can cost you somewhere between $0 to ~$2,500 per year to run, with no limitations on the number of users, items, branches, or patrons. It includes all the essential features needed to run a library, such as circulation, cataloging, acquisitions, SQL reports, and many more.
This article will guide you through the Koha installation process on Ubuntu 20.04. However, keep in mind that installing Koha can be complex and requires a good knowledge of Linux server platforms and applications like Apache, MySQL/MariaDB, and Plack. Regular upgrades, updates, and troubleshooting for both Koha and your Ubuntu Server operating system are also necessary.
Prerequisites
Before you begin, ensure you have:
- A server running a fresh installation of Ubuntu Server 20.04 LTS
- SSH access to your server
- Your preferred text editor (we suggest vim or nano)
- It’s best practice to backup your data (including taking a snapshot of the entire server) in case anything goes wrong and you need to recover
- Do not install Koha on a production server with other software running on it. We suggest trying out the instructions on a development server first (a virtual server using VirtualBox or something similar will suffice)
Note: You can copy and paste the following commands, but make sure you understand what you’re doing first.
Installation Steps
1. Add the Koha community repository to your sources
echo 'deb http://debian.koha-community.org/koha stable main' | sudo tee /etc/apt/sources.list.d/koha.list
2. Add the Koha GPG Key
wget -O- https://debian.koha-community.org/koha/gpg.asc | sudo apt-key add -
3. Update and upgrade your server
sudo apt update
sudo apt upgrade
sudo apt clean
4. Install the latest Koha Release
sudo apt install koha-common
5. Install Apache web server if you haven’t already
sudo apt install apache2
6. Install MySQL or MariaDB server
Either works fine:
sudo apt install mysql-server
Or for MariaDB:
sudo apt install mariadb-server
7. Secure your SQL server
The default MySQL/MariaDB server comes with anonymous users, root access, and a test database that is accessible by anonymous users. They should be removed in a production environment. Run the following command to get started and follow the instructions – they are fairly straightforward. Answer “n” (for no) for the first question and “Y” (the default, yes) for the rest.
sudo mysql_secure_installation
8. Enable the Apache mod_rewrite modules
sudo a2enmod rewrite
sudo a2enmod cgi
sudo systemctl restart apache2.service
9. Create the Library Instance
sudo koha-create --create-db demo
Note: “demo” can be anything you want (make it short, simple, and sensible though). This will be the name of your Koha library instance.
10. Choose between a name-based or IP-based installation
Option A: Name-based installation
This will enable you to connect to your Koha instance using a domain or subdomain (you will need to point the A record of your domain/subdomain to your server’s public IP address). If you don’t have a domain or want an IP-based installation, skip this step and go to Option B. Your config file will be the same name as your instance name (the one you used above).
sudo vim /etc/apache2/sites-available/demo.conf
In the configuration file, replace Listen directives with your domain names.
Option B: IP-based installation
If you don’t have a domain name, you can configure your server for IP-based access. Edit your Apache configuration to use your server’s IP address instead of domain names.
11. Enable the Koha site
sudo a2ensite demo
sudo systemctl reload apache2
12. Disable Apache default site (optional but recommended)
sudo a2dissite 000-default
sudo systemctl reload apache2
13. Get your Koha administrator password
sudo koha-passwd demo
This will display your administrator password. Save it securely!
Next Steps
After installation, you’ll need to:
- Access your Koha staff interface (typically at
http://your-server-ip:8080) - Complete the web installer steps
- Configure your library parameters
- Import initial data and create your first patron and catalog records
- Configure system preferences
- Set up backups and monitoring
For detailed post-installation setup instructions, see our guide: How to Complete Koha’s Post-Installation Setup
Important Considerations
Installing Koha is only the first step. You will also need to:
- Perform regular upgrades and updates
- Troubleshoot issues with Koha and Ubuntu Server
- Configure performance optimization (Plack, Memcached, caching)
- Set up regular backups
- Monitor system resources
Alternative: Managed Koha Hosting
If you find the installation and maintenance process too complex or time-consuming, consider managed Koha hosting. Our hosting includes:
- Professional installation and configuration
- Regular updates and upgrades
- Technical support and troubleshooting
- Automated backups
- Performance optimization
- Security monitoring
No server management required—just focus on running your library!