How to Setup osTicket Server on Azure/AWS/GCP

Install and setup osTicket helpdesk open source server solution on any of the cloud platforms (Azure, AWS or GCP) using the image available in the marketplace.  Deploy on Ubuntu, Debian or CentOS, simple 2 click install.  Check out the details below on how to install into any of the cloud platforms:

Install osTicket Server

Getting Started with osTicket Server

Once your osTicket server has been deployed, the following links explain how to connect to a Linux VM:

 

 

Once connected and logged in, you’re ready to start configuring osTicket as per the steps below:

Setting up osTicket Server

In order to get your osTicket installation working, we need to perform a few steps:

 

  1. Set MySQL root password
  2. Create new database
  3. Configure Apache website for osTicket
  4. Complete the osTicket web installer
  5. Update file permissions

First make sure the current user is root:

				
					sudo -i
				
			

On Ubuntu Server / Debian

Once logged in via your ssh terminal, the first thing to do is to set a new password for the MySQL root user account by running the following commands. Replace the text ‘your_pass_here‘ with your new password.

				
					mysql --user=root --password

Enter password: password123

ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';

FLUSH PRIVILEGES;
				
			

On CentOS Server

On CentOS installations, the password is blank, so we run the following command to set a new password. You can select ‘Y‘ for all the options that are asked.

				
					mysql_secure_installation
				
			

Then connect to the Mysql shell using the new password:

				
					mysql -p
				
			

Create Database for osTicket

We need to create a MySQL database that will be used by osTicket.  Assuming your still logged onto your MySQL shell

 

Lets create a database called ticket

				
					CREATE DATABASE ticket;
				
			

Create a new user (we will call it ticketuser) with password ‘ticketpss‘ and assign the new user to our new database.  Obviously change these to your own user and password.

				
					CREATE USER 'ticketuser'@'localhost' IDENTIFIED BY 'ticketpss';
				
			
				
					GRANT ALL ON ticket.* TO 'ticketuser'@'localhost';
				
			

Refresh the permissions and exit the console:

				
					FLUSH PRIVILEGES;
exit;
				
			

Setup PHP for osTicket

At the moment, PHP 8.0 and below is supported for running osTicket. If you are running PHP 8.1 and above we need to downgrade. Run the following command to see what version you’re running:

				
					php -v
				
			

If you’re running PHP 8.0 or below (e.g 7.4) then you can skip to the next section. However if you’re running 8.1, follow these steps to downgrade to PHP 8.0

Run the following commands to downgrade PHP to version 8.0:

				
					LC_ALL=C.UTF-8 sudo add-apt-repository ppa:ondrej/php
				
			
				
					sudo apt install -y php8.0
sudo apt install php8.0-{fpm,imap,apcu,intl,cgi,common,mbstring,gd,xml,mysql,bcmath} -y
a2enconf php8.0-fpm
sudo systemctl reload apache2
				
			

Run the following command and select PHP 8.0 to set as your default PHP version.

				
					sudo update-alternatives --config php
				
			

In my example, i select 2 and press enter.

Next we need to disable php 8.1 and restart Apache:

				
					sudo a2dismod php8.1
				
			
				
					sudo systemctl restart apache2
				
			

Now you should have PHP 8.0 as your default version, run this command to confirm:

				
					php -v
				
			

Setup Apache for osTicket

Next step is to create an Apache config file so we can host osTicket as a web application (website).  Run the following command to create an Apache conf file, depending on which OS you are using:

On Ubuntu Server / Debian

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

On CentOS Server

				
					sudo vi /etc/httpd/sites-available/osticket.conf
				
			

Copy the following config into your new osticket.conf

 

Replace the entries in ServerName and ServerAlias with your server/domain information. 

On Ubuntu Server / Debian

				
					<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/osTicket/upload/
ServerName osticket.com
ServerAlias www.osticket.com
<Directory /var/www/osTicket/upload/>
Options FollowSymlinks
AllowOverride All
Require all granted
</Directory>

ErrorLog ${APACHE_LOG_DIR}/osticket_error.log
CustomLog ${APACHE_LOG_DIR}/osticket_access.log combined
</VirtualHost>
				
			

On CentOS

				
					<VirtualHost *:80>
     ServerAdmin admin@example.com
     DocumentRoot /var/www/osTicket/upload
     ServerName osticket.com
     ServerAlias www.osticket.com  
     <Directory /var/www/osTicket/upload/>
	  Options FollowSymlinks
          AllowOverride All
          Require all granted
     </Directory>

     ErrorLog /var/log/httpd/osticket_error.log
     CustomLog /var/log/httpd/osticket_access.log combined
</VirtualHost>
				
			

Save the file.

Then, enable the new VirtualHost:

On Ubuntu Server / Debian

				
					sudo ln -s /etc/apache2/sites-available/osticket.conf /etc/apache2/sites-enabled/osticket.conf
				
			

On CentOS Server

				
					sudo ln -s /etc/httpd/sites-available/osticket.conf /etc/httpd/sites-enabled/osticket.conf
				
			

Now we restart the Apache service

Restart the Apache service on Ubuntu Server / Debian

				
					sudo systemctl restart apache2
				
			

Restart the Apache service on CentOS Server

				
					sudo systemctl restart httpd
				
			

osTicket Installation

Now if you open up your web browser and browse to the web address you used for osTicket, you should now see the installation page:

install osTicket aws

Press continue and fill out the new admin account to create and add in the database details of the database and user we created earlier.

osTicket Post Installation Cleanup

And finally, change the permissions on the osTicket configuration file and remove the setup directory.

 

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

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

osTicket Documentation / Support

Official documentation on using osTicket can be found on the following link:

 

https://docs.osticket.com/en/latest/

 

If you have issues getting the server deployed in your environment, leave a message below or contact us directly

osTicket Firewall Ports

osTicket uses the following firewall ports for accessing the portal:

 

TCP 80

TCP 443

 

osTicket also uses mail for sending email alerts, which use the following ports:

 

TCP 465

TCP 587

TCP 25

 

If you are using any of the cloud security groups and need to change / add ports refer to the following guides:

 

To setup AWS firewall rules refer to – AWS Security Groups

To setup Azure firewall rules refer to – Azure Network Security Groups

To setup Google GCP firewall rules refer to – Creating GCP Firewalls

Disclaimer: osTicket is a registered trademark owned by Enhancesoft LLC and is licensed under GNU General Public license. No warrantee of any kind, express or implied, is included with this software. Use at your risk, responsibility for damages (if any) to anyone resulting from the use of this software rest entirely with the user. The author is not responsible for any damage that its use could cause.

Avatar for Andrew Fitzgerald
Andrew Fitzgerald

Cloud Solution Architect. Helping customers transform their business to the cloud. 20 years experience working in complex infrastructure environments and a Microsoft Certified Solutions Expert on everything Cloud.

3 2 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x