Install osTicket on ubuntu 22.04

$sudo apt update -y && sudo apt upgrade -y
$sudo apt install apache2 -y
$sudo systemctl enable apache2 && sudo systemctl start apache2

$sudo apt-get install php8.1 php8.1-cli php8.1-common php8.1-imap php8.1-redis php8.1-snmp php8.1-xml php8.1-zip php8.1-mbstring php8.1-curl php8.1-mysqli php8.1-gd php8.1-intl php8.1-apcu libapache2-mod-php -y

$sudo apt install mariadb-server -y
$sudo systemctl start mariadb && sudo systemctl enable mariadb

$sudo mariadb -u root -p
CREATE DATABASE osticket;
GRANT ALL PRIVILEGES ON osticket.* TO osticket@localhost IDENTIFIED BY "YourStrongPasswordHere";
FLUSH PRIVILEGES;
EXIT;

$cd /var/www/html
$curl -s https://api.github.com/repos/osTicket/osTicket/releases/latest | grep browser_download_url | cut -d '"' -f 4 | wget -i -
$unzip osTicket-v1.18.zip -d osTicket
$cp /var/www/html/osTicket/upload/include/ost-sampleconfig.php /var/www/html/osTicket/upload/include/ost-config.php
$rm osTicket-v1.18.zip

$chown -R www-data:www-data /var/www/html/osTicket/
$find . -type d -exec chmod 755 {} \;
$find . -type f -exec chmod 644 {} \;

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


<VirtualHost *:80>
ServerName yourdomain.com
DocumentRoot /var/www/html/osTicket/upload

<Directory /var/www/html/osTicket>
AllowOverride All
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>


$sudo a2enmod rewrite
$sudo a2ensite osticket.conf
$apachectl -t
$systemctl reload apache2


Install Let's encrypt

$sudo apt install python3-certbot-apache -y
$sudo certbot --apache -d yourdomain
$sudo apachectl -t
$sudo systemctl restart apache2