Step by Step Guide: Installing osTicket Locally on Windows or Ubuntu 16.04

Jump Links

Ubuntu 16.04: Installation Summary

Procedures – Ubuntu Based (LAMP Stack)

This section of the guide requires you to have an instance of Ubuntu 16.04 LTS (Xenial Xerius), Desktop or Server edition, it’s your choice. But for production or live environment, you should use Ubuntu Server edition.

To setup osTicket on Ubuntu 16.04 Desktop or Server edition, you also need the following requirements.

Requirements For Ubuntu 16.04

  1. Web Server: Apache 2.4 or later
  2. PHP 5.6 (v7.0 is not supported yet – as October 2016)
  3. MySQL 5 (or later)
  4. A minimum server with a RAM of 2GB (4GB minimum, for production server)

Installation Steps for Desktop Edition

If you want to install osTicket locally using Ubuntu, then you need a Desktop version of Ubuntu 16.04. It’s up to you whether you want to use the 32 or 64-bit version. But in my case, I’m gonna be using the 64-bit version.

Why the 16.04 LTS version? Because it’s the latest, and it has latest fixes and features that I won’t be discussing here.

Before starting off with this guide, make sure you already have downloaded the latest version of OST. Also, you must already have launched a Terminal.

To launch a terminal in Ubuntu Desktop, press and holdctrl + alt then t

Then follow these steps below to start off.

  1. Step 1: Install the LAMP Stack on Ubuntu 16.04

    Ubuntu 16.04, is shipped with PHP version 7.0. The version which is NOT yet support as of OST v1.9.14. But we can get around that, and instead, install PHP v5.6.0. Take note of this again, when you run apt-get install lamp-server^ on Ubuntu 16.04 – what you’ll get is php v7.0.

    We need to remove v7.0 and use v5.6 instead. In other cases, this won’t be necessary since you can have both version (php v5.6 & v7.0) on the same server, but that’s more complicated for Linux noob like ourselves. So to install OST on Ubuntu 16.04, we need to completely purge php v7.0 (specific to our case) and let’s bring php v5.6 onboard.

    To install LAMP using PHP v5.6.0, type the following on the command line.

    sudo apt-get install -y lamp-server^

    The above command shall install Apache Web Server, MySQL Database Server, php v7.0 – along with phpMyAdmin for frontend database administration. I’ve mentioned above that php v7.0 is not compatible with OST v1.9.14. So we need to purge php after installing the LAMP stack. Details of this is below.

  2. Step 2: Purge PHP version 7.0 and install v5.6.0

    Invoke the following command in sequence, hitting ENTER key for each command:

    • Command 1

      sudo apt-get purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`
      
    • Command 2

      sudo add-apt-repository ppa:ondrej/php
      
    • Command 3

      sudo apt-get update
      
    • Command 4

      sudo apt-get install php5.6 php5.6-cli php5.6-mysql php-gettext php5.6-mbstring php-xdebug libapache2-mod-php5.6 php5.6-gd php5.6-imap php5.6-xml -y
      

    Check if you successfully installed version 5.6.x by using command – php -v

    Sample output:

    PHP 5.6.27-1+deb.sury.org~xenial+1 (cli)
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
      with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
      with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans
    

    If you see 5.6.x – then you did it! Your PHP version is now downgraded to v5.6.

  3. Step 3: Install phpMyadmin for Database Server administration.

    Command:

    sudo apt-get install phpmyadmin -y
    

    When asked to “choose the web server that should be automatically configured to run phpmyadmin” – choose apache2 by hitting spacebar key, then hit tab key to select OK button, and finally hit ENTER key. Install process should continue.

    Reference Image:

    Screenshot - Installing phpMyAdmin

    Screenshot – Installing phpMyAdmin

    When prompted again to “Configure database for phpmyadmin with dbconfig-common” – choose Yes.

    Reference Image:

    Screenshot - Configure phpMyAadmin

    Screenshot – Configure phpMyAdmin

    Next, you will be prompted to enter twice, your application password for phpmyadmin. This is different login from the one configured above, under the lamp-server installation. That is the password for the MySQL Database. This login shall be used when login in to phpmyadmin web gui.

    Reference Image:

    Screenshot - Configure phpMyAadmin - Enter Application Password

    Screenshot – Configure phpMyAadmin – Enter Application Password

    That would be the last prompt, and installation of phpmyadmin should be completed after this point.

    You can now check http://localhost/phpmyadmin and log in as root user, and enter the password you configured in this step.

  4. Step 4: Create a database for osTicket

    After logging in, create a user with the same name as the database. To easily do this, click on User accounts between Status and Export tab.

    Then below the page, click on Add user account, and you should be taken to a new screen.

    Now enter values for; user name, hostname name and password.

    For the user name, lets use osticket just for the sake of demo. And for hostname, enter localhost. Then enter your desired password twice in the provided fields.

    Scroll a bit below the page and tick or check mark:

    • Create database with same name and grant all privileges.
    • Grant all privileges on wildcard name (username\_%).
    • Global privileges

    Then finally, click Go button on the bottom-right part of the page.

    Now, we’re ready to setup OST.

  5. Step 5: Extract OST ZIP File and copy the files to web root.

    Navigate to where you’ve downloaded the file, then extract the .zip file right-clicking on the file and click extract here.

    Open the extracted file and navigate to upload folder, then copy all the files to /var/www/html. To do this, while still on the upload folder, right-click on white space and click New terminal.

    Then type the following command:

    sudo cp -r * /var/www/html
    
  6. Step 6: Apply necessary file and folder permission.

    While still on terminal, type or copy/paste this command, one line at a time:

    sudo chown -R your-ubuntu-username:www-data /var/www/html
    
    cp /var/www/html/include/ost-sampleconfig.php /var/www/html/include/ost-config.php
    
    chmod 666 /var/www/html/include/ost-config.php
    
    mv /var/www/html/index.html /var/www/html/index.html.orig
    
    chmod -R g+s /var/www/html
    
    find /var/www/html -type d -exec chmod 0755 {} \;
    
    find /var/www/html -type f -exec chmod 0644 {} \;
    

    If you fail to complete this step, you end up running through *Error 500** when accessing the frontend.

  7. Step 7: Start the installation wizard.

    To install osTicket locally, fire up your browsser and navigate to http://localhost/setup – install page should open, and you should see that all recommended php extension are enabled.

    Reference Image:

    Screenshot - osTicket required and recommended requirements and extensions are met.

    Screenshot – Required and recommended requirements and extensions are met.

    Click on CONTINUE button to start the install wizard.

  8. Step 8: Fill out all the necessary fields on the page, most importantly the database details;

    • MySQL Hostname: localhost
    • MySQL Database: osticket -> as used in this guide, enter your if you have configured differently
    • MySQL Username: osticket
    • MySQL Password: your data base password

    Take note, that the default email address should be the address to where tickets are sent to. In a real production setup, you might want to set it as support@mybrand.com or maybe help@mybrand.com.

    When all important field are correctly filled out, click the install now button at the bottom of the page.

    If installation is successful, you’ll be taken to the Congratulations! page.

    Reference Image:

    Screenshot - Frontend Page View

    Screenshot – Frontend Page View

  9. Step 9: Post-install task.

    Change file permission for /var/www/html/ost-config.php , type this on your terminal:

    chmod 644 /var/www/html/ost-config.php
    

    Note: While NOT mandatory for a demo/test setup, you should delete the setup directory for security purpose.

    Command:

    rm -rf /var/www/html/setup
    
  10. Step 10: And we’re done!

    By now, you should already put up an instance of OST on Ubuntu. You can also use this guide under Server Edition of Ubuntu, but you need extra tool called SSH.

    You should now be able to login and explore the admin and frontend.

    Note: Installing on a remote web server like; VPS or Dedicated server, is not too different with this procedure. You only need to use a Server version of Ubuntu 16.04, plus SSH client to remotely connect to your server. Then follow through the steps mentioned in this part.

    In addition, you will need to extract the installer file using the commandline, and move the files around your server. You need a little Linux skill with this one.

    How about you read this post about VPS setup to have an idea.

Pages:

Chubbable

Hi, I'm Chubby! That's what my friends call me. I'm a tech savvy dude who is passionate in learning stuffs by himself. I post stuffs that I recently learned and also stuffs that I'm very knowledgeable of. I also post articles here to serve as my own reference and knowledge base archiving.