(Last Updated On: September 30, 2018)

In this guide, we’ll cover the installation of OTRS Ticketing system on Ubuntu 18.04. OTRS is a popular Open-source, modern and flexible Ticketing and Process management system with a wide range of features that are customization. It can be used for General IT issues resolution tracking, for help desk tickets or by the Customer Service department. The software is written in Perl/Javascript and it comprises of ticketing, workflow automation, and notification modules. All tickets are managed from its web interface.

OTRS supports several database systems which include PostgreSQL, MySQL, MS SQL and Oracle. In this, we will use the MariaDB database server.

Install OTRS Ticketing system on Ubuntu 18.04 LTS

Our Installation of OTRS Ticketing system on Ubuntu 18.04 need the following packages:

  • MariaDB database server
  • Apache web server
  • Apache Perl module – libapache2-mod-perl2

Let’s now dive into the installation steps

Step 1: Install and Configure MariaDB database server

We already have an article on How to Install MariaDB 10.x on Ubuntu 18.04. Use the link for step by step installation.

Configure variablemax_allowed_packet and character_set_server on MariaDB. Add these setting under the section[mysqld].

$ sudo vim /etc/mysql/mariadb.cnf
[mysqld]
max_allowed_packet=64M
query_cache_size=36M
innodb_log_file_size=256M
character_set_server=utf8

With MariaDB server ready, proceed to create a database for OTRS. Login to MariaDB CLI using the root user account:

$ mysql -u root -p

Then create a database and a user with privileges to access the created database.

MariaDB [(none)]> CREATE DATABASE otrs CHARACTER SET utf8 COLLATE utf8_general_ci;
Query OK, 1 row affected (0.01 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON otrs.* TO 'otrs_user'@'localhost' \
IDENTIFIED BY 'strongpassword';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> quit
Bye

Step 2: Install Apache2 web server and Apache Perl module

Install the latest Apache2 web server on Ubuntu 18.04 server by running below commands

sudo apt-get install  apache2 libapache2-mod-perl2

Step 3: Install other Perl Modules

We need to install all the Perl modules required by OTRS.

sudo apt-get install libdatetime-perl libcrypt-eksblowfish-perl libcrypt-ssleay-perl libgd-graph-perl libapache-dbi-perl libsoap-lite-perl libarchive-zip-perl libgd-text-perl libnet-dns-perl libpdf-api2-perl libauthen-ntlm-perl libdbd-odbc-perl libjson-xs-perl libyaml-libyaml-perl libxml-libxml-perl libencode-hanextra-perl libxml-libxslt-perl libpdf-api2-simple-perl libmail-imapclient-perl libtemplate-perl libtext-csv-xs-perl libdbd-pg-perl libapache2-mod-perl2 libtemplate-perl libnet-dns-perl libnet-ldap-perl libio-socket-ssl-perl

Wait for the installation to complete then enable Apache Perl module. You may need to first check if the module is loaded.

$ sudo apachectl -M | grep perl
perl_module (shared)

If not, load it and restart apache:

sudo a2enmod perl
sudo systemctl restart apache2

Step 4: Create an OTRS system user

The next step is to create a user that will run OTRS service. This is a system user without shell access.

useradd -d /opt/otrs -c 'OTRS user' otrs

Add the user to web group – www-data

$ sudo usermod -aG www-data otrs
$ id otrs
uid=997(otrs) gid=997(otrs) groups=997(otrs),33(www-data)

Step 5: Download and Install OTRS

Install wget:

sudo apt-get install wget

Download OTRS archive and extract it:

wget http://ftp.otrs.org/pub/otrs/otrs-latest.tar.gz
tar xvf otrs-latest.tar.gz
mv otrs-6.0.10/ otrs

Move the resulting directory to /opt

sudo mv otrs /opt

Check to confirm that all Perl modules are installed.

# /opt/otrs/bin/otrs.CheckModules.pl
  o Apache::DBI......................ok (v1.12)
  o Apache2::Reload..................ok (v0.13)
  o Archive::Tar.....................ok (v2.24)
  o Archive::Zip.....................ok (v1.60)
  o Crypt::Eksblowfish::Bcrypt.......ok (v0.009)
  o Crypt::SSLeay....................ok (v0.73_04)
  o Date::Format.....................ok (v2.24)
  o DateTime.........................ok (v1.46)
  o DBI..............................ok (v1.640)
  o DBD::mysql.......................ok (v4.046)
  o DBD::ODBC........................ok (v1.56)
  o DBD::Oracle......................Not installed! (optional - Required to connect to a Oracle database.)
  o DBD::Pg..........................ok (v3.7.0)
  o Digest::SHA......................ok (v5.96)
  o Encode::HanExtra.................ok (v0.23)
  o IO::Socket::SSL..................ok (v2.056)
  o JSON::XS.........................ok (v3.04)
  o List::Util::XS...................ok (v1.46_02)
  o LWP::UserAgent...................ok (v6.26)
  o Mail::IMAPClient.................ok (v3.39)
    o IO::Socket::SSL................ok (v2.056)
    o Authen::SASL...................ok (v2.16)
    o Authen::NTLM...................ok (v1.09)
  o ModPerl::Util....................ok (v2.000010)
  o Net::DNS.........................ok (v1.10)
  o Net::LDAP........................ok (v0.65)
  o Template.........................ok (v2.27)
  o Template::Stash::XS..............ok (undef)
  o Text::CSV_XS.....................ok (v1.34)
  o Time::HiRes......................ok (v1.9741)
  o XML::LibXML......................ok (v2.0128)
  o XML::LibXSLT.....................ok (v1.95)
  o XML::Parser......................ok (v2.44)
  o YAML::XS.........................ok (v0.69)

Create and edit OTRS configuration file:

sudo cp /opt/otrs/Kernel/Config.pm.dist /opt/otrs/Kernel/Config.pm
sudo vim /opt/otrs/Kernel/Config.pm

Define database connection details on the file

# ---------------------------------------------------- #
# database settings #
# ---------------------------------------------------- #

# The database host
$Self->{DatabaseHost} = '127.0.0.1';

# The database name
$Self->{Database} = 'otrs';

# The database user
$Self->{DatabaseUser} = 'otrs_user';

# The password of database user. You also can use bin/otrs.Console.pl Maint::Database::PasswordCrypt
# for crypted passwords
$Self->{DatabasePw} = 'strongpassword';

# The database DSN for MySQL ==> more: "perldoc DBD::mysql"
$Self->{DatabaseDSN} = "DBI:mysql:database=$Self->{Database};host=$Self->{DatabaseHost};";

Enable the MySQL Perl module:

sudo vim /opt/otrs/scripts/apache2-perl-startup.pl

Set below:

# enable this if you use mysql
use DBD::mysql ();
use Kernel::System::DB::mysql;

Set proper Permissions for OTRS directory

$ sudo /opt/otrs/bin/otrs.SetPermissions.pl --web-group=www-data
Setting permissions on /opt/otrs

Use the ls command to check directory permissions

# ls -ldh /opt/otrs/
drwxr-xr-x 12 otrs www-data 4.0K Aug 18 17:50 /opt/otrs/

Step 6: Configure OTRS Apache VirtualHost

There is an Apache configuration file on./opt/otrs This configuration file works fine with default settings. We need to create a symlink to

sudo ln -s /opt/otrs/scripts/apache2-httpd.include.conf /etc/apache2/sites-enabled/otrs.conf

Confirm that all dependency modules are available on the system:

# perl -cw /opt/otrs/bin/cgi-bin/index.pl
/opt/otrs/bin/cgi-bin/index.pl syntax OK

# perl -cw /opt/otrs/bin/cgi-bin/customer.pl
/opt/otrs/bin/cgi-bin/customer.pl syntax OK

# perl -cw /opt/otrs/bin/otrs.Console.pl
/opt/otrs/bin/otrs.Console.pl syntax OK

Restart apache2 service for the new file to be loaded:

sudo systemctl restart apache2

Configure firewall

If you have an active ufw firewall, open port 80 on the firewall

sudo ufw allow 80

Step 6: Access OTRS Web Interface

Open the URL http://server-ip-address/otrs/installer.pl on your browser to complete the installation.

  • Accept License Agreement
  • Configure database settings, choose Use existing database – MySQL. Then provide access details

  • You can skip Email Settings to configure Later
  • Fish the installation. Don’t forget to save username and the password provided.

  • Use the URL printed and log in with the username and password provided.

You should get to OTRS Admin dashboard

When done, start  OTRS daemons and activate cron jobs by running below commands:

sudo su - otrs -c "/opt/otrs/bin/otrs.Daemon.pl start"
sudo su - otrs -c "/opt/otrs/bin/Cron.sh start"

Conclusion

Thanks for using our guide to Install Latest release of OTRS on Ubuntu 18.04 LTS (Bionic Beaver) Linux. The related article is on How to Install osTicket on Ubuntu 18.04 Bionic Beaver.