How to install OTRS (OpenSource Trouble Ticket System) on Ubuntu 16.04

OTRS or Open-source Ticket Request System is an open source ticketing software used for Customer Service, Help Desk, and IT Service Management. The software is written in Perl and javascript. It is a ticketing solution for companies and organizations that have to manage tickets, complaints, support request or other kinds of reports. OTRS supports several database systems including MySQL, PostgreSQL, Oracle and SQL Server it is a multiplatform software that can be installed on Windows and Linux.

In this tutorial, I will show you how to install and configure OTRS on Ubuntu 16.04. I will use PostgreSQL as the database for OTRS, and Apache web server as the web server.


  • Ubuntu 16.04.
  • Min 2GB of Memory.
  • Root privileges.

Step 1 - Install Apache and PostgreSQL

In this first step, we will install the Apache web server and PostgreSQL. We will use the latest versions from the ubuntu repository.

Login to your Ubuntu server with SSH:

ssh [email protected]

Update Ubuntu repository.

sudo apt-get update

Install Apache2 and a PostgreSQL with the apt:

sudo apt-get install -y apache2 libapache2-mod-perl2 postgresql

Then make sure that Apache and PostgreSQL are running by checking the server port.

netstat -plntu

Install Apache and PostgreSQL

You will see port 80 is used by apache, and port 5432 used by postgresql database.

Step 2 - Install Perl Modules

OTRS is based on Perl, so we need to install some Perl modules that are required by OTRS.

Install perl modules for OTRS with this apt command:

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

When the installation is finished, we need to activate the Perl module for apache, then restart the apache service.

a2enmod perl
systemctl restart apache2

Next, check the apache module is loaded with the command below:

apachectl -M | sort

Enable Apache Perl Module

And you will see perl_module under 'Loaded Modules' section.

Step 3 - Create New User for OTRS

OTRS is a web based application and running under the apache web server. For best security, we need to run it under a normal user, not the root user.

Create a new user named 'otrs' with the useradd command below:

useradd -r -d /opt/otrs -c 'OTRS User' otrs

-r: make the user as a system account.
-d /opt/otrs: define home directory for new user on '/opt/otrs'.
-c: comment.

Next, add the otrs user to 'www-data' group, because apache is running under 'www-data' user and group.

usermod -a -G www-data otrs

Check that the otrs user is available in the '/etc/passwd' file.

grep -rin otrs /etc/passwd

Create new user for OTRS

New user for OTRS is created.

Step 4 - Create and Configure the Database

In this section, we will create a new PostgreSQL database for the OTRS system and make some small changes in PostgreSQL database configuration.

Login to the postgres user and access the PostgreSQL shell.

su - postgres

Create a new role named 'otrs' with the password 'myotrspw' and the nosuperuser option.

create user otrs password 'myotrspw' nosuperuser;

Then create a new database named 'otrs' under the 'otrs' user privileges:

create database otrs owner otrs;

Next, edit the PostgreSQL configuration file for otrs role authentication.

vim /etc/postgresql/9.5/main/pg_hba.conf

Paste the cConfiguration below after line 84:

local   otrs            otrs                                    password
host    otrs            otrs              password

Save the file and exit vim.

Database Authentication OTRS

Back to the root privileges with "exit" and restart PostgreSQL:

systemctl restart postgresql

PostgreSQL is ready for the OTRS installation.

Configure PostgreSQL for OTRS

Step 5 - Download and Configure OTRS

In this tutorial, we will use the latest OTRS version that is available on the OTRS web site.

Go to the '/opt' directory and download OTRS 5.0 with the wget command:

cd /opt/

Extract the otrs file, rename the directory and change owner of all otrs files and directories the 'otrs' user.

tar -xzvf otrs-5.0.16.tar.gz
mv otrs-5.0.16 otrs
chown -R otrs:otrs otrs

Next, we need to check the system and make sure it's ready for OTRS installation.

Check system packages for OTRS installation with the otrs script command below:


Make sure all results are ok, it means is our server ready for OTRS.

OTRS Chek Module needed for Installation

OTRS is downloaded, and our server is ready for the OTRS installation.

Next, go to the otrs directory and copy the configuration file.

cd /opt/otrs/
cp Kernel/ Kernel/

Edit '' file with vim:

vim Kernel/

Change the database password line 42:

$Self->{DatabasePw} = 'myotrspw';

Comment the MySQL database support line 45:

# $Self->{DatabaseDSN} = "DBI:mysql:database=$Self->{Database};host=$Self->{DatabaseHost};";

Uncomment PostgreSQL database support line 49:

$Self->{DatabaseDSN} = "DBI:Pg:dbname=$Self->{Database};";

Save the file and exit vim.

Then edit apache startup file to enable PostgreSQL support.

vim scripts/

Uncomment line 60 and 61:

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

Save the file and exit the editor.

Finally, check for any missing dependency and modules.

perl -cw /opt/otrs/bin/cgi-bin/
perl -cw /opt/otrs/bin/cgi-bin/
perl -cw /opt/otrs/bin/

You should see that the result is 'OK' asshown in the screenshot below:

Check all modules again

Step 6 - Import the Sample Database

In this tutorial, we will use the sample database, it's available in the script directory. So we just need to import all sample databases and the schemes to the existing database created in step 4.

Login to the postgres user and go to the otrs directory.

su - postgres
cd /opt/otrs/

Insert database and table scheme with psql command as otrs user.

psql -U otrs -W -f scripts/database/otrs-schema.postgresql.sql otrs
psql -U otrs -W -f scripts/database/otrs-initial_insert.postgresql.sql otrs
psql -U otrs -W -f scripts/database/otrs-schema-post.postgresql.sql otrs

Type the database password 'myotrspw' when requested.

Import OTRS Sample Database

Step 7 - Start OTRS

Database and OTRS are configured, now we can start OTRS.

Set the permission of otrs file and directory to the www-data user and group.

/opt/otrs/bin/ --otrs-user=www-data --web-group=www-data

Then enable the otrs apache configuration by creating a new symbolic link of the file to the apache virtual host directory.

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

Enable otrs virtual host and restart apache.

a2ensite otrs
systemctl restart apache2

Make sure apache has no error.

Enable OTRS Apache Virtual Host

Step 8 - Configure OTRS Cronjob

OTRS is installed and now running under apache web server, but we still need to configure the OTRS Cronjob.

Login to the 'otrs' user, then go to the 'var/cron' directory as the otrs user.

su - otrs
cd var/cron/

Copy all cronjob .dist scripts with the command below:

for foo in *.dist; do cp $foo `basename $foo .dist`; done

Back to the root privilege with exit and then start the cron script as otrs user.

/opt/otrs/bin/ start otrs

Enable OTRS Cron

Next, manually create a new cronjob for PostMaster which fetches the emails. I'll configure it tp fetch emails every 2 minutes.

su - otrs
crontab -e

Paste the configuration below:

*/2 * * * *    $HOME/bin/ >> /dev/null

Save and exit.

Now stop otrs daemon and start it again.

bin/ stop
bin/ start

Enable OTRS Fetching Email

The OTRS installation and configuration is finished.

Step 9 - Testing OTRS

Open your web browser and type in your server IP address:

Login with default user '[email protected]' and password 'root'.

Installation Successfully OTRS Home Page

You will see a warning about using default root account. Click on that warning message to create new admin root user.

Below the admin page after login with different admin root user, and there is no error message again.

OTRS Admin Dashboard Without Error Messages

If you want to log in as Customer, you can use ''.

You will see the customer login page. Type in a customer username and password.

OTRS Customer Login Page

Below is the customer page for creating a new ticket.

Customer Open Ticket

Step 10 - Troubleshooting

If you still have an error like 'OTRS Daemon is not running', you can enable debugging in the OTRS daemon like this.

su - otrs
cd /opt/otrs/

Stop OTRS daemon:

bin/ stop

And start OTRS daemon with --debug option.

bin/ start --debug


Share this page:

16 Comment(s)

Add comment

Please register in our forum first to comment.


By: John

After su - otrs

crontab -e


touch: cannot touch '/opt/otrs/.selected_editor': Permission denied


Should it be done under otrs?


Amazing document .. hats off to your for hard work!

By: Marlon

Fantastic How to.

I was able to follow this document to install the latest version (6.0.3) with a modification on "Step 8 - Configure OTRS Cronjob" In order to install the newer version of OTRS, you have to change the syntax for the cronjob:


*/2 * * * * $HOME/bin/ >> /dev/null


*/2 * * * * $HOME/bin/ >> /dev/null

By: Serdjio Ploxa

It's good for me!

By: Serdjio Ploxa

Is good for me !

By: Alexey Gerasimov

Step 8 - Configure OTRS Cronjob (Ubuntu 18.04)

How to fix it? Thanks!!!

$ bin/ startManage the OTRS daemon process.Daemon started$ ERROR: - Daemon Kernel::System::Daemon::DaemonModules::SystemConfigurationSyncManager-10 Perl: 5.26.1 OS: linux Time: Sun May 27 14:52:22 2018 Message: There was an error executing ConfigurationDeploySync: ERROR: - Daemon Kernel::System::Daemon::DaemonModules::SystemConfigurationSyncManager-10 Perl: 5.26.1 OS: linux Time: Sun May 27 14:52:22 2018 Message: No deployments found in Database! Traceback (27203):    Module: Kernel::System::SysConfig::ConfigurationDeploySync Line: 3722   Module: (eval) Line: 129   Module: Kernel::System::Daemon::DaemonModules::SystemConfigurationSyncManager::Run Line: 116   Module: (eval) Line: 316   Module: main::Start Line: 316   Module: bin/ Line: 137 Traceback (27203):    Module: Kernel::System::Daemon::DaemonModules::BaseTaskWorker::_HandleError Line: 52   Module: Kernel::System::Daemon::DaemonModules::SystemConfigurationSyncManager::Run Line: 134   Module: (eval) Line: 316   Module: main::Start Line: 316   Module: bin/ Line: 137

By: phao

 Insert database and table scheme with psql command as otrs user.  (password ................?  )

By: Preetham

Hi, Thanks for this extensive document. Followed this and everything went as mentioned, except that it did not take the default password. Tried a lot but jus tdid not help. Any pointers?


By: Martin

I have the same problem. Can you tell me how can I fix it?

When I start the deamon:


Daemon started

$ ERROR: - Daemon Kernel::System::Daemon::DaemonModules::SystemConfigurationSyncManager-10 Perl: 5.22.1 OS: linux Time: Sat Feb 23 15:24:11 2019


 Message: There was an error executing ConfigurationDeploySync: ERROR: - Daemon Kernel::System::Daemon::DaemonModules::SystemConfigurationSyncManager-10 Perl: 5.22.1 OS: linux Time: Sat Feb 23 15:24:11 2019


 Message: No deployments found in Database!


 Traceback (14479):

   Module: Kernel::System::SysConfig::ConfigurationDeploySync Line: 3741

   Module: (eval) Line: 129

   Module: Kernel::System::Daemon::DaemonModules::SystemConfigurationSyncManager::Run Line: 116

   Module: (eval) Line: 314

   Module: main::Start Line: 314

   Module: bin/ Line: 135




 Traceback (14479):

   Module: Kernel::System::Daemon::DaemonModules::BaseTaskWorker::_HandleError Line: 52

   Module: Kernel::System::Daemon::DaemonModules::SystemConfigurationSyncManager::Run Line: 134

   Module: (eval) Line: 314

   Module: main::Start Line: 314

   Module: bin/ Line: 135


By: Larry Braziel

I'm also having that same error when starting the Daemon.  When I try to pull up OTRS in the web browser, it won't load.  Any idea on how to fix this?  Something broke somewhere along the way.

By: Zee

Hi, any resolution for this issue? I am hitting the same error. installed Otrs 6 on Ubuntu 16.04

By: Hardi


i did the DB configuration based on the provided instruction from this article, but when i exicute the following DB commands & insert otrs DB user i receives the following error message;


su - postgrescd /opt/otrs/thenpsql -U otrs -W -f scripts/database/otrs-schema.postgresql.sql otrspsql -U otrs -W -f scripts/database/otrs-initial_insert.postgresql.sql otrspsql -U otrs -W -f scripts/database/otrs-schema-post.postgresql.sql otrserror message is:psql: FATAL: Peer authentication failed for user "otrs"however i reviewed the user configuration still the same pssword (myotrspw) was configured.tappreciate your advice


By: Hardi

Hi  when run the following command, there is no information dispays from the page

vim /etc/postgresql/9.5/main/pg_hba.conf

By: Yellowbird

A blank page in this case means the file doesnt exist.  It could mean that you're using a different version of postgres.  Navigate to /etc/postgresql and type the ls command.  See whether there is a /9.5 folder or if it has another number.  Navigate into that folder (whatever number it is), then main, then you should find the pg_hba.conf file.

By: Silvio Moreira Santana

Amazing document ... excellent configuration job. Clap my hands to you for hard work!

Thank you a lot! It work's at first in Ubuntu 19.04 too.

By: Jaka


in case you come to the far end and when starting the you get "Use of uninitialized value in lc at bin/ line XXX" try to execute "perl bin/ Maint::Config::Rebuild". I had the error on either 575 or 518 for the log rotation but I couldn't find any answers. Ran the command and the daemon started without any problems. Also if you are using a different server and the above link for OTRS won't work DON'T forget the "/" at the end. Also gave me problems for some time (i had myip/otrs and it didn't work, apache gave out error. tried myip/otrs/ and it worked)

(bold text for main problems)

Hope it helps!!