osTicket is a powerful and free open-source support ticket system that can help streamline your customer service and enhance the overall customer experience. With its web-based interface, osTicket allows you to efficiently manage, organize, and track all support tickets. This tutorial will guide you through the process of installing osTicket on a Debian 11 server, using Nginx as the web server.
Prerequisites
Before you begin the installation process, make sure you have the following prerequisites in place:
- A server running Debian 11.
- A valid domain name pointed to your server’s IP address.
- A root password configured on the server.
Getting Started
To get started, it’s important to update and upgrade all system packages to ensure you have the latest versions. You can do this by running the following commands:
apt update -y apt upgrade -y
Once the system packages are up to date, you can proceed with installing the necessary packages for osTicket. Run the following command to install the required packages:
apt install ca-certificates apt-transport-https software-properties-common wget curl -y
Install Nginx and PHP
Next, you’ll need to install the Nginx web server and PHP. Run the following commands to install both:
apt install nginx -y curl -sSL https://packages.sury.org/php/README.txt | bash -x apt install php8.1 php8.1-mysql php8.1-cgi php8.1-fpm php8.1-cli php8.1-curl php8.1-gd php8.1-imap php8.1-mbstring php8.1-intl php8.1-apcu php8.1-common php8.1-gettext php8.1-bcmath php8.1-xml php8.1-dom -y
After the installation is complete, you’ll need to make a small configuration change to the PHP setup. Open the PHP configuration file with the command:
nano /etc/php/8.1/fpm/php.ini
Locate the line cgi.fix_pathinfo=0
and change it to cgi.fix_pathinfo=1
. Save and close the file. Next, restart the PHP-FPM service to apply the changes:
systemctl restart php8.1-fpm
Install and Configure MariaDB
To store osTicket data, you’ll need to install the MariaDB database server. Run the following command to install it:
apt install mariadb-server -y
Once the installation is complete, run the command below to secure the MariaDB installation:
mysql_secure_installation
Follow the on-screen prompts to set a root password, remove anonymous users, disallow remote root login, remove the test database, and reload privileges.
Next, you’ll need to log in to the MariaDB shell as the root user:
mysql -u root -p
Enter the root password when prompted. Once you’re logged in, create a database and user for osTicket. Run the following commands:
CREATE DATABASE osticketdb; GRANT ALL PRIVILEGES ON osticketdb.* TO osticketuser IDENTIFIED BY 'secure-password'; FLUSH PRIVILEGES; EXIT;
Make sure to replace ‘secure-password’ with a strong password of your choice.
Install osTicket
With the database prepared, it’s time to download and install osTicket. Start by navigating to the desired directory where you want to install osTicket. In this example, we’ll use the /var/www/html
directory. Run the following commands to download and extract osTicket:
cd /var/www/html wget https://github.com/osTicket/osTicket/releases/download/v1.17.2/osTicket-v1.17.2.zip unzip osTicket -v 1.17.2.zip
Once the extraction is complete, you’ll need to set the correct ownership and permissions for the osTicket directory:
chown -R www-data:www-data /var/www/html/osticket chmod -R 755 /var/www/html/osticket
Next, rename the osTicket sample configuration file:
mv /var/www/html/osticket/upload/include/ost-sampleconfig.php /var/www/html/osticket/upload/include/ost-config.php
Configure Nginx for osTicket
To configure Nginx for osTicket, you’ll need to create an Nginx virtual host configuration file. Run the following command to create the file:
nano /etc/nginx/conf.d/osticket.conf
Inside the file, add the following configuration:
server { listen 80; server_name osticket.example.com; root /var/www/html/osticket/upload; index index.php index.html index.htm; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; # 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.1-fpm.sock; } }
Save and close the file. Next, verify the Nginx configuration:
nginx -t
If the configuration is valid, you’ll 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
Finally, restart the Nginx service to apply the changes:
systemctl restart nginx
Access osTicket Web Interface
At this point, Nginx is installed and configured for osTicket. You can now access the osTicket installation page using your web browser. Navigate to http://osticket.example.com
(replace osticket.example.com
with your domain name). You should see the osTicket prerequisites page.
Click on “Continue” to proceed to the basic installation page. Here, you’ll need to provide information such as your helpdesk URL, name, email, database name, username, and password. Once you’ve filled in the required details, click on the “Install Now” button to start the installation process.
After the installation completes successfully, you’ll see a confirmation page. To access the osTicket control panel, open your web browser and enter http://osticket.example.com/scp
(replace osticket.example.com
with your domain name). You should now see the osTicket login page.
Enter your admin username and password, then click on the “Login” button to access the osTicket dashboard. From here, you can start configuring osTicket to suit your needs and manage support tickets efficiently.
Enable SSL on osTicket
To secure your osTicket installation with SSL, you can use Let’s Encrypt to obtain a free SSL certificate. Let’s Encrypt provides a simple and automated way to enable HTTPS on your website.
First, install the Certbot package by running the following commands:
apt install snapd -y snap install core snap refresh core snap install --classic certbot ln -s /snap/bin/certbot /usr/bin/certbot
Next, obtain and install the SSL certificate by running the following command:
certbot --nginx -d osticket.example.com
Replace osticket.example.com
with your domain name. Follow the prompts to enter your email address and agree to the terms of service. Certbot will automatically configure Nginx to use the SSL certificate.
Once the SSL certificate is installed, you can access your osTicket installation securely using https://osticket.example.com
(replace osticket.example.com
with your domain name).
Conclusion
Congratulations! You have successfully installed osTicket with Nginx on Debian 11. You now have a powerful support ticket system to manage and track customer inquiries efficiently. osTicket, combined with Nginx’s performance and scalability, provides a reliable solution for your customer service needs.
If you have any questions or need further assistance, feel free to reach out to the team at Shape.host. We specialize in Linux SSD VPS hosting and can provide you with reliable hosting solutions tailored to your business requirements. Visit Shape.host to learn more about our services.