Install OTRS Community Edition on Debian 11

This guide intends to teach you to Install and Configure Install OTRS Community Edition (CE) on Debian 11.

OTRS Community Edition is a Ticket Request System (trouble ticket system) with many features to manage customer telephone calls and e-mails. The system is built to allow your support, sales, pre-sales, billing, internal IT, helpdesk, etc. department to react quickly to inbound inquiries.

Steps To Install OTRS Community Edition on Debian 11

To set up OTRC CE, log in to your server as a non-root user with sudo privileges and set up a basic firewall. To do this, you can follow our guide on Initial Server Setup with Debian 11.

Install Required Packages For OTRS

First, you need to update your local package index with the following command:

sudo apt update

Then, use the following command to install the required build tools on your Debian 11:

sudo apt install perl libapache2-mod-perl2 libdbd-mysql-perl libtimedate-perl \
libnet-dns-perl libnet-ldap-perl libio-socket-ssl-perl libpdf-api2-perl \
libdbd-mysql-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 libmoo-perl libauthen-ntlm-perl \
libjavascript-minifier-xs-perl libdbd-odbc-perl  libcss-minifier-xs-perl \
libdbd-pg-perl libdatetime-perl apache2 mariadb-server mariadb-client -y

Download OTRS Community Edition on Debian 11

At this point, you need to create an OTRS system user account by using the command below:

sudo useradd -r -m -d /opt/otrs -c "OTRS User" -s /usr/sbin/nologin otrs

Then, visit the OTRS Community Edition Downloads page and get the latest package by using the wget command and extract it in the /opt/otrs directory:

# sudo wget https://otrscommunityedition.com/download/otrs-community-edition-6.0.39.tar.gz
# sudo tar xvfz otrs-community-edition-6.0.39.tar.gz -C /opt/otrs --strip-components=1

Next, run the OTRS Perl script on Debian 11 to check if all required modules are in place:

sudo perl /opt/otrs/bin/otrs.CheckModules.pl
Output
o Apache::DBI......................ok (v1.12)
  o Apache2::Reload..................ok (v0.13)
  o Archive::Tar.....................ok (v2.36)
  o Archive::Zip.....................ok (v1.68)
  o Crypt::Eksblowfish::Bcrypt.......ok (v0.009)
  o CSS::Minifier::XS................ok (v0.11)
  o Date::Format.....................ok (v2.24)
  o DateTime.........................ok (v1.54)
    o DateTime::TimeZone.............ok (v2.47)
  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.14.2)
  o Digest::SHA......................ok (v6.02)
  o Encode::HanExtra.................ok (v0.23)
  o IO::Socket::SSL..................ok (v2.069)
  o JSON::XS.........................ok (v4.03)
  o JavaScript::Minifier::XS.........ok (v0.13)
  o List::Util::XS...................ok (v1.55)
  o LWP::UserAgent...................ok (v6.64)
  o Mail::IMAPClient.................ok (v3.42)
    o IO::Socket::SSL................ok (v2.069)
    o Authen::SASL...................ok (v2.16)
    o Authen::NTLM...................ok (v1.09)
  o ModPerl::Util....................ok (v2.000011)
  o Moo..............................ok (v2.004004)
  o Net::DNS.........................ok (v1.29)
  o Net::LDAP........................ok (v0.68)
  o Net::SMTP........................ok (v3.11)
  o Template.........................ok (v2.27)
  o Template::Stash::XS..............ok (undef)
  o Text::CSV_XS.....................ok (v1.45)
  o Time::HiRes......................ok (v1.9764)
  o Unicode::Collate.................ok (v1.27)
  o XML::LibXML......................ok (v2.0134)
  o XML::LibXSLT.....................ok (v1.99)
  o XML::Parser......................ok (v2.46)
  o YAML::XS.........................ok (v0.82)

Note: If any Perl module is missing, install them using the package manager.

Activate Default OTRS Configuration

At this point, you need to activate the default OTRS configuration, /opt/otrs/Kernel/Config.pm.dist, by renaming it to remove the .dist extension. To do this, run the following command:

sudo cp /opt/otrs/Kernel/Config.pm{.dist,}

When you are done, check other required modules are ok by using the following command:

# sudo perl -cw /opt/otrs/bin/cgi-bin/index.pl
# sudo perl -cw /opt/otrs/bin/cgi-bin/customer.pl
# sudo perl -cw /opt/otrs/bin/otrs.Console.pl
# sudo perl /opt/otrs/bin/otrs.SetPermissions.pl

Create OTRS Database User on Debian 11

At this point, you need to run the MySQL security script:

sudo mysql_secure_installation

Set a password for your MariaDB and answer the question by entering the y.

 Enter current password for root (enter for none):
    Set root password? [Y/n]: Y
    Enter Password:
    Remove anonymous users? [Y/n]: Y
    Disallow root login remotely? [Y/n]: Y
    Remove test database and access to it? [Y/n]:  Y
    Reload privilege tables now? [Y/n]:  Y

Then, log in to your MariaDB shell with the following command

sudo mysql -u root -p

Now use the following command to create the OTRS database on Debian 11:

MariaDB [(none)]> create database otrsdb character set utf8 collate utf8_general_ci;

Next, use the following command to create the database user and grant all the privileges to it:

MariaDB [(none)]> grant all on otrsdb.* to otrsuser@localhost identified by 'password';

Flush the privileges and exit from the MariaDB shell:

MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit;

At this point, edit the MariaDB configuration file and tweak some settings:

sudo vi /etc/mysql/mariadb.conf.d/50-server.cnf

Update the following lines inside the [mysqld] section as shown below:

max_allowed_packet   = 64M
query_cache_size     = 32M
innodb_log_file_size = 256M

When you are done, save and close the file.

To apply the changes, restart the MariaDB service:

sudo systemctl restart mariadb

Configure Apache For OTRS Community Edition on Debian 11

At this point, you need to link the OTRS Apache configuration file to the Apache web root directory to serve OTRS via Apache. To do this, run the command below:

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

Disable the default Apache site by running the command below:

sudo a2dissite 000-default.conf

Next, enable the required Apache modules with the following command:

sudo a2enmod perl version deflate filter headers

Set the correct ownership for the /opt/otrs directory:

# sudo chown -R otrs: /opt/otrs/
# sudo usermod -aG www-data otrs

Update OTRS Files Permissions by using the command below on Debian 11:

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

Check Apache configuration for any error:

sudo apachectl -t
Output
Syntax OK

To apply the changes, restart the Apache service:

sudo systemctl restart apache2

If you have a firewall running on your server, you need to allow external access to Apache service:

sudo ufw allow 80/tcp

Access OTRS Community Edition Web Interface

At this point, you can access your OTRS through the web interface by typing your server’s IP address in your web browser followed by /otrs/installer.pl:

http://server-ip-address/otrs/installer.pl

You will see the OTRS Welcome screen on Debian 11. Click Next to continue.

OTRS Welcome screen Debain 11
OTRS Welcome screen

Next, Accept the license and Continue.

OTRS License Agreement
License Agreement

Then, you will see the database selection. Choose MySQLUse an existing database for OTRS, and click Next. At this point, you need to enter the OTRS Database credentials and click Next.

OTRS Database Configuration Debian 11
Database Configuration

In the next screen, you should see the database setup is successful. Then, click Next.

OTRS Database Setup
Database Setup

Now you should see the system settings screen. Define your required settings and click Next.

System Settings for OTRS Community edition
System Settings

Define your SMTP server or leave it blank and click on the Skip this step button.

Mail Configuration for OTRS
Mail Configuration

Once the installation has been completed, you should see the server URL with the login username and password. Click on the provided URL.

OTRS URL
OTRS URL

You will be redirected to the OTRS Community Edition login screen on Debian 11. Enter the username and password and click Login.

OTRS CE Login Screen
OTRS Login Screen

You should see the OTRS Community Edition dashboard on Debian 11.

OTRS CE Dashboard
OTRS Dashboard

You can see the “OTRS Daemon not running error” on the above screen.

To resolve this error, run the following commands on your server:

# sudo -Hiu otrs /opt/otrs/bin/otrs.Daemon.pl start
# sudo cp /opt/otrs/var/cron/otrs_daemon{.dist,}
# sudo -Hiu otrs /opt/otrs/bin/Cron.sh start

Now, refresh the OTRS Community Edition screen. You should see that the error is now gone.

Conclusion

At this point, you have learned to Install and Configure OTRS Community Edition (CE) on Debian 11.

Hope you enjoy it. You may be interested in these articles on the Orcacore website:

Set up ProcessWire CMS on Debian 11

Fix Java Error – Failed To Validate Certificate For IPMI or KVM

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!