Install Koha on Ubuntu

Install Ubuntu 16.04 and update
Koha can install on various Ubuntu flavours like Ubuntu MATE/Xubuntu/Lubuntu. Xubuntu and Lubuntu are lightweight (fast performance) Ubuntu flavours. Download Linux iso file from the Ubuntu MATE/Xubuntu/Lubuntu websites. Burn in a DVD or pen drive. Install the Linux operating system. 

Open Terminal and get ready for installation
Open Applications > System Tools > Terminal and execute commands one by one mentioned on this page.

Update Ubuntu
This process will update the Linux operating system latest by downloading new packages.

sudo su
apt-get update
apt-get upgrade

Install Leafpad text editor

Leafpad is a lightweight text editor, which require opening configuration files while the installation process of Koha.

apt-get install leafpad

Add Koha community repository

Add Koha software channel into Debian. It will install the current (latest) version of Koha. Apply following two commands one by one:

echo deb http://debian.koha-community.org/koha stable main | sudo tee /etc/apt/sources.list.d/koha.list

wget -O- http://debian.koha-community.org/koha/gpg.asc | sudo apt-key add -

Update the software repository

sudo apt-get update

Install Koha

The following command will install the latest release of Koha.

sudo apt-get install koha-common

Server configuration

In this step, need to edit network information like domain name and port numbers.

sudo leafpad /etc/koha/koha-sites.conf

Here I change the port number of Koha staff client to 8080. Find the following line in the file and make changes.

INTRAPORT="8080"

Install MariaDB server

Here we use MariaDB server instead of MySQL server. Apply the following command to install MariaDB server.

sudo apt-get install mariadb-server

Assign Root password for MySQL

Apply following commands one by one,

sudo su
mysqladmin -u root password newpass [Replace 'newpass']
exit

Koha instance creation

Apply 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 leafpad /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


Change Koha default master password

See the following link
http://kohageek.blogspot.in/2013/05/how-to-change-master-password-of-koha.html

Clear command history
For security purpose, clear history of commands input while installing Koha. Aplly following commands;

sudo su
history -c

How to start Koha
Open following links,

http://127.0.1.1:8080 (Stff client)
http://127.0.1.1:80 (Online catalogue)


Reference

48 comments:

  1. Thing went well, right? Today i will try this! Long time no work with Koha. How are u Vimal?

    ReplyDelete
  2. things went bad when installing PERL missing modules. Need a lil help mate....

    ReplyDelete
  3. i have been trying to install koha on ubuntu server 14.04 to no avail
    the already install moodle, the e learning software but the configurations i made during the Apache is giving me headeache since most sites cannot be enable

    ReplyDelete
  4. great instructions, thank you! just got lost when i tried to login on the webinterface, receved this error. can anyone please help? Can't call method "do" on unblessed reference at /usr/share/koha/lib/C4/Context.pm line 793.

    ReplyDelete
  5. Change the following CPAN command to use "DBIx" instead of "DBix" and everything works perfectly.
    install Test::DBix::Class
    - change to -
    install Test::DBIx::Class

    It's a subtle correction to avoid an error in finding the resource from CPAN.

    Thanks!!

    ReplyDelete
  6. I need help!! After restarting my computer i cannot launch the Koha again. I tried to restart the apache2 it also failed saying:
    * Restarting web server apache2 [fail]
    * The apache2 configtest failed.
    Output of config test was:
    Segmentation fault
    Action 'configtest' failed.
    The Apache error log may have more information.

    ReplyDelete
  7. apache server is starting without any error. But getting below error at the browser to open koha:

    Software error:

    DBIx::Class::Storage::DBI::catch {...} (): DBI Connection failed: Access denied for user 'koha_library'@'localhost' (using password: YES) at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1398. at /usr/share/koha/lib/Koha/Database.pm line 90
    Compilation failed in require at /usr/share/koha/intranet/cgi-bin/mainpage.pl line 32.
    BEGIN failed--compilation aborted at /usr/share/koha/intranet/cgi-bin/mainpage.pl line 32.

    For help, please send mail to the webmaster ([no address given]), giving this error message and the time and date of the error.

    Tried to see the code mechanism but it is non-rewriteable.

    ReplyDelete
  8. Apache server is starting properly. But in browser getting below error:

    Software error:

    DBIx::Class::Storage::DBI::catch {...} (): DBI Connection failed: Access denied for user 'koha_library'@'localhost' (using password: YES) at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1398. at /usr/share/koha/lib/Koha/Database.pm line 90
    Compilation failed in require at /usr/share/koha/intranet/cgi-bin/mainpage.pl line 32.
    BEGIN failed--compilation aborted at /usr/share/koha/intranet/cgi-bin/mainpage.pl line 32.

    For help, please send mail to the webmaster ([no address given]), giving this error message and the time and date of the error.

    -----------------------------------------------------------------------------
    Tried to see the code mechanism but those are non-rewriteable...
    Please suggest further steps..

    ReplyDelete
  9. I have the same problem The install seems to go fine, but I had to create a symlink from koha-sites.conf (in the koha directory) to library.conf (in the apache2/sites-available directory). Apache seems to read the file OK, but when I restart, apache says:

    The apache2 configtest failed. Not doing anything.
    Output of config test was:
    AH00526: Syntax error on line 8 of /etc/apache2/sites-enabled/library.conf:
    Invalid command 'DOMAIN="ihm-school.org"', perhaps misspelled or defined by a module not included in the server configuration

    ReplyDelete
  10. I have the same problem The install seems to go fine, but I had to create a symlink from koha-sites.conf (in the koha directory) to library.conf (in the apache2/sites-available directory). Apache seems to read the file OK, but when I restart, apache says:

    The apache2 configtest failed. Not doing anything.
    Output of config test was:
    AH00526: Syntax error on line 8 of /etc/apache2/sites-enabled/library.conf:
    Invalid command 'DOMAIN="ihm-school.org"', perhaps misspelled or defined by a module not included in the server configuration

    ReplyDelete
  11. I have the same problem The install seems to go fine, but I had to create a symlink from koha-sites.conf (in the koha directory) to library.conf (in the apache2/sites-available directory). Apache seems to read the file OK, but when I restart, apache says:

    The apache2 configtest failed. Not doing anything.
    Output of config test was:
    AH00526: Syntax error on line 8 of /etc/apache2/sites-enabled/library.conf:
    Invalid command 'DOMAIN="ihm-school.org"', perhaps misspelled or defined by a module not included in the server configuration

    ReplyDelete
  12. Successfully installed Koha 3.22.06 on Ubuntu 14,04... thank You sir

    ReplyDelete
    Replies
    1. Hi..Anupam!!
      How did you do that?
      Can you help with the installation steps?

      Thank you,
      Manindra.

      Delete
  13. I am failing to create koha instance on koha 3.22 on ubuntu 14.04. The following error is popping up.

    dmilibrary2016@dmilibrary:~$ sudo koha-create --create-db dmilibrary
    awk: fatal: cannot open file `/etc/mysql/koha-common.cnf' for reading
    (No such file or directory)

    Johnstone Selemani

    ReplyDelete
  14. Hi. I got this error during the installation. Can someone help me to fix this? It happen during browser installation of koha, not in the terminal.

    install.pl: DBD::mysql::st execute failed: BLOB, TEXT, GEOMETRY or JSON column 'defaultvalue' can't have a default value at /usr/share/perl5/DBIx/RunSQL.pm line 273.

    ReplyDelete
  15. Sir, I want to install on a web hosing which i have been buy a domain
    how to solve it?

    ReplyDelete
  16. Dear sir,

    may i installed KOHA in same computer where the Dspace is already available in 14.4 Ubuntu surface.

    ReplyDelete
    Replies
    1. Sir,
      You can install Dspace along with Koha.
      Remember to change the port number of Koha staff client 8080 to 8000.
      Dspace using the port number 8080.
      Check the following link,
      http://kohageek.blogspot.in/2014/02/how-to-change-default-port-number-of.html

      Delete
  17. hi vimal
    i'malready install koha on ubuntu 14.4 lts but when i tried to open opac
    i faced that : Apache2 Ubuntu Default Page

    what can i do to redirect that to Koha opac

    thnxs

    ReplyDelete
  18. Good day sir, I am getting this error from installation via the browser:

    [Fri Jul 29 10:43:51 2016] install.pl: DBD::mysql::st execute failed: BLOB, TEXT, GEOMETRY or JSON column 'defaultvalue' can't have a default value at /usr/share/perl5/DBIx/RunSQL.pm line 273.

    ReplyDelete
  19. Dear sir
    I got this error "unable to locate koha-common". please let me know how to fix this.

    ReplyDelete
  20. dear sir,
    I wanted to install koha on laptop for practice.Please provide required information with links.Presently,installed ubuntu 16.04 and downloaded koha live cd 1.1 gb.Then guide me what to do.

    ReplyDelete
    Replies
    1. You can install Virtualbox and install live dvd in it.
      https://www.virtualbox.org/wiki/VirtualBox_PUEL

      Delete
  21. dear sir,

    Koha live dvd there are two files. 1 Koha 16.05 2 Koha 3.22.5.Which one tobe downloaded sir

    ReplyDelete
    Replies
    1. 16.05 is the latest version.
      3.22.x is old stable version.

      Delete
    2. sir,
      I have database in cds/isis. The data is converted into marc file.Then I imported data into koha. while searching for data on opac . The data is browsing but availability of the record shows no item available.what are the Global system preferences to be changed.Pl suggest me.
      regards

      Delete
    3. Check 952 item information tag.
      I think it does not added properly.

      Delete
  22. i add multi counter station . one is always sip server up, second one frequently disconnected . please help how to set more than one counter station via please reply to my mail mail2prk@gmail.com .Thanks for your support

    ReplyDelete
  23. please send me auto indexing command for crontab.....Praveen Kumar....Praveenvasu.crl@gmail.com

    ReplyDelete
  24. please send me auto indexing command for crontab......praveenvasu.crl@gmail.com

    ReplyDelete
    Replies
    1. Newly added records automatically add to index in specific intervals.

      Delete
  25. sir,
    I am working on Koha 16.05.I imported data in to koha.Then now i wanted to delete data from koha.(cleaned staged files ) how can i delete completely.

    ReplyDelete
  26. Unimport the data, Tools > Marc Records Management

    ReplyDelete
  27. Can I install Koha to my website, to manage my library.

    ReplyDelete
    Replies
    1. Check your hosting space suitable to apply commands to install Koha.

      Delete
  28. sir i also want to install koha for my library but i do not know how to deal with koha .
    poonam77a@gmail.com

    ReplyDelete
    Replies
    1. If you try to Koha, please use Koha Live DVD
      https://drive.google.com/drive/folders/0B3FZ9iUzgfcmSE5WZEdEeV9FSm8

      Delete
  29. hello, I was trying to install koha on ubuntu 14.04 I am following your instructions but sadly saying I failed several times. sometimes I get the following: "unable to correct problems, you have held unbroken packages" and sometimes I get this: "unable to locate koha-common" please help..thanks in advance

    ReplyDelete
  30. Dear sir,
    I am getting this problem during inttalling koha on my system
    "Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
    koha-common : Depends: libgd-perl but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.
    root@Ubuntu1:/home/deepak#"

    Can you help me to solve this problem?

    ReplyDelete
    Replies
    1. Download libgd-perl package from following link and install manually.
      http://packages.ubuntu.com/trusty/libgd-perl
      Then try to install Koha.

      Delete
  31. Dear Sir,

    I've successfully install Koha 16.11.03 on ubuntu 15.04 using you guideline, Thank you.

    Actually, I've another server installed with Koha 3.16.01, but the server using CentOS 6. I've a planned to update & upgrade the koha version. Do you have a guideline to upgrade the koha version?

    Thank you

    ReplyDelete
    Replies
    1. http://kohageek.blogspot.in/search/label/update

      Delete
  32. Dear Sir,
    I have successfully install koha on ubuntu 16.04 using your guidline, Thank You

    ReplyDelete
  33. Please help



    Warning: You are logged in as the database administrative user. This is not recommended because some parts of Koha will not function as expected when using this account.

    Please log in instead with a regular staff account. To create a staff account, create a library, a patron category 'Staff' and add a new patron. Then give this patron permissions from 'More' in the toolbar.



    Software error:

    Template process failed: undef error - DBIx::Class::Storage::DBI::_dbh_execute(): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'koha_library.me.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by at /usr/share/koha/lib/Koha/Objects.pm line 120

    For help, please send mail to the webmaster ([no address given]), giving this error message and the time and date of the error.

    ReplyDelete
    Replies
    1. Create a staff patron
      http://kohageek.blogspot.in/2015/02/add-staff-patron.html

      Delete