How to Install osTicket on Debian 11

how to install osticket on debian 11

osTicket is a free and open-source support ticket system written in PHP.  It comes with a simple and intuitive web interface used to manage, organize, track and archive all support ticket requests in your company.

In this tutorial, we will show you how to install osTicket on your Debian 11 VPS.

Requirements

  • For the purposes of this tutorial, we will be using a Debian 11 Server.
  • SSH root access or a user with sudo privileges is also required.
  • PHP version 8.0

Step 1. Log in via SSH and update the system

Log in to your Debian 11 VPS with SSH as a root user:

ssh root@IP_Address -p Port_number

Replace “IP_Address” and “Port_Number” with your server’s IP address and SSH port.

Now, run the following command to update all installed packages to the latest available version.

apt update && sudo apt upgrade

Step 2: Install Apache Webserver

Execute the following command to install Apache webserver:

apt install apache2

To start Apache and to enable it to auto-start on server boot, run these commands:

systemctl enable apache2
systemctl start apache2

To confirm that you have properly installed Apache, you can check the status of the Apache service:

systemctl status apache2

You should get the following output:

● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: active (running)
Docs: https://httpd.apache.org/docs/2.4/
Main PID: 1144 (apache2)
Tasks: 55 (limit: 2301)
Memory: 8.9M
CPU: 131ms
CGroup: /system.slice/apache2.service
├─1144 /usr/sbin/apache2 -k start
├─1146 /usr/sbin/apache2 -k start
└─1147 /usr/sbin/apache2 -k start

Step 3: Install PHP and extensions

osTicket requires a minimum PHP 8.0 version. PHP 8 packages are not available in the default Debian 11 package repositories.

So, to install PHP 8 first we have to enable SURY PHP PPA repository, which contains all the released versions of PHP to date.

Download the GPG key and add the required repository through the following commands:

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

Once the SURY repository is added, you need to update your system’s repository:

apt-get update

To install PHP 8.0 and the required PHP extensions, run the following command:

apt install php8.0 php8.0-cli php8.0-common php8.0-curl php8.0-mbstring php8.0-gd php8.0-mysql php8.0-xml php8.0-imap php8.0-intl php8.0-apcu

Step 4: Install MariaDB

MariaDB is available in the Debian 11 default OS repository. You can install it by running the following command:

apt install mariadb-server

By default, the MariaDB service will start automatically after installing it in your system. You can verify it with the following command:

systemctl status mariadb

You should get the following output:

● mariadb.service - MariaDB 10.5.12 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: active (running)
Docs: man:mariadbd(8)
https://mariadb.com/kb/en/library/systemd/
Process: 564 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
Process: 593 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 595 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ] && sy>
Process: 758 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 760 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)
Main PID: 659 (mariadbd)
Status: "Taking your SQL requests now..."
Tasks: 8 (limit: 2301)
Memory: 113.8M
CPU: 2.277s
CGroup: /system.slice/mariadb.service
└─659 /usr/sbin/mariadbd

Once the installation is complete, issue the following command to secure your installation. This is optional, but strongly recommended:

mariadb_secure_installation

This script will set the MariaDB root password, disable remote root login and remove anonymous users. We suggest answering every question with the character ‘Y’ for yes.

Step 5: Create a Database for osTicket

Create a MySQL database for the osTicket website:

mysql -u root -p
MariaDB [(none)]> CREATE DATABASE osticketdb;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON osticketdb.* TO 'osticketuser'@'localhost' IDENTIFIED BY 'Str0ngPassw0rd';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

Don’t forget to replace ‘Str0ngPassw0rd’ with an actual strong password.

Step 6: Download osTicket on Debian 11

Download the latest stable version from the official source by executing the following command on your server:

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

Then create a osTicket directory unzip it to the  /var/www/html/osTicket directory.

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

Create an osTicket configuration file:

cp /var/www/html/osTicket/upload/include/ost-sampleconfig.php /var/www/html/osTicket/upload/include/ost-config.php

Then run the following command to set the correct permissions:

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

Step 7: Create an Apache configuration file

To create a new configuration file for osTicket, we can create a new Apache configuration file:

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

A basic Apache configuration file looks similar to this:

 <VirtualHost *:80>
    ServerAdmin admin@your_domain.com
     DocumentRoot /var/www/html/osTicket/upload
     ServerName your_domain.com
     ServerAlias www.your_domain.com
     
     <Directory /var/www/html/osTicket/>
          Options FollowSymlinks
          AllowOverride All
          Require all granted
     </Directory>

     ErrorLog ${APACHE_LOG_DIR}/osTicket_error.log
     CustomLog ${APACHE_LOG_DIR}/osTicket_access.log combined
</VirtualHost>

Don’t forget to change the domain name next to ServerAdmin and ServerName (your_domain.com) in order to make it work with your unique registered domain name.

Save and close the file then activate the osTicket virtual host with the following command:

a2ensite osTicket.conf

You can now open http://your_domain.com in your favorite web browser in order to finish the osTicket installation:

install osticket on debian 11

Confirm that all requirements are satisfied and click Continue.

The next step is to add the base system configuration and click the “Install Now” button:

install osticket on debian

On successful installation, you will get the following page:

osticket on debian 11


Now change the permission of ost-config.php to remove write access:

chmod 0644 /var/www/html/osTicket/upload/include/ost-config.php

Also, remove the setup directory:

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

That’s it! osTicket has been successfully installed on your Debian 11 server.

Of course, you don’t have to install osTicket on Debian 11 if you use one of our managed VPS hosting services, in which case you can simply ask our expert Linux admins to install osTicket for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post on how to install osTicket on Debian 11, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

Leave a Comment

To prove you are human please solve the following *