Wiki Koha Community Org Wiki Koha On Debian
Wiki Koha Community Org Wiki Koha On Debian
Wiki Koha Community Org Wiki Koha On Debian
Explore our developer-friendly HTML to PDF API Printed using PDFCrowd HTML to PDF
Contents [hide]
1 Before you begin
2 Conventions
3 Installing the operating system
4 Using the Koha packages
4.1 Setting up package sources
4.2 Choosing what Koha release to follow - a version number or a codename
4.2.1 Following a version number (recommended)
4.2.2 Following a codename (not recommended)
4.2.3 NOT UP TO DATE - Support for Koha on older versions of Debian or Ubuntu
5 Installing Koha
5.1 Install Koha
5.2 Install the database
5.3 Configure the defaults for Koha instances
5.4 Set up Apache
5.5 Create a Koha instance
5.5.1 Using a local database
5.5.2 Using a database on another server TO BE TESTED AND UPDATED IF REQUIRED
6 Additional configuration
6.1 Email
6.2 Translations TO BE UDPATED
6.3 Searching and non-latin languages
6.4 List of commands provided by the Debian packages
6.5 Services
6.6 MySQL vs MariaDB TO BE UDPATED
6.7 Elasticsearch
6.8 Open Search
6.9 Anacron
7 Upgrading Koha
7.1 Upgrading Koha to a major version
Koha is large, and it is built on top of a stack of other software (such as Perl, Perl packages from CPAN, MySQL or
MariaDB for the database, Apache for the webserver, Zebra or Elasticsearch/Open Search for the search engine).
As a result, the memory requirements to run it are going to be significant (2GB minimum).
You must ensure that the target machine has adequate free memory available to run Koha before you begin.
Following these instructions will result in an instance of Koha and the necessary support software which together
consume between 750MB - 1GB of memory at idle. If you are installing the database server on the same machine
as Koha, assume it is going to need another 350MB - 500MB of RAM.
Note that the database and webserver can be tuned to reduce memory consumption, but those optimizations and
their consequences are outside of the scope of these instructions. Additionally, having swap enabled will help
absorb any spikes in memory needs (4GB minimum swap file/partition).
Conventions
Commands that are in a box and start with '$' are intended to be run at the command line of your server (don't
include the '$'):
$ enter a command
Normally, you would install a minimal server version of the operating system, and then use the available Koha
packages.
See the system requirements and recommendations page for information about which operating system
versions are tested and known to work.
Explore our developer-friendly HTML to PDF API Printed using PDFCrowd HTML to PDF
Following a version number (recommended)
When you follow a specific Koha version number, you stay on that version of Koha until the package sources are
changed. This is recommended for production environments, so that you don't 'accidentally' upgrade to a new
major release. When you run updates, you will only upgrade to the latest maintenance release for the version
chosen.
When you follow a codename for a release, you are automatically upgraded to the next major Koha release at the
start of every six month release cycle. For example when the 24.11 release becomes available: if you follow the
current stable release, you would automatically be upgraded from Koha 24.05 to 24.11 when the 24.11 release
becomes available; if you follow oldstable, you would automatically be upgraded from Koha 23.11 to 24.05.
Following a codename for a release is NOT recommended for a production environment, unless you like "living on
the edge". Major releases contain new features and many enhancements, and sometimes unexpected issues can
occur despite a release teams best efforts to create a stable release. It is highly recommended that libraries test
before upgrading between major versions. See Koha versioning and the recommendations section.
Explore our developer-friendly HTML to PDF API Printed using PDFCrowd HTML to PDF
$ echo 'deb [signed-by=/etc/apt/keyrings/koha.asc] https://debian.koha-
community.org/koha stable main' | sudo tee /etc/apt/sources.list.d/koha.list
Ubuntu 18.04/Bionic
If you are unsure of your Debian or Ubuntu codename, run these commands:
Below are some examples, remember to replace both Koha and Debian/Ubuntu codenames with your required
values
Installing Koha
Install Koha
Explore our developer-friendly HTML to PDF API Printed using PDFCrowd HTML to PDF
$ sudo apt install koha-common
To use MariaDB:
To use MySQL:
Set the DOMAIN value to the domain you wish to access this Koha from. Also pay attention to the INTRASUFFIX
as your DNS entries will also require this. Instructions for setting up a domain for Koha can be found on the page
How to set up a domain name for Koha.
If your catalogue is not MARC21, change ZEBRA_MARC_FORMAT. You may also adapt ZEBRA_LANGUAGE.
Some more useful information on how to set up your koha-sites.conf can also be found in Appendix A: Named-
based vs. IP-based installations.
Set up Apache
If you are configuring Koha for access by IP address rather than by domain name, please remember to edit
/etc/apache2/ports.conf and make sure the following lines are present:
Listen 80
Listen <staff interface port number>
You will only need the second Listen entry, if you have chosen to make the staff interface accessible on a different
port.
Explore our developer-friendly HTML to PDF API Printed using PDFCrowd HTML to PDF
If you are running your database locally (replace libraryname with the name of your library):
Important: Make sure to check available options carefully. If you use UNIMARC, you'll need to use
the --marcflavor option to set your instance up correctly.
1. Remove /etc/mysql/koha-common.cnf
2. Create a new "option file" in its place with the same file name containing the client connection information
for the server (the same syntax you'll find in a my.cnf file).
You will need to specify the host, user, and password within a [client] option group.
Koha commands will automatically use the /etc/mysql/koha-common.cnf via the --defaults-extra-file
option for the MySQL CLI client
3. Read the man pages for koha-create, paying attention to the information on --request-db and --
populate-db.
4. Using --request-db will disable koha instance, so to enable the instance after using --populate-db,
perform command koha-enable.
Set up plack
You will need set up Apache modules for koha-plack to work:
where:
If you want to change the hostname details of the instance, you can edit /etc/apache2/sites-
enabled/libraryname.conf and restart Apache.
Open a web browser, and point it to your staff interface, by going to http://libraryname-intra.domain, or
whatever you manually configured.
Explore our developer-friendly HTML to PDF API Printed using PDFCrowd HTML to PDF
When you see the login for the Koha installer, the username and password are in the koha-conf.xml file for the
instance.
Some steps taken by the web-based installer to set up database tables may take considerable time to complete,
and may generate timeout errors. If you receive a "Gateway Timeout" error in the web browser, try editing the file
/etc/apache2/apache2.conf to increase apache's Timeout setting.
Additional configuration
Email
By default, email is turned off. This is to let you get everything set up before you risk sending unwanted notices to
people. To turn email on:
Translations TO BE UDPATED
To see all the language codes:
Explore our developer-friendly HTML to PDF API Printed using PDFCrowd HTML to PDF
Searching and non-latin languages
To get searching with non-latin languages (such as Russian, Chinese and Arabic) working correctly in Koha you
need to setup and configure ICU.
$ man koha-create
Services
Koha installs a service in /etc/init.d/koha-common. This ensures that the zebra daemon and, if configured,
SIP daemon are running. You can use the start, stop, and restart commands to control these.
Due to how MySQL behaves with AUTO_INCREMENT values you should take a look at this dedicated wiki page
to fix potential issues.
Elasticsearch
If you want to use Elasticsearch instead of Zebra, please follow these steps:
Explore our developer-friendly HTML to PDF API Printed using PDFCrowd HTML to PDF
Note that you need to manually remove and re-install the analysis-icu plugin after every Elasticsearch package
update (using the elasticsearch-plugin tool above), which is a hassle.
NOTE: On newer versions of Elasticsearch you may need to disable the security features in order to allow the
HTTP API port to work. If you do that, ensure that you configure it to NOT be accessible from the open internet (for
example with a firewall like ufw), only from within localhost. If the command below fails, it's not set up properly and
won't work in Koha.
$ curl localhost:9200
{
"name" : "koha",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "cTXuxxIPTd2KrWgyRCPAxw",
"version" : {
"number" : "8.15.0",
"build_flavor" : "default",
"build_type" : "deb",
"build_hash" : "1a77947f34deddb41af25e6f0ddb8e830159c179",
"build_date" : "2024-08-05T10:05:34.233336849Z",
"build_snapshot" : false,
"lucene_version" : "9.11.1",
"minimum_wire_compatibility_version" : "7.17.0",
"minimum_index_compatibility_version" : "7.0.0"
},
"tagline" : "You Know, for Search"
}
Switch the system preferences SearchEngine to 'Elasticsearch' then index your records.
Open Search
To be added
Anacron
Zebra server may go down occasionally if you are using Anacron (see
https://lists.katipo.co.nz/pipermail/koha/2016-September/046167.html ).
To avoid that:
1. Edit /etc/cron.d/anacron and add a # to turn off the line starting with 30 7 * * * ....anacron...
2. Rename "anacron"
Explore our developer-friendly HTML to PDF API Printed using PDFCrowd HTML to PDF
$ mv /usr/sbin/anacron /usr/sbin/anacron-temporarily-renamed
Upgrading Koha
Before upgrading Koha, update your system's package information:
To confirm which version of Koha is installed, and which version will be upgraded to, run:
This will upgrade to the latest minor version, e.g. from 19.11.10 til 19.11.13. (It will also upgrade all the other
software on your server that needs an upgrade.)
The upgrade will print a list of software to be updated, please read this list before proceeding with the upgrade,
and if packages related to mysql or mariadb are present, you should cancel and run the database upgrade first. If
the package listed was mariadb-server*, first run:
This will prevent a problem where koha's database upgrade tries to run while the database server is being
updated.
Then, after adjusting /etc/apt/sources.list.d/koha.list you should be able to upgrade with the same commands:
Explore our developer-friendly HTML to PDF API Printed using PDFCrowd HTML to PDF
Installed: 19.05.14-1
Candidate: 21.05.04-1
Sometimes this will not upgrade Koha, because it is "held back" (this happens when the upgrade means you have
to install new packages on the server, e.g. new Perl modules). In that case you have to try again with this
command:
Remember to always scan the output of these commands for any error messages related to the upgrading of the
Koha database.
A system user is created, called library-koha. All things to do with this instance will be run as this user.
(If you have a local MySQL) a new MySQL user is created called koha_library
(If you have a local MySQL) a new MySQL database is created called koha_library
/var/lib/koha/library is created and populated with a default directory structure.
The Koha sites directory (/etc/koha/sites/library) is created and populated. In particular, a koha-
conf.xml is generated and put there with the passwords that were randomly generated for the database and
zebra.
An apache configuration file is put in /etc/apache2/sites-available/library.conf. Apache is
restarted to make the change take effect.
A Zebra daemon for this instance is started, running as the library-koha system user.
Packaging releases
Explore our developer-friendly HTML to PDF API Printed using PDFCrowd HTML to PDF
There is a bit of a mind-dump of information on Building Debian Packages for release. If you want to maintain your
own packages, also have a look at Building Debian Packages - The Easy Way.
Other things
Using the Index Daemon with the packages
Newbie guide - to begin the working configuration
Building Debian Dependencies - what to do if we need to add a new dependency that's not in Debian
You can safely ignore the following warning when installing or upgrading koha, (fixed in bug 33371 )
Then do this:
Developer handbook
Getting involved | Development workflow | Bug Reporting Guidelines | RFCs | Plugins | Plugin hooks
Version Control Using Git | git bz | Commit messages | Sign off on patches | QA Test Tools | How to QA |
Debugging in VIM
Coding Guidelines | Koha Objects | Rest Api HowTo | Coding Guidelines - API | Unit Tests | Continuous
Integration | Interface patterns | Database updates | Adding a syspref | Bootstrap and LESS
Debian Packages | Building Debian Packages | Easy Package Building | Commands
External: Dashboard | Bugzilla | Schema | perldoc | REST API | Jenkins
Explore our developer-friendly HTML to PDF API Printed using PDFCrowd HTML to PDF
Home > Documentation
Home > Documentation > Installation
Home > Documentation > Installation > Debian Packages
Home > Documentation > Installation > Installation alternatives
Koha > Technical > Administration
Koha > Technical > Administration
Koha > Technical > Administration
Explore our developer-friendly HTML to PDF API Printed using PDFCrowd HTML to PDF