How to Install osTicket Open Source Ticketing System on Debian 11

How to Install osTicket Open Source Ticketing System on Debian 11. osTicket is a ticketing system aimed at improving the customer service and experience. With osticket customer service teams are able to create custom ticket queues, route tickets to the right department and create an extensive customer portal for satisfied customers. In this article we will introduce what osTicket is with its pros and move onto install phase on Debian 11. Let’s start!

What is osTicket

osTicket is an open source and web based ticketing system application written in PHP. osTicket is available as an on premise and on cloud (SupportSystem).

It provides a simple and user friendly web interface that allows you to allows you to manage, organize and archive your support requests via web browser. You can also add, edit and delete your help desk topics from the web interface. osTicket comes with more features and tools than most of the expensive and commercial support ticket systems on the market. Using osTicket, you can scale and streamline your customer service and improve your customer’s experience.

Features of osTicket

  • Free and open source.
  • SLAs and ticket report management.
  • Ticket management and Ticket Filters.
  • SSL encryption and scaling infrastructure.
  • Agent collision avoidance.
  • User, Role and Access Management.
  • Shared inbox to merge all support email accounts together.
  • Ticket creation and automated response.
  • Reporting functions to monitor individual as well as team performance.
  • Dashboard Reports
  • Configurable Help Topic
  • Service Level Agreements
  • Workflow Configuration
  • Customer Support Portal
  • Customizable Fields.
  • Advanced Search.

Follow this post to learn how to install osTicket with Nginx and Let’s Encrypt SSL on Debian 11.

Install osTicket Open Source Ticketing System on Debian 11

Install LEMP Stack

Before starting, you will need to install the Nginx web server, MariaDB database server, PHP and other necessary PHP extensions on your server.

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

				
					apt-get install nginx 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 Debian 11 default repository. So you will need to add the PHP Ondrej repository to your server.

First, install the required dependencies using the following command:

				
					apt-get install ca-certificates apt-transport-https software-properties-common -y
				
			

Please add the PHP repository with the following command:

				
					echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/sury-php.list
wget -qO - https://packages.sury.org/php/apt.gpg | apt-key add -
				
			

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 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
				
			

After the installation, check the PHP installation with the following command:

				
					php -v
				
			

You will see the PHP version in the following output:

				
					PHP 8.0.18 (cli) (built: Apr 21 2022 10:49:51) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.18, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.18, Copyright (c), by Zend Technologies
				
			

Create a Database for osTicket

Before creating a MariaDB database, 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

				
			

After securing the MariaDB, log in to the MariaDB shell with the following command:

				
					mysql -u root -p
				
			

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

				
					CREATE DATABASE osticket;
CREATE USER 'osticket'@'localhost' IDENTIFIED BY 'securepassword';
				
			

Grant all the privileges on osticket database with the following command:

				
					GRANT ALL PRIVILEGES ON osticket.* TO osticket@localhost IDENTIFIED BY "securepassword";
				
			

Flush the privileges and exit from the MariaDB shell with the following command:

				
					FLUSH PRIVILEGES;
EXIT;
				
			

Install osTicket on Debian 11

At the 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
				
			

Please rename the osTicket sample configuration file using following command:

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

Create an Nginx Virtual Host for osTicket

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

				
					nano /etc/nginx/conf.d/osticket.conf
				
			

Add the following lines:

				
					server {
listen 80;
server_name osticket.example.com;
root /var/www/html/osticket/upload;

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
index index.php index.html index.htm;


# Enable gzip
gzip on;
gzip_min_length 1000;
gzip_types text/plain application/x-javascript text/xml text/css application/xml;

set $path_info "";

location ~ /include {
deny all;
return 403;
}

if ($request_uri ~ "^/api(/[^\?]+)") {
set $path_info $1;
}

location ~ ^/api/(?:tickets|tasks).*$ {
try_files $uri $uri/ /api/http.php?$query_string;
}

if ($request_uri ~ "^/scp/.*\.php(/[^\?]+)") {
set $path_info $1;
}

location ~ ^/scp/ajax.php/.*$ {
try_files $uri $uri/ /scp/ajax.php?$query_string;
}

location / {
try_files $uri $uri/ index.php;
}

location ~ \.php$ {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.0-fpm.sock;
}
}


				
			

Save and close the file when you are done. Then, verify the Nginx for any syntax error using the following:

				
					nginx -t
				
			

You should see the following output:

				
					nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
				
			

Please restart the Nginx service to apply the configuration changes:

				
					systemctl restart nginx
				
			

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

				
					systemctl status nginx
				
			

You should see the following output:

				
					● nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2022-05-11 16:38:50 UTC; 8s ago
       Docs: man:nginx(8)
    Process: 68586 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
    Process: 68587 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
   Main PID: 68588 (nginx)
      Tasks: 3 (limit: 4679)
     Memory: 3.2M
        CPU: 55ms
     CGroup: /system.slice/nginx.service
             ├─68588 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
             ├─68589 nginx: worker process
             └─68590 nginx: worker process

May 11 16:38:50 debian11 systemd[1]: Starting A high performance web server and a reverse proxy server...
May 11 16:38:50 debian11 systemd[1]: Started A high performance web server and a reverse proxy server.

				
			

Access osTicket Web Installer

Now, open your web browser and access the osTicket web installation wizard 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:

osTicket Control Panel

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:

osTicket Settings 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/
				
			

Enable SSL on osTicket Domain

It is recommended 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-nginx -y
				
			

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

				
					certbot --nginx -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 Nginx, Installer Nginx
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for osticket.example.com
Enabled Nginx rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/nginx/conf.d/osticket-le-ssl.conf
Enabled Nginx socache_shmcb module
Enabled Nginx ssl module
Deploying Certificate to VirtualHost /etc/nginx/conf.d/osticket-le-ssl.conf
Enabling available site: /etc/nginx/conf.d/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:

				
					Redirecting vhost in /etc/nginx/conf.d/osticket.conf to ssl vhost in /etc/nginx/conf.d/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-08-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.

Great effort! We have learned how to Install osTicket Open Source Ticketing System on Debian 11.

Install osTicket Open Source Ticketing System on Debian 11 Conclusion

In this post, we explained installation of osTicket on Debian 11 with Nginx and Let’s Encrypt SSL. You can now deploy osTicket in your organization and start managing support requests from the central location.

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.

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