This article is written for those who were searching for a detailed and simple for the understanding guide on how to install OTRS on Ubuntu Server.

OTRS is a service management suite that comprises ticketing, workflow automation and notification, along with a wide range of customizable features. It is used by IT service management, customer service and corporate security help desks to better structure their communication and tasks.

In this guide, we will consider the case when you already have a server with the Ubuntu Server 18.04 LTS operating system installed on it.

You can read more about how to install Ubuntu Server 18.04 LTS in my guide «Installing Ubuntu Server 18.04 LTS».

In addition, OpenSSH must be installed on the server, and port 22 must be open in order to be able to connect to the server using the SSH protocol.

To install OpenSSH on the server, you can use the command:

sudo apt-get install openssh-server

If you plan to connect to the server using the Windows operating system, you can use PuTTY, a freeware client for various remote access protocols, including SSH, Telnet, rlogin.

This guide covers connecting to a server using the iTerm2 terminal emulator installed on the macOS operating system.

Please note that you will need to open the following TCP ports to access your server:

  • 80 – to receive a free cryptographic certificate through the Let’s Encrypt certificate authority.
  • 443 – to access the OTRS web interface.

Connect to the server on which it is planned to install OTRS.

This guide discusses how to obtain a free cryptographic certificate through the Let’s Encrypt Certificate Authority. To receive and further update the free SSL certificate, we will use the Certbot software client, which is designed to simplify the receipt and renewal of the certificate through the Let’s Encrypt certificate authority.

Add the Certbot repository using the command:

sudo add-apt-repository ppa:certbot/certbot

Press the “Enter” button to confirm the addition of a new repository.

Now install the packages necessary for OTRS to work using the command:

sudo apt install -y postgresql apache2 zip unzip build-essential bash-completion certbot python-certbot-apache libapache2-mod-perl2 libdbd-pg-perl libtimedate-perl libnet-dns-perl libnet-ldap-perl libio-socket-ssl-perl libpdf-api2-perl libsoap-lite-perl libtext-csv-xs-perl libjson-xs-perl libapache-dbi-perl libxml-libxml-perl libxml-libxslt-perl libyaml-perl libarchive-zip-perl libcrypt-eksblowfish-perl libencode-hanextra-perl libmail-imapclient-perl libtemplate-perl libdigest-md5-perl libcrypt-ssleay-perl libdatetime-perl libauthen-ntlm-perl libpdf-api2-simple-perl libgd-text-perl libgd-graph-perl libyaml-libyaml-perl

Please note that in this guide, PostgreSQL will be used as the database management system, and Apache will be used as the webserver.

Now you need to create a database that OTRS will use in the future, as well as a user with the necessary rights to this database.

Switch to the “postgres” user, who has administrator rights in PostgreSQL using the command:

sudo su - postgres

Next, switch to the PostgreSQL command line using the command:

psql

Create a new user using the command:

CREATE USER otrsdbuser WITH PASSWORD 'dktLkE(UvUWupy3Y7d((9b';

The user name will be “otrsdbuser” with the password “dktLkE(UvUWupy3Y7d((9b”.

Create a new database and give it rights to the previously created user using the command:

CREATE DATABASE "otrsdb" WITH OWNER "otrsdbuser" ENCODING 'UTF8';

In this manual, “otrsdb” will be used as the name for the database.

Exit the PostgreSQL command line using the command:

\q

Exit the user “postgres” using the command:

exit

Now download the “otrs-latest.tar.gz” archive containing the files for OTRS to work using the command:

wget https://ftp.otrs.org/pub/otrs/otrs-latest.tar.gz

Please note that the archive named “latest” will always contain the latest version of OTRS.

Unzip the downloaded archive “otrs-latest.tar.gz” using the command:

tar xzf otrs-latest.tar.gz

Now delete the previously downloaded archive “otrs-latest.tar.gz” containing the files for OTRS, using the command:

sudo rm -f otrs-latest.tar.gz

Move and rename the directory with OTRS files for operation obtained from the archive using the command:

sudo mv otrs-* /opt/otrs

Now create the user “otrs”, which will be used to start OTRS, using the command:

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

Next, add a new user to the “www-data” group using the command:

sudo usermod -G www-data otrs

Prepare the OTRS configuration file using the command:

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

Now you need to make changes to the OTRS configuration file by opening it in a text editor using the command:

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

Press the “i” button to enter the editing mode, we find the parameter $Self->{'DatabaseDSN'} = "DBI:mysql:database=$Self->{Database};host=$Self->{DatabaseHost}"; and comment it out by prefixing the parameter with the symbol “#”.

Then we find the parameter $Self->{DatabaseDSN} = "DBI:Pg:dbname=$Self->{Database};"; and uncomment it by removing the “#” symbol before the parameter.

Now press the “Esc” button to exit the editing mode, and then enter “:x” and press the “Enter” button to save the changes and exit the editor.

Now you need to make changes to the Apache configuration file by opening it in a text editor using the command:

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

Then we find the parameters “use DBD::Pg ();” и “use Kernel::System::DB::postgresql;”, and then uncomment them by removing the “#” symbol in front of the parameters.

Now press the “Esc” button to exit the editing mode, and then enter “:x” and press the “Enter” button to save the changes and exit the editor.

Assign the correct rights for the user “otrs” to files and directories using the command:

sudo chown -R otrs:otrs /opt/otrs

Now you need to verify that all Perl modules necessary for OTRS to work are installed and do not need to be updated.

Check the Perl modules necessary for OTRS to work using the command:

sudo /opt/otrs/bin/otrs.CheckModules.pl

Further, you may need to update some Perl modules when you receive a warning.

In this case, a warning was received about the need to update the modules “DateTime::TimeZone”, “ID::Socket::SSL” и “Net::SMTP”.

Update the module “DateTime::TimeZone” to the new version using the command:

sudo cpan upgrade DateTime::TimeZone

The question that follows is whether you want to use the automatic configuration function “CPAN.pm”

Press on the “Enter” button.

Update the module “ID::Socket::SSL” to the new version using the command:

sudo cpan upgrade IO::Socket::SSL

Update the module “Net::SMTP” to the new version using the command:

sudo cpan upgrade Net::SMTP

Next, you need to install the “Moo” module for OTRS to work correctly, using the command:

sudo cpan Moo

Again we will check the Perl modules necessary for OTRS to work using the command:

sudo /opt/otrs/bin/otrs.CheckModules.pl

All Perl modules required for OTRS to work are installed and do not need to be updated.

Next, you need to do a few more checks for missing dependencies and Perl modules.

Perform the first check for missing dependencies and Perl modules using the command:

sudo perl -cw /opt/otrs/bin/cgi-bin/index.pl

The first check for missing dependencies and Perl modules was successful.

Perform a second check for missing dependencies and Perl modules using the command:

sudo perl -cw /opt/otrs/bin/cgi-bin/customer.pl

The second check for missing dependencies and Perl modules was successful.

Perform the third check for missing dependencies and Perl modules using the command:

sudo perl -cw /opt/otrs/bin/otrs.Console.pl

The third check for missing dependencies and Perl modules was successful.

Configure Apache for further work with the OTRS control panel.

Enable the Apache web server module called “headers” with the command:

sudo a2enmod headers

Note that the headers module can be used to add more specific Cache-Control parameters.

Enable the Apache web server module called “rewrite” with the command:

sudo a2enmod rewrite

Please note that the “rewrite” module is one of the most commonly used Apache web server modules and provides a flexible and powerful way to manipulate URLs.

Please note that for OTRS to work correctly, Apache modules such as “perl”, “deflate” and “filter” will still be required. These modules should be enabled by default, but you can verify this using the commands:

sudo a2enmod perl

sudo a2enmod deflate

sudo a2enmod filter

Now you need to create four virtual host files (called a block in Nginx), with which OTRS will continue to work.

Two virtual host files will be required to provide access to OTRS via HTTPS, as well as to redirect agents from the otrs.heyvaldemar.net subdomain to the address for the agents to work https://otrs.heyvaldemar.net/otrs/index.pl.

Two other virtual host files will be required to provide access to OTRS via HTTPS, as well as to redirect clients from the support.heyvaldemar.net subdomain to the address for working clients https://otrs.heyvaldemar.net/otrs/customer.pl.

In this guide, the otrs.heyvaldemar.net subdomain will be used for agents to access the OTRS web interface from the Internet, and the support.heyvaldemar.net subdomain will be used for client access. You will need to specify your domains or subdomains by which OTRS will be available from the Internet for agents and clients.

Create the first virtual host file using a text editor using the command:

sudo vim /etc/apache2/sites-available/otrs.heyvaldemar.net.conf

Press on the “i” button to enter the editing mode, then insert the following configuration for the webserver to work:

In this manual, for accessing agents to the OTRS web interface from the Internet, the otrs.heyvaldemar.net subdomain will be used, from which agents will be redirected to https://otrs.heyvaldemar.net/otrs/index.pl. You will need to specify your domain or subdomain by which OTRS will be available from the Internet for agents.

Now press the “Esc” button to exit the editing mode, and then enter “:x” and press the “Enter” button to save the changes and exit the editor.

Create a second virtual host file using a text editor using the command:

sudo vim /etc/apache2/sites-available/otrs.heyvaldemar.net-ssl.conf

Press on the “i” button to enter the editing mode, then insert the following configuration for the webserver to work:

In this manual, for accessing agents to the OTRS web interface from the Internet, the otrs.heyvaldemar.net subdomain will be used, from which agents will be redirected to https://otrs.heyvaldemar.net/otrs/index.pl. You will need to specify your domain or subdomain by which OTRS will be available from the Internet for agents.

Now press the “Esc” button to exit the editing mode, and then enter “:x” and press the “Enter” button to save the changes and exit the editor.

Create a third virtual host file using a text editor using the command:

sudo vim /etc/apache2/sites-available/support.heyvaldemar.net.conf

Press on the “i” button to enter the editing mode, then insert the following configuration for the webserver to work:

In this guide, for accessing clients to the OTRS web interface from the Internet, the support.heyvaldemar.net subdomain will be used, from which clients will be redirected to https://otrs.heyvaldemar.net/otrs/customer.pl. You will need to specify your domain or subdomain by which OTRS will be available from the Internet for customers.

Now press the “Esc” button to exit the editing mode, and then enter “:x” and press the “Enter” button to save the changes and exit the editor.

Create the fourth virtual host file using a text editor using the command:

sudo vim /etc/apache2/sites-available/support.heyvaldemar.net-ssl.conf

Press on the “i” button to enter the editing mode, then insert the following configuration for the webserver to work:

In this guide, for accessing clients to the OTRS web interface from the Internet, the support.heyvaldemar.net subdomain will be used, from which clients will be redirected to https://otrs.heyvaldemar.net/otrs/customer.pl. You will need to specify your domain or subdomain by which OTRS will be available from the Internet for customers.

Now press the “Esc” button to exit the editing mode, and then enter “:x” and press the “Enter” button to save the changes and exit the editor.

Now you need to assign the correct rights to files and directories for the correct operation of OTRS. To do this, use a special script.

Go to the otrs folder using the command:

cd /opt/otrs

Assign the correct rights to files and directories for the correct operation of OTRS using the command:

sudo bin/otrs.SetPermissions.pl --otrs-user=www-data --web-group=www-data

Activate the first virtual host using the command:

sudo a2ensite otrs.heyvaldemar.net.conf

Activate the second virtual host using the command:

sudo a2ensite otrs.heyvaldemar.net-ssl.conf

Activate the third virtual host using the command:

sudo a2ensite support.heyvaldemar.net.conf

Activate the fourth virtual host using the command:

sudo a2ensite support.heyvaldemar.net-ssl.conf

Now you need to activate the virtual host for OTRS, which must be loaded after all other settings. To do this, you can use the symbolic link with the prefix “zzz”.

Activate the virtual host for OTRS using the command:

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

Deactivate the default virtual host using the command:

sudo a2dissite 000-default.conf

Make sure that there are no errors in the syntax of the new Apache configuration file using the command:

sudo apache2ctl configtest

Restart Apache to apply the changes using the command:

sudo systemctl restart apache2

Verify that Apache started successfully using the command:

sudo systemctl status apache2

Now, to increase the security level of the webserver, it is necessary to obtain a cryptographic certificate for the domain or subdomain, through which the OTRS web interface will be accessible from the Internet.

To receive and subsequently renew the free SSL certificate, we will use the Let’s Encrypt Certificate Authority, as well as the Certbot software client, which is designed to simplify the receipt and renewal of the certificate through the Let’s Encrypt Certificate Authority.

In this guide, the otrs.heyvaldemar.net subdomain will be used for agents to access the OTRS web interface from the Internet, and the support.heyvaldemar.net subdomain for client access. You will need to specify your domains or subdomains by which OTRS will be available from the Internet for agents and clients.

Request a cryptographic certificate using the command:

sudo certbot --apache -d otrs.heyvaldemar.net -d support.heyvaldemar.net

Next, indicate the email address to which Let’s Encrypt will send notifications about the expiration of the cryptographic certificate, and press on the “Enter” button.

The next step is to read and accept the terms of use of the services provided.

Press on the “a” button, then “Enter” if you agree to the terms of use of the services provided.

At the next stage, you need to choose: do you want to share the email address indicated above with the Electronic Frontier Foundation to receive newsletters.

Press on the button “n”, then “Enter”.

The next step is to choose: do you want the parameters to automatically redirect HTTP traffic to HTTPS be automatically added to the Apache configuration file.

Press on the button “1”, then “Enter”.

Please note that the cryptographic certificates received through the Let’s Encrypt Certificate Authority are valid for ninety days. Certbot automatically adds a script to renew the certificate in the task scheduler, and the script runs twice a day, automatically renewing any cryptographic certificate that expires within thirty days.

You can check the operability of the cryptographic certificate renewal process using the command:

sudo certbot renew --dry-run

To continue the process of installing OTRS, you must go to the workstation from the link https://otrs.heyvaldemar.net/otrs/installer.pl, where otrs.heyvaldemar.net is the name of my server. Accordingly, you need to specify the name or IP address of your server with OTRS installed.

Click on the “Next” button.

The next step is to accept the license terms.

Click on the “Accept license and continue” button if you agree with the OTRS license agreement.

Next, you need to specify a database management system and a previously created database that will be used to work with OTRS.

In the “Type” field, select “PostgreSQL”.

In the “Install Type” section, select “Use an existing database for OTRS”.

Click on the “Next” button.

In the next step, you must specify the data to connect to the previously created database.

In this manual, “otrsdbuser” is used as the user name that has the rights to the database for OTRS operation.

In the “User” field indicate “otrsdbuser”.

In the “Password” field indicate the password assigned to the user “otrsdbuser”.

In the “Host” field specify “127.0.0.1”.

In this manual, “otrsdb” is used as the database name for OTRS.

In the “Database name” field specify “otrsdb”.

Click on the “Check database settings” button.

Database connection successfully established.

Click on the “Next” button.

The database has been successfully prepared for working with OTRS.

Click on the “Next” button.

In the next step, you need to specify some more parameters for OTRS operation.

In the “SystemID” field, select the desired number, which will serve as the identifier of the OTRS system. This identifier will be part of the number for all applications in OTRS.

In the “System FQDN” field, specify the domain or subdomain by which OTRS is accessible from the Internet.

In this manual, to access the OTRS web interface from the Internet, the otrs.heyvaldemar.net subdomain will be used. You will need to specify your domain or subdomain by which OTRS will be accessible from the Internet.

In the “AdminEmail” field indicate the current email address of the OTRS administrator.

In the “Organization” field indicate the name of your organization.

In the “LogModule” field indicate “Syslog”.

In the “Default Language” field indicate the language for your OTRS system.

In the “CheckMXRecord” field specify “Yes” to check MX records for the email addresses specified in OTRS.

Click on the “Next” button.

In the next step, you can specify the data that OTRS will use to send and receive emails.

Click on the “Skip this step” button.

In the next step, you will receive the username and password of an account that has OTRS administrator rights.

Save this data in a safe place.

Now you need to start the OTRS daemon.

Return to the terminal emulator and start the OTRS daemon using the command:

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

Please note, the daemon will be launched as user “otrs”.

Now you need to activate two files that will be used by the cron task scheduler to verify that the OTRS daemon is running.

Go to the cron folder with the command:

cd /opt/otrs/var/cron

Activate the first file for the cron task scheduler using the command:

sudo cp aaa_base.dist aaa_base

Activate the second file for the cron task scheduler using the command:

sudo cp otrs_daemon.dist otrs_daemon

Now, to schedule tasks in the cron task scheduler, you need to use the “Cron.sh” script with the command:

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

Please note that scheduled tasks will be performed under the user “otrs”.

OTRS installation completed successfully.

Now you need to make changes to your OTRS configuration to ensure that all internal links in OTRS use HTTPS.

From the workstation, follow the link https://otrs.heyvaldemar.net/otrs/index.pl, where otrs.heyvaldemar.net is the name of my server. Accordingly, you need to specify the name or IP address of your server with OTRS installed.

Specify the username and password of an account with OTRS administrator rights, and click on the “Login” button.

Welcome to the web interface for OTRS agents.

Click on the “Admin” button.

Now in the “Administration” section, select “System Configuration”.

In the search bar, indicate “HttpType” and in the presented search result, select “HttpType”

In the “HttpType” section, specify “https”.

Click on the checkbox to the right of the changed parameter to save the changes.

Changes made are saved. Now they need to be applied.

Click on the notification “You have undeployed settings, would you like to deploy it them?”

In the “Changes Overview” section, select the change that you want to apply, and click on the “Deploy selected changes” button.

Click on the “Deploy now” button to confirm the application of previously made changes.

Now you need to change the time zone for the OTRS administrator account.

Click on the notification “Please select a time zone in your preferences and confirm it by clicking save button”.

In the “Time Zone” field, select the appropriate time zone.

Click on the checkbox to the right of the changed parameter to save the changes.

Then click on the image of the house in the upper left corner of the screen to return to the OTRS main page for agents.

Everything is ready to use OTRS.

Author

Hi, I’m Vladimir Mikhalev, but my friends call me Valdemar. I have a lot of experience in the design and maintenance of various information systems. On my website, you will find detailed and clear guides for setting up IT solutions. Dive into the ocean, full of positive and technology! For cooperation: callvaldemar@gmail.com

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.