How to Install osTicket Open Source Ticketing System on Ubuntu 20.04

How to Install osTicket Open Source Ticketing System on Ubuntu 20.04. In this tutorial, we will explain what osTicket is with the features and move onto installation phase. Let’s start!

What is osTicket

osTicket is a free and open source ticketing system for Linux. It is written in PHP and uses MySQL/MariaDB as a database backend. It can interface with LDAP/Active Directory for authentication.  It also supports MySQL and PostgreSQL.

 

It is a simple and lightweight web application that allows you to manage, organize and archive your support requests. It provides an intuitive mechanism that helps you to migrate from popular solutions to osTicket easily. osTicket tool provides a simple and user friendly web interface that allows you to manage issues and customer request and also helps you to add, edit and delete your help desk topics that suit your preference.

osTicket Features

  • Automated Routing.
  • Customizable Fields.
  • Customizable Forms.
  • Macros/Templated Responses.
  • Self Service Portal.
  • Service Level Agreement (SLA) Management.
  • Workflow Configuration.
  • Automated Response.
  • User, Role and Access Management.
  • Agent Collision Avoidance.
  • Assign, Transfer & Referral.
  • Advanced Search.

Follow this post to learn how to install osTicket with Apache and Let’s Encrypt SSL on Ubuntu 20.04.

Install osTicket Open Source Ticketing System on Ubuntu 20.04

Install LAMP Stack

osTicket requires a LAMP server to be installed on your server. If not installed, follow the below steps to install the LAMP server on Ubuntu 20.04.

First, install the Apache and MariaDB server using the following command:

				
					apt-get install apache2 mariadb-server -y
				
			

After installing both servers, you will need to install PHP 8.0 on your server. By default, PHP 8.0 is not included in the Ubuntu 20.04 default repository. So you will need to add PHP Ondrej repository on your server. You can add it with the following command:

				
					apt-get install ca-certificates apt-transport-https software-properties-common
add-apt-repository ppa:ondrej/php
				
			

Once the PHP repository is added, update the repository cache using the following command:

				
					apt-get update -y
				
			

Once the repository is updated, install PHP 8.0 with other required extensions by running the following command:

				
					apt-get install php8.0 libapache2-mod-php8.0 php8.0-common php8.0-fpm php8.0-cgi php8.0-bcmath php8.0-gd php8.0-imap php8.0-intl php8.0-apcu php8.0-cli php8.0-mbstring php8.0-curl php8.0-mysql php8.0-xml unzip -y
				
			

Once PHP is installed, verify the PHP installation using the following command:

				
					php -v
				
			

You will get the PHP version in the following output:

				
					PHP 8.0.16 (cli) (built: Feb 21 2022 14:42:00) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.16, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.16, Copyright (c), by Zend Technologies
				
			

Configure MariaDB Database

Next, you need to secure the MariaDB installation and set a MariaDB root password. You can do it by running the following script:

				
					mysql_secure_installation
				
			

Answer all the questions to set a MariaDB root password and secure the installation:

				
					Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Set root password? [Y/n] Y
New password: 
Re-enter new password: 
Password updated successfully!

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
				
			

Once the MariaDB is secured, log in to the MariaDB shell with the following command:

				
					mysql -u root -p
				
			

Once you are log in, create a MariaDB database and user for osTicket with the following command:

				
					CREATE DATABASE osticketdb;
CREATE USER 'osticketuser'@'localhost' IDENTIFIED BY 'password';
				
			

Next, grant all the privileges on osticket database with the following command:

				
					GRANT ALL PRIVILEGES ON osticketdb.* TO osticketuser@localhost IDENTIFIED BY "password";
				
			

Then flush the privileges and exit from the MariaDB shell with the following command:

				
					FLUSH PRIVILEGES;
EXIT;
				
			

Download osTicket

At this time of writing this tutorial, the latest version of osTicket is 1.16.1. You can download it using the following command:

				
					wget https://github.com/osTicket/osTicket/releases/download/v1.16.1/osTicket-v1.16.1.zip
				
			

Once the osTicket is downloaded, create a directory for osTicket and extract the downloaded file inside this directory:

				
					mkdir /var/www/html/osticket
unzip osTicket-v1.16.1.zip -d /var/www/html/osticket
				
			

Next, change the ownership and permission of the osTicket directory with the following command:

				
					chown -R www-data:www-data /var/www/html/osticket
chmod -R 755 /var/www/html/osticket
				
			

Now please rename the osTicket sample configuration file using the command given below:

				
					mv /var/www/html/osticket/upload/include/ost-sampleconfig.php /var/www/html/osticket/upload/include/ost-config.php 
				
			

Configure Apache for osTicket

Next, you will need to create an Apache virtual host configuration file for osTicket. You can create it with the following command:

				
					nano /etc/apache2/sites-available/osticket.conf
				
			

Add the following lines:

				
					<VirtualHost *:80>
        ServerName osticket.example.com
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html/osticket/upload
        
        <Directory /var/www/html/osticket/upload>
                Require all granted
                Options FollowSymlinks
                AllowOverride All
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/osticket.error.log
        CustomLog ${APACHE_LOG_DIR}/osticket.access.log combined
</VirtualHost>
				
			

Save and close the file when you are done. Then, activate the osTicket virtual host and enable the Apache rewrite module with the following command:

				
					a2ensite osticket.conf
a2enmod rewrite
				
			

Next, restart the Apache service to apply the configuration changes:

				
					systemctl restart apache2
				
			

To check the status of the Apache, run the following command:

				
					systemctl status apache2
				
			

You should see the following output:

				
					● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2022-03-11 05:30:07 UTC; 3s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 29189 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 29209 (apache2)
      Tasks: 6 (limit: 2348)
     Memory: 13.8M
     CGroup: /system.slice/apache2.service
             ├─29209 /usr/sbin/apache2 -k start
             ├─29210 /usr/sbin/apache2 -k start
             ├─29211 /usr/sbin/apache2 -k start
             ├─29212 /usr/sbin/apache2 -k start
             ├─29213 /usr/sbin/apache2 -k start
             └─29214 /usr/sbin/apache2 -k start

Mar 11 05:30:07 ubuntu2004 systemd[1]: Starting The Apache HTTP Server...
				
			

Access osTicket Web Installer

Now, open your web browser and access the osTicket web installer using the URL http://osticket.example.com. You will be redirected to the prerequisites page:

Make sure all prerequired packages are installed, then click on the Continue button. You should see the osTicket basic installation page:

Provide your helpdesk name, email, language, admin username, password, database settings, then click on the Install Now button. Once the osTicket has been installed, you should see the following page:

Now, click on the Staff Control Panel URL. You will be redirected to the osTicket control panel login page:

Provide your admin username, password, and click on the Log In button. You should see the osTicket setting page:

Change the default osTicket settings as per your requirement and click on the Save changes button. You should see the osTicket dashboard on the following page:

Finally, open your terminal and remove the osTicket setup directory with the following command:

				
					rm -rf /var/www/html/osticket/upload/setup/
				
			

Secure osTicket with Let's Encrypt SSL

It is always a good idea to secure your website with Let’s Encrypt SSL. You will need to install the Certbot client to install and manage the SSL. You can install it with the following command:

				
					apt-get install python3-certbot-apache -y
				
			

Once the Certbot is installed, run the following command to secure your website with Let’s Encrypt SSL:

				
					certbot --apache -d osticket.example.com
				
			

You will be asked to provide your email and accept the term of service as shown below:

				
					Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): hitjethva1981@gmail.com

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: A

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
Plugins selected: Authenticator apache, Installer apache
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for osticket.example.com
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/osticket-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/osticket-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/osticket-le-ssl.conf

				
			

Next, select whether or not to redirect HTTP traffic to HTTPS as shown below:

				
					Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
				
			

Type 2 and hit Enter to install the Let’s Encrypt SSL for your website:

				
					Enabled Apache rewrite module
Redirecting vhost in /etc/apache2/sites-enabled/osticket.conf to ssl vhost in /etc/apache2/sites-available/osticket-le-ssl.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://osticket.example.com

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=osticket.example.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/osticket.example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/osticket.example.com/privkey.pem
   Your cert will expire on 2022-06-12. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the "certonly" option. To non-interactively renew *all* of
   your certificates, run "certbot renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le
				
			

Now, you can access your osTicket website securely using the URL https://osticket.example.com.

How to Install osTicket Open Source Ticketing System on Ubuntu 20.04 Conclusion

Congratulations! you have successfully installed osTicket on Ubuntu 20.04 with Apache and Let’s Encrypt SSL. I hope you can now easily install and set up the osTicket helpdesk open source server solution on any cloud platform.

 

Another similar helpdesk reporting software tools to consider are: Jira, Bugzilla or Zoho Desk. 

Avatar for Hitesh Jethva
Hitesh Jethva

I am a fan of open source technology and have more than 10 years of experience working with Linux and Open Source technologies. I am one of the Linux technical writers for Cloud Infrastructure Services.

4 1 vote
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x