Install OTRS on Ubuntu Server
This article is for those looking for a detailed and straightforward guide on installing OTRS on Ubuntu Server.
OTRS Community Edition - is a free open-source service management system that is often used by IT service management, customer service, and corporate security to structure their communications and tasks.
Please note that OTRS AG, the company behind OTRS, no longer supports the OTRS Community Edition. The initiative for the further development of OTRS Community Edition was intercepted by Znuny.
You can install an older version of OTRS on Ubuntu Server by following this guide, or you can install a newer version of OTRS from Znuny by reading my Installing OTRS guide “Install OTRS Using Docker Compose”.
In this guide, we will consider the case when you already have a server with the Ubuntu Server 22.04 LTS operating system installed on it.
You can read more about how to install Ubuntu Server 22.04 LTS in my guide “Install Ubuntu Server 22.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 a server, you can use the command:
If you plan to connect to the server using the Windows operating system, you can use PuTTY or MobaXterm.
This guide describes how to connect 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:
- TCP port 80 - to receive a free cryptographic certificate through the Let’s Encrypt CA.
- TCP port 443 - to access the OTRS web interface.
We connect to the server on which you plan to install OTRS.
Update the local package index to the latest changes in the repositories using the command:
This tutorial walks you through obtaining a free cryptographic certificate through the Let’s Encrypt CA. To obtain and subsequently renew a free SSL certificate, we will use the Certbot software client, which is designed to make it as easy as possible to obtain and renew a certificate through the Let’s Encrypt certification authority.
Now we will install the packages required for OTRS to work using the command:
Please note that in this tutorial, PostgreSQL will be used as a database management system, and Apache will be used as a webserver.
Now you need to create a database that will be used by OTRS in the future, as well as a user with the necessary rights in this database.
Switch to the “postgres” user who has administrator rights in PostgreSQL using the command:
Next, switch to the PostgreSQL command line using the command:
We create a new user using the command:
For this tutorial, the username will be “otrsdbuser”, with the password “dktLkE(UvUWupy3Y7d((9b”.
We create a new database and grant the rights to it to the previously created user using the command:
This tutorial will use “otrsdb” as the name for the database.
Exit the “PostgreSQL” command line using the command:
Log out as user “postgres” using the command:
Now let’s download the “rel-6_0.zip” archive containing the files for OTRS using the command:
Unpack the downloaded archive “otrs-latest.tar.gz” using the command:
Now delete the previously downloaded archive “otrs-latest.tar.gz” containing the files for OTRS to work using the command:
Move and rename the directory with files for OTRS operation, obtained from the archive, using the command:
Now let’s create a user “otrs” that will be used to start OTRS using the command:
Next, add a new user to the “www-data” group using the command:
Let’s prepare the OTRS configuration file using the command:
Now you need to make changes to the OTRS configuration file by opening it in a text editor using the command:
Press the “i” button to enter the edit mode, find the parameter $Self->{‘DatabaseDSN’} = “DBI:mysql:database=$Self->{Database};host=$Self->{DatabaseHost}”; and comment it out by placing the “#” symbol in front of the parameter.
Then we find the parameter $Self->{DatabaseDSN} = “DBI:Pg:dbname=$Self->{Database};”; and uncomment it by removing the “#” symbol in front of the parameter.
Now press the “Esc” button to exit edit mode, then type “:x” and press the “Enter” button to save your 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:
Then we find the parameters “use DBD::Pg ();” and “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 edit mode, then type “:x” and press the “Enter” button to save your changes and exit the editor.
Assign correct rights for the “otrs” user to files and directories using the command:
Now you need to check that all Perl modules required for OTRS to work are installed and do not need to be updated.
Let’s check the Perl modules required for OTRS to work using the command:
All Perl modules required for OTRS to run are installed and do not need to be updated.
Next, you need to do a few more checks for missing Perl dependencies and modules.
We perform the first check for missing Perl dependencies and modules using the command:
The first check for missing Perl dependencies and modules was successful.
We perform a second check for missing Perl dependencies and modules using the command:
The second check for missing Perl dependencies and modules was successful.
We perform the third check for missing Perl dependencies and modules using the command:
The third check for missing Perl dependencies and modules was successful.
Let’s configure Apache for further work with the OTRS control panel.
We enable the Apache webserver module called “headers” using the command:
Note that the “headers” module can be used to add more specific “Cache-Control” parameters.
We enable the Apache webserver module called “rewrite” using the command:
Note that the “rewrite” module is one of the most commonly used modules in the Apache webserver and provides a flexible and powerful way to manipulate URLs.
Note that for OTRS to work correctly, you still need Apache modules such as “perl”, “deflate” and “filter”. These modules should be enabled by default, but you can check this with the commands:
Now you need to create four virtual host files (called a block in Nginx), with which OTRS will work in the future.
Two virtual host files are required to provide access to OTRS over HTTPS, as well as to redirect agents from the otrs.heyvaldemar.net subdomain to the agent address https://otrs.heyvaldemar.net/otrs/index.pl.
The other two virtual host files will be required to provide access to OTRS over HTTPS and to redirect customers from the support.heyvaldemar.net subdomain to the customer service address https://otrs.heyvaldemar.net/otrs/customer.pl.
In this guide, agents will use the otrs.heyvaldemar.net subdomain 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 customers.
Let’s create the first virtual host file using a text editor using the command:
Hit the “i” button to go into edit mode, then insert the following configuration for the webserver to work.
In this guide, for agents to access the OTRS web interface from the Internet, the otrs.heyvaldemar.net subdomain will be used, from which agents will be redirected to the address https://otrs.heyvaldemar.net/otrs/index.pl. You will need to specify your domain or subdomain by which OTRS will be accessible from the Internet for agents.
Now press the “Esc” button to exit edit mode, then type “:x” and press the “Enter” button to save your changes and exit the editor.
Let’s create a second virtual host file using a text editor using the command:
Hit the “i” button to go into edit mode, then insert the following configuration for the webserver to work.
In this guide, for agents to access the OTRS web interface from the Internet, the otrs.heyvaldemar.net subdomain will be used, from which agents will be redirected to the address https://otrs.heyvaldemar.net/otrs/index.pl. You will need to specify your domain or subdomain by which OTRS will be accessible from the Internet for agents.
Now press the “Esc” button to exit edit mode, then type “:x” and press the “Enter” button to save your changes and exit the editor.
Let’s create a third virtual host file using a text editor using the command:
Hit the “i” button to go into edit mode, then insert the following configuration for the webserver to work.
In this guide, customers will use the support.heyvaldemar.net subdomain to access the OTRS web interface from the Internet, from which customers 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 accessible from the Internet for clients.
Now press the “Esc” button to exit edit mode, then type “:x” and press the “Enter” button to save your changes and exit the editor.
Let’s create the fourth virtual host file using a text editor using the command:
Hit the “i” button to go into edit mode, then insert the following configuration for the webserver to work.
In this guide, customers will use the support.heyvaldemar.net subdomain to access the OTRS web interface from the Internet, from which customers 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 accessible from the Internet for clients.
Now press the “Esc” button to exit edit mode, then type “:x” and press the “Enter” button to save your changes and exit the editor.
Now you need to assign the correct permissions to files and directories for the correct operation of OTRS. To do this, you need to use a special script.
Let’s go to the “otrs” folder using the command:
Assign the correct permissions to files and directories for the correct operation of OTRS using the command:
We activate the first virtual host using the command:
We activate the second virtual host using the command:
We activate the third virtual host using the command:
We activate the fourth virtual host using the command:
Now you need to activate the virtual host for OTRS to work, which should be loaded after all other settings. To do this, you can use a symbolic link with the “zzz” prefix.
We activate the virtual host for OTRS using the command:
Deactivate the default virtual host using the command:
Verify that there are no errors in the syntax of the new Apache config file using the command:
Restart Apache to apply the changes made using the command:
Let’s check that Apache has started successfully using the command:
Now, in order 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 obtain and subsequently renew a free SSL certificate, we will use the Let’s Encrypt certification authority, as well as the Certbot software client, which is designed to make it as easy as possible to obtain and renew a certificate through the Let’s Encrypt certification authority.
In this guide, agents will use the otrs.heyvaldemar.net subdomain 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 customers.
Request a cryptographic certificate using the command:
Next, we indicate the email address to which Let’s Encrypt will send notifications about the expiration of the cryptographic certificate and press the “Enter” button.
The next step is to read and accept the terms of use of the services provided.
Press the button “a”, then “Enter”, if you agree with the terms of use of the services provided.
The next step is to choose whether you would like to share the above email address with the Electronic Frontier Foundation in order to receive newsletters.
Press the “n” button, then “Enter”.
At the next stage, you need to choose: do you want the parameters to be automatically added to the Apache configuration file for automatically redirecting HTTP traffic to HTTPS.
Press the button “1”, then “Enter”.
Please note that cryptographic certificates obtained through Let’s Encrypt CA are valid for ninety days. Certbot automatically adds a script to renew the certificate to the task scheduler and the script runs twice a day, automatically renewing any cryptographic certificate that expires within thirty days.
You can check the functionality of the cryptographic certificate renewal process using the command:
To continue the OTRS installation process, you need to go from the workstation to 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 the system for managing the databases and the 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 need to specify the data for connecting to the previously created database.
In this manual, “otrsdbuser” is used as the username with database rights for OTRS.
In the “User” field, enter “otrsdbuser”.
In the “Password” field, specify the password assigned to the “otrsdbuser” user.
In the “Host” field, enter “127.0.0.1”.
This tutorial uses “otrsdb” as the database name for OTRS.
In the “Database name” field, specify “otrsdb”.
Click on the “Check database settings” button.
The connection to the database has been successfully established.
Click on the “Next” button.
The database has been successfully prepared to work with OTRS.
Click on the “Next” button.
In the next step, you need to specify a few more parameters for the operation of OTRS.
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 OTRS tickets.
In the “System FQDN” field, indicate 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 through which OTRS will be available from the Internet.
In the “AdminEmail” field, indicate the current email address of the OTRS administrator.
In the “Organization” field, enter the name of your organization.
In the “LogModule” field, specify “Syslog”.
In the “Default Language” field, specify the language for your OTRS system.
In the “CheckMXRecord” field, specify “Yes” to check the 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. These settings are covered in the OTRS Configuration Guide and are best skipped for now.
Click on the “Skip this step” button.
In the next step, you will receive the username and password of an account with OTRS administrator rights.
Save this data in a safe place.
Now you need to start the OTRS daemon.
We return to the terminal emulator and start the OTRS daemon using the command:
Please note that the daemon will run under the “otrs” user.
Now we need to activate two files that will be used by the cron task scheduler to verify that the OTRS daemon is running.
Let’s go to the “cron” folder using the command:
We activate the first file for the cron task scheduler using the command:
We activate the second file for the cron task scheduler using the command:
Now, to schedule tasks in the cron task scheduler, you need to use the “Cron.sh” script using the command:
Please note that the scheduled tasks will run under the “otrs” user.
OTRS installation completed successfully.
Now you need to make changes to the OTRS configuration to ensure that all internal links in OTRS will use HTTPS.
From the workstation, go to 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 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 OTRS agent web interface.
Click on the “Admin” button.
Now in the “Administration” section, select “System Configuration”.
In the search bar, specify “HttpType” and in the presented search result, select “HttpType”
In the “HttpType” section, specify “https”.
Click on the checkmark to the right of the changed parameter to save the changes.
The changes made are saved. Now you need to apply them.
Click on the notification “You have undeployed settings, would you like to deploy it them?”
In the “Changes Overview” section, select the change you want to apply and click on the “Deploy selected changes” button.
Click on the “Deploy now” button to confirm the application of the 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 checkmark to the right of the changed parameter to save the changes.
Then click on the “Dasboard” button in the upper left corner of the screen to return to the OTRS agent home page.
My Courses
🎓 Dive into my comprehensive IT courses designed for enthusiasts and professionals alike. Whether you’re looking to master Docker, conquer Kubernetes, or advance your DevOps skills, my courses provide a structured pathway to enhancing your technical prowess.
My Services
💼 Take a look at my service catalog and find out how we can make your technological life better. Whether it’s increasing the efficiency of your IT infrastructure, advancing your career, or expanding your technological horizons — I’m here to help you achieve your goals. From DevOps transformations to building gaming computers — let’s make your technology unparalleled!
Refill My Coffee Supplies
💖 PayPal
🏆 Patreon
💎 GitHub
🥤 BuyMeaCoffee
🍪 Ko-fi
Follow Me
🎬 YouTube
🐦 Twitter
🎨 Instagram
🐘 Mastodon
🧵 Threads
🎸 Facebook
🧊 Bluesky
🎥 TikTok
🐈 GitHub
Is this content AI-generated?
Nope! Each article is crafted by me, fueled by a deep passion for Docker and decades of IT expertise. While I employ AI to refine the grammar—ensuring the technical details are conveyed clearly—the insights, strategies, and guidance are purely my own. This approach may occasionally activate AI detectors, but you can be certain that the underlying knowledge and experiences are authentically mine.