You can support us by downloading this article as PDF from the Link below. Download the guide as PDF

Are you tired of using Commercial ticketing system?. In this tutorial, I will show you how to install osTicket on Ubuntu 20.04/18.04 Bionic Beaver, using a LEMP stack, with Apache as a web server, MySQL/MariaDB as a database server and PHP 7.x.

osTicket is an open source ticket system often used for support. It is written in PHP and it comes with a  simple and intuitive web interface used to manage, organize, track and archive all support ticket requests in your company. Follow steps in this guide to Install osTicket on your Ubuntu 20.04/18.04 server.

Features of osTicket Ticketing System

All features of osTicket are available on the official osTicket feature page.

  • Custom Fields: Customize the data collected from users when submitting a ticket to help get straight to the issue.
  • Custom Columns and Queues: A custom queue is a view of tickets based on a custom criteria that you specify. A custom column is an additional field that is not displayed initially when viewing the ticket tab
  • Ticket Filters: Define rules to route incoming tickets to the right department, agents, as well as trigger actions.
  • Help Topics: Configurable help topics for web tickets allow you to route inquiries to exactly the right department for swift resolution.
  • Agent Collision Avoidance: Ticket locking mechanism to allow staff to lock tickets during response to avoid conflicting or dual responses.
  • Assign, Transfer, & Referral: Transfer tickets between departments to make sure it’s being handled by the correct agents, or assign tickets to a particular agent or team of agents.
  • Auto-Responder: Configurable automatic reply sent out when a new ticket is opened or a message is received.
  • Thread Action: Agents have the ability to create a Ticket or Task from a Ticket’s thread entry or from a Task’s thread entry.
  • Service Level Agreements: All support requests and responses are archived online for end users.
  • Advanced Search: Narrow down your search criteria with Advanced Search.
  • Tasks: Create an internal to-do list for agents.

Install osTicket on Ubuntu 20.04/18.04 Linux System

Below are the steps to Install osTicket on Ubuntu 18.04.

Step 1: Update system

Start by updating packages on your system to the latest release.

sudo apt-get update
sudo apt-get upgrade

You can also set server hostname ( Optional):

sudo hostnamectl set-hostname osticket.computingforgeeks.com

Step 2: Install and Configure MySQL / MariaDB database

You will need one MySQL database with a valid user, password, and hostname handy during installation. MySQL user specified need to have FULL privileges on the database created. if you don’t have a database server installed already, check our guide on how to Install MariaDB 10 on Ubuntu

You can also run the commands below to install mariadb from OS APT repositories:

sudo apt update
sudo apt install mariadb-server

Secure your DB Server:

$ sudo mysql_secure_installation

Change authentication plugin to be able to login as normal user with root credentials.

$ sudo mysql -u root
UPDATE mysql.user SET plugin = 'mysql_native_password' WHERE User = 'root';
FLUSH PRIVILEGES;
QUIT;

Confirm it is working:

$ mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 56
Server version: 10.3.22-MariaDB-1ubuntu1 Ubuntu 20.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 

After the MariaDB/MySQL server has been installed, proceed to create a database for osTicket. Login to your database server as root user and create a database for osTicket:

$ mysql -u root -p
CREATE DATABASE osticket_db;
GRANT ALL PRIVILEGES ON osticket_db.* TO [email protected] IDENTIFIED BY "[email protected]";
FLUSH PRIVILEGES;
QUIT;

Once the database is ready, proceed to install Apache web server:

Step 3: Installing Apache on Ubuntu

On Ubuntu, you can install Apache Web server from the official apt repository:

sudo apt install apache2

To start the service manually, run:

sudo systemctl start apache2

Though the service is enabled to start on boot by default, manually allowing it you have to run:

sudo systemctl enable apache2

Step 3: Install PHP

The next step is the to install PHP on Ubuntu:

sudo apt update
sudo apt-get install php php-{fpm,pear,imap,apcu,intl,cgi,common,mbstring,net-socket,gd,xml-util,mysql,bcmath}

The version of PHP that will be installed is v7.2 for Ubuntu 18.04 and v7.4 for Ubuntu 20.04.

$ php -v
PHP 7.4.3 (cli) (built: Mar 26 2020 20:24:23) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies

Step 4: Download and Install osTicket on Ubuntu 20.04 / 18.04

At this point, you should be ready to download the latest release of osTicket. Then uncompress the files and place a directory of your choice on the server web document root.

As of this writing, the latest release of osTicket is.v1.14.2.Please confirm the current version before downloading it.

sudo apt-get install curl wget unzip

Download latest release of osTicket:

curl -s https://api.github.com/repos/osTicket/osTicket/releases/latest \
  | grep browser_download_url \
  | grep "browser_download_url" \
  | cut -d '"' -f 4 \
  | wget -i -

Extract downloaded archive:

unzip osTicket-v*.zip -d osTicket

You will get two directories after extraction: scripts and upload

$ ls osTicket
scripts  upload

Create web directory for osTicket and mv these directories to it.

sudo mv osTicket /var/www/

Next create an osTicket configuration file:

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

Change ownership of osTicket web directory to userwww-data and group.

sudo chown -R www-data:www-data /var/www/

Step 5: Configure Apache Web Server

Create VirtualHost configuration file for osTicket on Apache configurations directory:

sudo vim /etc/apache2/sites-enabled/osticket.conf

Add content:

<VirtualHost *:80>
     ServerAdmin [email protected]
     DocumentRoot /var/www/osTicket/upload
     ServerName osticket.computingforgeeks.com
     ServerAlias www.osticket.computingforgeeks.com
     <Directory /var/www/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>

Replace:

  • osticket.computingforgeeks.com with your domain name.
  • /var/www/osTicket/upload with the path to your osTicket files.

Confirm config syntax:

$ sudo apachectl -t
Syntax OK

Restart apache2:

sudo systemctl restart apache2

Step 5: Install and configure osTicket on Ubuntu 20.04/18.04

Now that everything is set, let’s finish the installation by setting up osTicket from UI.  open http://domain.com in your favorite web browser. The first page will look like below:

Requirements satisfaction on Ubuntu 20.04:

Confirm that all requirements are satisfied and click Continue.

Fill all required information and click “Install Now” button.

On successful installation, you will get below page:

Now change the permission of ost-config.php to remove write access as shown below.

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

Also, remove setup directory:

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

Take note of all your access URLs.

Your osTicket URL:
//osticket.computingforgeeks.com/
Your Staff Control Panel:
//osticket.computingforgeeks.com/scp
osTicket Forums:
http://osticket.com/forum/
osTicket Community Wiki:
http://osticket.com/wiki/

To log in to backend system ( Staff control panel), use domain.com/scp

Now try to access Your Staff Control Panel:

Next, we will look at how to secure osTicket with Let’s Encrypt SSL certificate.

You can support us by downloading this article as PDF from the Link below. Download the guide as PDF