In this guide, we’ll cover the installation of OTRS Ticketing system on Ubuntu 20.04/18.04 Linux. 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 OTRS 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 20.04/18.04 LTS
Our Installation of OTRS Ticketing system on Ubuntu 20.04/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.
You can also run the commands below to install mariadb from OS APT repositories:
sudo apt update
sudo apt install mariadb-server
Secure your DB Server:
$ sudo mysql_secure_installation
Change authentication plugin to be able to login as normal user with root credentials.
$ sudo mysql -u root
UPDATE mysql.user SET plugin = 'mysql_native_password' WHERE User = 'root';
FLUSH PRIVILEGES;
QUIT;
Confirm it is working:
$ mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 56
Server version: 10.3.22-MariaDB-1ubuntu1 Ubuntu 20.04
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
Configure variablemax_allowed_packet
and character_set_server
on MariaDB. Add these setting under the section[mysqld]
.
sudo tee /etc/mysql/mariadb.conf.d/otrs.cnf<<EOF
[mysqld]
max_allowed_packet=64M
query_cache_size=36M
innodb_log_file_size=256M
EOF
Restart mariadb service:
sudo systemctl restart mariadb
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.
CREATE DATABASE otrs CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL PRIVILEGES ON otrs.* TO [email protected] IDENTIFIED BY '[email protected]';
FLUSH PRIVILEGES;
QUIT
Step 2: Install Apache2 web server and Apache Perl module
Install the latest Apache2 web server on Ubuntu server by running below commands:
sudo apt update
sudo apt install apache2 libapache2-mod-perl2
Step 3: Install other Perl Modules
We need to install all the Perl modules required by OTRS.
sudo apt 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 libmoo-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
If not, load it and restart Apache server:
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.
sudo 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=1001(otrs) gid=1001(otrs) groups=1001(otrs),33(www-data)
Step 5: Download and Install OTRS on Ubuntu 20.04 / 18.04
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-*/ otrs
Move the resulting directory to /opt:
sudo mv otrs /opt
Check to confirm that all Perl modules are installed.
$ sudo /opt/otrs/bin/otrs.CheckModules.pl
o Apache::DBI......................ok (v1.12)
o Apache2::Reload..................ok (v0.13)
o Archive::Tar.....................ok (v2.32)
o Archive::Zip.....................ok (v1.67)
o Crypt::Eksblowfish::Bcrypt.......ok (v0.009)
o Date::Format.....................ok (v2.24)
o DateTime.........................ok (v1.51)
o DateTime::TimeZone.............ok (v2.38)
o DBI..............................ok (v1.643)
o DBD::mysql.......................ok (v4.050)
o DBD::ODBC........................ok (v1.61)
o DBD::Oracle......................Not installed! (optional - Required to connect to a Oracle database.)
o DBD::Pg..........................ok (v3.10.4)
o Digest::SHA......................ok (v6.02)
o Encode::HanExtra.................ok (v0.23)
o IO::Socket::SSL..................ok (v2.067)
o JSON::XS.........................ok (v4.02)
o List::Util::XS...................ok (v1.50)
o LWP::UserAgent...................ok (v6.26)
o Mail::IMAPClient.................ok (v3.42)
o IO::Socket::SSL................ok (v2.067)
o Authen::SASL...................ok (v2.16)
o Authen::NTLM...................ok (v1.09)
o ModPerl::Util....................ok (v2.000011)
o Net::DNS.........................ok (v1.22)
o Net::LDAP........................ok (v0.66)
o Net::SMTP........................ok (v3.11)
o Template.........................ok (v2.27)
o Template::Stash::XS..............ok (undef)
o Text::CSV_XS.....................ok (v1.41)
o Time::HiRes......................ok (v1.9760)
o XML::LibXML......................ok (v2.0134)
o XML::LibXSLT.....................ok (v1.99)
o XML::Parser......................ok (v2.46)
o YAML::XS.........................ok (v0.81)
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} = '[email protected]'; # 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
Comment out lines on MySQL – around 54/55.
# enable this if you use mysql
use DBD::mysql ();
use Kernel::System::DB::mysql;
This is my screenshot.

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 9 otrs www-data 4.0K Apr 8 18:40 /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:
$ sudo perl -cw /opt/otrs/bin/cgi-bin/index.pl /opt/otrs/bin/cgi-bin/index.pl syntax OK $ sudo perl -cw /opt/otrs/bin/cgi-bin/customer.pl /opt/otrs/bin/cgi-bin/customer.pl syntax OK $ sudo 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 20.04/18.04 LTS (Bionic Beaver) Linux.
Similar guides:
How to Install osTicket on Ubuntu