How to Install Koha on Ubuntu Server

Step-by-step guide to installing Koha on Ubuntu Server, including prerequisites, installation commands, and configuration. Or skip all of this and launch Koha on AWS in 5 minutes with KohaSupport.

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 flexible solution that delivers enterprise-class features, modules, and performance.

Compared to commercial options like Symphony, Millennium, and Horizon, Koha offers libraries more control over deployment, customization, and long-term operating choices. The real cost comparison depends on hosting, support, implementation, migration, and internal technical capacity rather than on a single public number.

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
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:

  1. Access your Koha staff interface (typically at http://your-server-ip:8080)
  2. Complete the web installer steps
  3. Configure your library parameters
  4. Import initial data and create your first patron and catalog records
  5. Configure system preferences
  6. 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

Skip the Installation — Launch Koha on AWS in 5 Minutes

Self-installing Koha on Ubuntu requires Linux server knowledge, ongoing maintenance, security patching, and manual backups. If you’d rather focus on running your library:

KohaSupport deploys Koha on your own AWS account — pre-configured, ready to use:

Plan Best For Price
Free Evaluation, testing, staff training Evaluation listing on AWS Marketplace
Standard Live library — unlimited records, Theme Builder, automated backups Public subscription pricing on AWS Marketplace
Enterprise High availability, multi-AZ, point-in-time restore Quote-based planning

✓ No Linux expertise required  ✓ Up in minutes  ✓ Automated daily backups  ✓ You own your data on your AWS account

Compare all plans →     Launch free on AWS →

If you prefer to install Koha yourself, continue below.

Next Steps

More in Koha System

Was this article helpful?

Thanks for your feedback!