How to install osTicket on Ubuntu 24.04 with LAMP Stack

Estimated reading: 4 minutes 53 views

Introduction

osTicket is a widely used open-source support ticket system that helps organizations manage customer support requests efficiently. Written in PHP, osTicket offers a web-based interface that integrates seamlessly with email and web forms. In this tutorial, you’ll learn how to install osTicket on Ubuntu 24.04, using the LAMP stack (Linux, Apache, MariaDB, and PHP). We’ll walk through each step from installing dependencies to configuring your virtual host and completing the web-based installer.


Prerequisites

Before you begin, ensure you have the following:

  • An Ubuntu 24.04 server

  • A non-root user with sudo privileges

  • A domain name pointed to your server’s IP address


Step 1: Install Required Packages and PHP Repository

First, update your package list and install essential tools:

sudo apt update sudo apt install -y ca-certificates apt-transport-https software-properties-common lsb-release

Add the PHP PPA (for PHP 8.2 support):

sudo add-apt-repository ppa:ondrej/php -y

Step 2: Install the LAMP Stack and PHP Extensions

Install Apache, MariaDB, PHP 8.2, and all required PHP extensions:

sudo apt install -y 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


Step 3: Verify Services Are Running

Check the status of Apache:

sudo systemctl is-enabled apache2
sudo systemctl status apache2

Check MariaDB:

sudo systemctl is-enabled mariadb
sudo systemctl status mariadb

Verify PHP version and modules:

php -v
php -m


Step 4: Configure PHP

Open the PHP configuration file:

sudo nano /etc/php/8.2/apache2/php.ini

Update the following settings:

memory_limit = 512M

Save and exit. Then restart Apache:

sudo systemctl restart apache2

Step 5: Secure and Configure MariaDB

Run the MariaDB security script:

sudo mariadb-secure-installation

Follow the prompts:

  • Press ENTER if no root password is set

  • Select N for switching to unix_socket authentication

  • Set a strong root password

  • Disable remote root login

  • Remove test database and anonymous users

  • Reload privilege tables

Then log in to MariaDB:

sudo mariadb -u root -p

Create the database and user:

CREATE DATABASE osticket;
CREATE USER ‘osticket’@’localhost’ IDENTIFIED BY ‘osticketpassword’;
GRANT ALL PRIVILEGES ON osticket.* TO ‘osticket’@’localhost’;
FLUSH PRIVILEGES;
SHOW GRANTS FOR ‘osticket’@’localhost’; QUIT;


Step 6: Download osTicket

Navigate to the web root and download osTicket:

cd /var/www

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

unzip osTicket-v1.18.1.zip -d osTicket

Set permissions:

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

Rename the configuration sample file:

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

 


Step 7: Configure Apache Virtual Host

Create a new virtual host file:

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

Add the following configuration (replace with your actual domain):

<VirtualHost *:80> 
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>

Enable the site and test Apache configuration:

sudo a2ensite osticket.conf

sudo apachectl configtest

If the output is Syntax OK, Disables the default Apache virtual host (000-default.conf) restart Apache:

sudo a2dissite 000-default.conf
sudo systemctl restart apache2


Step 8: Install osTicket via Web Interface

1. Open a browser and visit: http://youripaddress

2. The osTicket installer will check your environment. Click Continue

3. Enter system settings, create the admin account, and provide the database info:

    • Database Name: osticket

    • Username: osticket

    • Password: osticketpassword

4. Click Install Now

Login with admin account:

Once installation is complete:

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


You can now access the main osTicket interface via your domain.


Conclusion

You have successfully installed osTicket on Ubuntu 24.04 with the LAMP stack. You configured Apache, MariaDB, and PHP to support osTicket and completed the installation through the web interface. Your ticketing system is now ready to receive support requests and manage customer interactions effectively.

To further enhance security, consider adding HTTPS support via Let’s Encrypt in future steps.

Share this Doc

How to install osTicket on Ubuntu 24.04 with LAMP Stack

Or copy link

CONTENTS