How To Install osTicket on Ubuntu 20.04|18.04

Posted on 39 views

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. There is a separate guide covering installation of osTicket on CentOS 8.

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.

Below are the steps to Install osTicket on Ubuntu 20.04|18.04

Step 1: Update system

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

sudo apt update && sudo apt -y full-upgrade
[ -f /var/run/reboot-required ] && sudo reboot -f

You can also set server hostname ( Optional):

sudo hostnamectl set-hostname

Edit /etc/hosts file and map hostname to IP address

$ sudo vim /etc/hosts

Step 2: Install and Configure MySQL / MariaDB database

You will need one MySQL database with a valid userpassword, and hostname handy during installation. MySQL user specified need to have FULL privileges on the database created.

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

sudo apt update
sudo apt install mariadb-server -y

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

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]";

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

Step 3: Installing Apache on Ubuntu system

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

sudo apt install apache2 -y

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 4: Install PHP and required extensions

Add PHP ppa:ondrej repository to your system:

sudo apt update
sudo apt install lsb-release ca-certificates apt-transport-https software-properties-common -y
sudo add-apt-repository ppa:ondrej/php

The next step is the to install PHP 8.0 on Ubuntu and required extensions:

sudo apt update
sudo apt install php8.0 php8.0-common -y
sudo apt install php8.0-imap php8.0-apcu php8.0-intl php8.0-cgi php8.0-mbstring php8.0-gd php8.0-mysql php8.0-bcmath php8.0-xml -y

The version of PHP installed can be checked with the following command:

$ php -v
PHP 8.0.17 (cli) (built: Mar 20 2022 17:04:09) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.17, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.17, Copyright (c), by Zend Technologies

Step 5: 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.

Install tools needed for downloading the software:

sudo apt install curl wget unzip -y

Download latest release of osTicket:

curl -s \
  | 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/

Disable default Apache webpage:

sudo a2dissite 000-default.conf
sudo rm /var/www/html/index.html
sudo systemctl restart apache2

Step 6: Configure Apache Web Server

Create VirtualHost configuration file for osTicket on Apache configurations directory:

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

Add content:

     ServerAdmin [email protected]
     DocumentRoot /var/www/osTicket/upload
          Options FollowSymlinks
          AllowOverride All
          Require all granted

     ErrorLog $APACHE_LOG_DIR/osticket_error.log
     CustomLog $APACHE_LOG_DIR/osticket_access.log combined


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

Enable website after the change

sudo a2ensite osticket.conf
sudo systemctl restart apache2

Confirm config syntax:

$ sudo apachectl -t
Syntax OK

Restart apache2:

sudo systemctl restart apache2

Step 7: 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 // or http://ip_address in your favorite web browser. The first page will look like below:


Confirm that all requirements are satisfied and click Continue.


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

os-ticket-install-ubuntu-18.04-03 (1)

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:
Your Staff Control Panel:
osTicket Forums:
osTicket Community Wiki:

To log in to backend system ( Staff control panel), use


Now try to access Your Staff Control Panel:


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


Gravatar Image
A systems engineer with excellent skills in systems administration, cloud computing, systems deployment, virtualization, containers, and a certified ethical hacker.