How to Install osTicket on Ubuntu 24.04 Server
This tutorial exists for these OS versions
- Ubuntu 24.04 (Noble Numbat)
- Ubuntu 22.04 (Jammy Jellyfish)
On this page
osTicket is an open-source help desk and ticketing solution written in PHP. It supports multiple integration such as email. Phone number, and web forms. You can also set up custom fields, filters, topics, tasks, and also auto-responders.
In this guide, you'll learn how to install the osTicket open-source ticketing system on Ubuntu 24.04 server. You'll be installing osTicket with the LAMP Stack (Linux, Apache, MariaDB, and PHP) and securing osTicket with HTTPS through Certbot and Letsencrypt.
Prerequisites
To complete this guide, make sure you have the following:
- An Ubuntu 24.04 server
- A non-root user with administrator privileges
- A domain name pointed to server IP address
Installing dependencies
osTicket is an open-source ticketing system written in PHP. To install osTicket on your ubuntu syste, you must install LAMP Stack (Linux, Apache, MariaDB, and PHP). At this time, you need PHP 8.2, so you will be installing it through third-party repository.
First, run the following command to install basic packages to your Ubuntu system and add the PPA repository for PHP. In this case, you'll be using PHP 8.2 for installing osTicket, which is available on the PPA repository.
sudo apt install ca-certificates apt-transport-https software-properties-common lsb-release -y
sudo add-apt-repository ppa:ondrej/php -y
Now run the command below to install the LAMP Stack dependencies to your Ubuntu system. Enter 'Y' to confirm the installation.
sudo apt install apache2 mariadb-server php8.2 libapache2-mod-php8.2 php8.2-mysql php8.2-cgi php8.2-fpm php8.2-cli php8.2-curl php8.2-gd php8.2-imap php8.2-mbstring php-pear php8.2-intl php8.2-apcu php8.2-common php8.2-bcmath php8.2-xml php8.2-zip
After the installation is finished, check the 'apache2' service status using the following command.
sudo systemctl is-enabled apache2
sudo systemctl status apache2
You can see below the Apache web server is enabled and running.
Next, check the MariaDB server status with the command below. You'll see the MariaDB server also running and enabled on your Ubuntu system.
sudo systemctl is-enabled mariadb
sudo systemctl status mariadb
Lastly, run the command below to check the PHP version. You'll see that PHP 8.2 is installed on your system via the PPA repository.
sudo php -v
sudo php -m
Configuring PHP
In this section, you'll configure PHP by editing the default 'php.ini' file and restart the Apache web server.
Open the file '/etc/php/8.2/apache2/php.ini' using the following 'nano' editor.
sudo nano /etc/php/8.2/apache2/php.ini
Change the default configuration with the following. Make sure to adjust the options 'date.timezone' and 'memory_limit' as needed.
date.timezone = Europe/Berlin
memory_limit = 512M
When finished, save the file and exit the editor.
Lastly, run the 'systemctl' command below to restart the Apache web server and apply your new PHP configurations.
sudo systemctl restart apache2
Configuring MariaDB server
After configuring PHP, you'll be securing your MariaDB server installation and creating a new database and user for osTicket. You'll be using the 'mariadb-secure-installation' utility to secure the MariaDB server, and then using the 'mariadb' client.
Execute the following 'mariadb-secure-installation' to secure your MariaDB server installation.
sudo mariadb-secure-installation
Now you'll be asked about the following configurations:
- For the default MariaDB server installation without a root password, press ENTER when asked about the password.
- The local authentication for MariaDB root users is secured by default, input 'n' when asked to change the authentication method to 'unix_socket'.
- Input 'Y' to create a new MariaDB root password. Then, input the strong password for your MariaDB root user and repeat.
- When asked to disable remote authentication for the MariaDB root user, input 'Y' to agree.
- The default MariaDB server installation comes with the database 'test' and allows an anonymous user to access it. Input 'Y' for both settings to remove the default database 'test' and remove the anonymous privilege.
- Lastly, input 'Y' to confirm reloading table privileges.
After the MariaDB server is configured and secured, you need to create a new database and user for osTicket installation.
Log in to the MariaDB server using the 'mariadb' client command below. Enter your MariaDB root password when prompted.
sudo mariadb -u root -p
Once logged in, run the following queries to create a new database and user 'osticket' with the password 'osticketpassword'. Change the following details as needed.
CREATE DATABASE osticket;
CREATE USER 'osticket'@'localhost' IDENTIFIED BY 'osticketpassword';
GRANT ALL PRIVILEGES ON osticket.* TO osticket@localhost IDENTIFIED BY "osticketpassword";
FLUSH PRIVILEGES;
Now run the query below to ensure that user 'osticket' can access the database 'osticket'.
SHOW GRANTS FOR osticket@localhost;
In the following output, you can see that the 'osticket' database is accessible through the 'osticket' user.
Lastly, type 'quit' to exit from the MariaDB server.
Downloading osTicket
Now that you've configured the PHP and MariaDB server, you'll be downloading the osTicket source code and setting up the installation directory.
Go to the '/var/www/' directory and download the osTicket source code using the 'wget' command below.
cd /var/www
wget https://github.com/osTicket/osTicket/releases/download/v1.18.1/osTicket-v1.18.1.zip
Once downloaded, run the 'unzip' command below to extract the osTicket source code to the 'osTicket' directory. So the osTicket installation directory will be available at the '/var/www/osTicket'.
unzip osTicket-v1.18.1.zip -d osTicket
Now run the command below to change the ownership of the '/var/www/osTicket' directory to the user 'www-data' and change the default permission to '0755'.
sudo chown -R www-data:www-data /var/www/osTicket
sudo chmod 755 /var/www/osTicket
Lastly, run the following command to copy the osTicket configuration to '/var/www/osTicket/upload/include/ost-config.php'.
mv /var/www/osTicket/upload/include/ost-sampleconfig.php /var/www/osTicket/upload/include/ost-config.php
Setting up Apache virtual host
In this section, you'll be creating a new Apache virtual host file for osTicket. So make sure that you've your domain name pointed to a server IP address.
Create a new Apache virtual host file '/etc/apache2/sites-available/osticket.conf' with the following 'nano' editor.
sudo nano /etc/apache2/sites-available/osticket.conf
Insert the following configuration and make sure to change the 'ServerName' option with your domain name.
<VirtualHost *:80>
ServerName ticket.howtoforge.local
ServerAdmin admin@localhost
DocumentRoot /var/www/osTicket/upload
<Directory /var/www/osTicket/upload>
Require all granted
Options FollowSymlinks
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/osticket.error.log
CustomLog ${APACHE_LOG_DIR}/osticket.access.log combined
</VirtualHost>
When done, save the file and exit the editor.
Now run the command below to activate the 'osticket.conf' file and verify your Apache syntax. If you've proper Apache syntax, you'll see an output 'Syntax is OK'.
sudo a2ensite osticket.conf
sudo apachectl configtest
Lastly, run the 'systemctl' command below to restart the Apache web server and apply your changes.
sudo systemctl restart apache2
Securing osTicket with HTTPS
In this section, you'll be securing osTicket installation with HTTPS. For this, you'll be installing and using Certbot for generating SSL/TLS certificates from letsencrypt.
Install the 'certbot' and 'python3-certbot-apache' plugin with the following 'apt' command.
sudo apt install certbot python3-certbot-apache -y
After the installation is complete, run the 'certbot' command below to generate SSL/TLS certificates and secure osTicket with HTTPS. Make sure to change the following email address and domain name with your information.
sudo certbox --apache --agree-tos --redirect --hsts --staple-ocsp --email [email protected] -d ticket.howtoforge.local
When finished, your SSL/TLS certificates will be available at the '/etc/letsencrypt/live/domain.com' directory and your osTicket installation should be secured with HTTPS.
Installing osTicket
Open your web browser and visit your domain name such as https://tiket.howtoforge.local. If everything goes well, you'll see the osTicket installation wizard.
Make sure every dependency for osTicket is installed and click Continue.
Change the basic system settings such as your domain name, then input the new admin user for osTicket, and input the database details that you've created.
If the installation is complete, you'll see the following page:
Next, back to your server terminal and run the command below to delete the 'setup' directory from your osTicket installation.
sudo rm -rf /var/www/osTicket/upload/setup
Now if you access the osTicket homepage, you'll get the default page like this:
Log in to the osTicket with your admin user and password.
If you have the correct admin credentials, you'll see the following osTicket Administration Dashboard.
Conclusion
Congratulations! You've completed the installation of osTicket on the Ubuntu 24.04 server. You've osTicket up and running with the LAMP Stack (Linux, Apache, MariaDB, and PHP), and you've also secured osTicket with HTTPS through Certbot and let's encrypt.