How to install LAMP and run OrangeHRM in Ubuntu 12.04 LTS

In the following article we are going to explain how you can install LAMP (Linux Apache MySQL and PHP) and run OrangeHRM in your Ubuntu 12.04 LTS Linux VPS.

What is OrangeHRM?

It is an Open Source Human Resource Management system written in PHP.

It has the following features:

  • Administration Module
  • Personal Information Management
  • Leave Module
  • Time Module
  • Employee Self Service Module
  • Recruitment/ Applicant Tracking Module
  • Performance Module

Before proceeding any further, make sure you are in a screen session and your Ubuntu VPS system is fully up-to-date:

## screen -U -s orangehrm-screen
## apt-get update
## apt-get upgrade

Install Apache2 webserver on your Ubuntu 12.04 system using

## apt-get install apache2

Next, proceed with installing the MySQL database server in your system using

## apt-get install mysql-server

once installed, run the post-installation script mysql_secure_installation and configure it like this

## mysql_secure_installation

- Set root password? [Y/n] y
- Remove anonymous users? [Y/n] y
- Disallow root login remotely? [Y/n] y
- Remove test database and access to it? [Y/n] y
- Reload privilege tables now? [Y/n] y

finally, edit /etc/mysql/my.cnf, add event_scheduler = ON anywhere under [mysqld] block and restart mysql using service mysql restart for the change to take effect.

install PHP support on the system using the following command:

## apt-get install php5 php5-mysql

check it out using

## php -v
PHP 5.3.10-1ubuntu3.10 with Suhosin-Patch (cli) (built: Feb 28 2014 23:19:50)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies

also, create test /var/www/info.php script containing the following

## vim /var/www/info.php


and try to access it at http://your_server_ip/info.php . If the PHP info page is rendered in your browser then everything looks good and you are ready to proceed further.

install zip support in case it’s not already installed on the system

## apt-get install unzip

Install OrangeHRM in /var/www/orangehrm

## ver=3.1.1
## wget -P /tmp${ver}/orangehrm-${ver}.zip
## unzip /tmp/orangehrm-${ver}.zip -d /var/www/
## mv /var/www/orangehrm-${ver} /var/www/orangehrm
## chown www-data: -R /var/www/orangehrm

configure to serve the OrangeHRM in /var/www/orangehrm by creating a new Virtual Host Directive in /etc/apache2/sites-available/

## vim /etc/apache2/sites-available/

<VirtualHost *:80>
    DocumentRoot /var/www/orangehrm

    <Directory "/var/www/orangehrm">
        Options -Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all

    LogLevel warn
    ErrorLog ${APACHE_LOG_DIR}/
    CustomLog ${APACHE_LOG_DIR}/ combined

make sure you replace with your actual domain name

enable the Virtual Host Directive using the following command:

## a2ensite

restart apache for the change to take effect using

## service apache2 reload

Access in order to complete the installation of OrangeHRM. In the first step just click ‘Next/I Accept’ and in ‘step 2’ when prompted to set-up your database use your MySQL ‘root’ password to create a new database for OrangeHRM. See the screenshot below:

In ‘step 3: System Check’, make sure all listed items are green and OK. You should see something like this:


In ‘step 4: Admin User Creation’, create your ‘Admin’ username and password and in ‘Step 5: Confirmation’ confirm your set-up and install OrangeHRM by clicking on the ‘Install’ button.

Of course you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert linux admins to install this for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.


3 thoughts on “How to install LAMP and run OrangeHRM in Ubuntu 12.04 LTS”

  1. I have installed OrangeHrm 3.3.3 on Ubuntu 14.04 Server and now trying to configure SMTP Email.

    The credentials and settings are correct. I am using same in SuiteCRM installed on CentOS 7.

    The message I get

    Settings Saved. Test email not sent.

    I remember doing this on CentOS:

    chcon -R -t httpd_sys_content_rw_t /var/www/html
    setsebool httpd_can_network_connect=on
    setsebool httpd_can_sendmail=on
    setsebool httpd_unified=on
    Is there some similar settings for Apache on Ubuntu where I can allow sendmail on the server?

    I would highly appreciate your input.

    Thanks in advance.

    • Email configuration has two settings: Sendmail or SMTP. Sendmail allows you to send emails from the same server that OrangeHRM is running on. SMTP requires additional options to set it up, so use SMTP only if you want to send emails using a remote mail server.

  2. Congratulations! this is a very good job. Have you considered updating the installing instructions post to a newer version of orangehrm?

    Greetings from Honduras!


Leave a Comment

To prove you are human please solve the following *