UbuntuUbuntu Based

How To Install OrangeHRM on Ubuntu 24.04 LTS

Install OrangeHRM on Ubuntu 24.04

OrangeHRM is a powerful and feature-rich Human Resource Management (HRM) system, providing tools for managing employee information, tracking attendance, and handling various HR tasks. As open-source software, OrangeHRM offers a free version suitable for many organizations. For those who need more advanced capabilities, there are Professional and Enterprise editions. Installing OrangeHRM on Ubuntu 24.04 LTS ensures a stable environment with the latest security patches. This guide explains how to install the platform step by step, covering prerequisites, server configuration, database setup, and best practices for performance optimization.

Introduction

Efficient human resource management is crucial for businesses that want to streamline their administrative tasks. OrangeHRM caters to these needs by providing modules such as leave management, recruitment tracking, performance reviews, and more. One major advantage of using OrangeHRM is its open-source nature, allowing flexibility and customization to match organizational requirements. By installing OrangeHRM on Ubuntu 24.04 LTS, system administrators harness the security, reliability, and convenience of a modern Linux distribution. Ubuntu’s package management system and regular updates also reduce maintenance complexity. This tutorial focuses on essential steps for an installation, including installing the required web server, configuring a database, setting up PHP, assigning correct permissions, and optimizing performance. Properly following these steps helps create a robust HRM environment and prevents common installation pitfalls. The end result is a complete HR management system that can be accessed through a modern web browser on any network-connected device.

Prerequisites and System Preparation

Before installing OrangeHRM on Ubuntu 24.04 LTS, confirm that all system requirements are met. These typically include:

  • Ubuntu 24.04 LTS installed on a server or virtual machine with root or sudo privileges.
  • A minimum of 2 GB of RAM (4 GB or more recommended for production environments).
  • At least 10 GB of disk space available to handle software files, logs, and database storage.
  • A stable internet connection to download the required packages.

Start by updating and upgrading existing packages. Keeping the server up to date is vital for security and stability:

sudo apt update -y
sudo apt upgrade -y
sudo reboot

Rebooting ensures that all newly installed kernel or system updates are applied. After the server reboots, verify the operating system version by running:

lsb_release -a

Ensure the output shows Ubuntu 24.04. If all system checks are confirmed, proceed with installing essential packages for web server, database, and PHP. This approach guarantees a smooth setup environment on Ubuntu 24.04 LTS.

Installing Required Components

1. Web Server Setup (Nginx or Apache)

OrangeHRM requires a web server to handle incoming requests and serve static and dynamic content. Both Nginx and Apache are popular choices. This guide uses Apache for demonstration, but you can opt for Nginx if preferred.

Install Apache:

sudo apt update
sudo apt install apache2 -y

Once installed, enable and start the service so it runs automatically whenever the host reboots:

sudo systemctl enable apache2
sudo systemctl start apache2

Confirm its status:

sudo systemctl status apache2

Testing is as simple as opening the server’s IP address in a web browser. If a default Apache page appears, the web server is active.

2. Database Installation (MariaDB)

A reliable database is essential for storing user data, organizational structures, and system configurations. The recommended choice is MariaDB or MySQL. MariaDB is an enhanced fork of MySQL and often provides better performance.

sudo apt update
sudo apt install mariadb-server mariadb-client -y

Enable and start MariaDB on boot:

sudo systemctl enable mariadb
sudo systemctl start mariadb

For better security, use the built-in secure script:

sudo mysql_secure_installation

Follow the prompts to set a strong root password, remove anonymous users, disable remote root logins, and remove test databases. Afterward, log in to the MariaDB console using:

sudo mysql -u root -p

Once logged in, confirm the version or run simple queries to ensure the database is functional.

3. PHP Configuration

PHP is required for dynamic processing in OrangeHRM. Ubuntu repositories contain the latest PHP builds suitable for OrangeHRM. Install PHP and additional extensions:

sudo apt install php php-cli php-fpm php-mysql php-curl php-gd php-xml php-intl php-zip php-mbstring -y

Each extension serves a specific purpose; for instance, php-mysql enables PHP to communicate with MariaDB, while php-gd provides image processing support. Confirm the installed version of PHP:

php -v

Next, tune the PHP settings for better security and performance:

  • Adjust memory_limit to at least 256M.
  • Set upload_max_filesize and post_max_size if large file uploads are required.
  • Configure date.timezone to match the server’s region.

Locate your php.ini file using:

php --ini

Restart Apache to apply changes:

sudo systemctl restart apache2

OrangeHRM Installation Process

1. Download and Extraction

Check the official OrangeHRM website or the SourceForge page to find the most recent stable release. As of this writing, the latest stable version is 5.6.1, but always verify before proceeding. Download the zip archive into /tmp to keep the directory structure clean:

cd /tmp
wget https://gigenet.dl.sourceforge.net/project/orangehrm/stable/5.6.1/orangehrm-5.6.1.zip

After completing the download, decompress it:

sudo apt install unzip -y
unzip orangehrm-5.6.1.zip

Move the extracted folder to Apache’s document root:

sudo mv orangehrm-5.6.1 /var/www/html/orangehrm

Set the correct permissions so Apache can read and write OrangeHRM files securely:

sudo chown -R www-data:www-data /var/www/html/orangehrm
sudo chmod -R 755 /var/www/html/orangehrm

2. Web Server Configuration

Configure a dedicated virtual host to serve OrangeHRM. Create a new Apache configuration file named orangehrm.conf:

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

Add the following:

<VirtualHost *:80>
    ServerAdmin admin@yourdomain.com
    DocumentRoot /var/www/html/orangehrm
    ServerName yourdomain.com
    ServerAlias www.yourdomain.com
    
    <Directory /var/www/html/orangehrm>
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/orangehrm_error.log
    CustomLog ${APACHE_LOG_DIR}/orangehrm_access.log combined
</VirtualHost>

Replace the domain details if you have a valid DNS. For SSL/TLS, consider enabling Apache’s mod_ssl and referencing a separate configuration for port 443. After saving the file, enable the configuration:

sudo a2ensite orangehrm.conf
sudo a2enmod rewrite
sudo systemctl reload apache2

3. Database Setup

OrangeHRM stores all essential information in a dedicated database. While logged into MariaDB, create the database and assign privileges to a dedicated user:

sudo mysql -u root -p

CREATE DATABASE orangehrmdb;
GRANT ALL PRIVILEGES ON orangehrmdb.* 
   TO 'orangehrmuser'@'localhost' 
   IDENTIFIED BY 'StrongPass123';

FLUSH PRIVILEGES;
EXIT;

Choose a strong password for security. This user will connect OrangeHRM to the database to manage tables, store information, and retrieve data.

Post-Installation Configuration

1. Web-Based Installation Wizard

Open a web browser and browse to http://server-IP-or-domain. The OrangeHRM installer welcome page should appear. If any dependencies are missing, the wizard will notify you. Correct any issues before continuing.

Follow the wizard steps for database configuration, system checks, and license agreement. Once it requests database details, provide:

  • Database Name: orangehrmdb
  • Database User: orangehrmuser
  • Password: StrongPass123
  • Host: localhost

2. Admin Account Setup

The wizard prompts for admin credentials. Set a secure username (default often remains admin) and a strong password. This account has full privileges, so it is wise to store the credentials in a safe place.

3. Initial System Configuration

After installation completes, the system transitions to a summary page. Log in using admin credentials to finalize any optional configurations like email notifications, languages, or modules. Confirm the system modules are enabled as needed, such as Leave, Recruitment, or Time. Each module can be activated and configured to match organizational policies.

4. Security Hardening Steps

Remove the installer directory if it still exists. Adjust access permissions for the orangehrm/ directory to restrict excessive write privileges. If multiple staff members have administrative access, consider implementing multi-factor authentication solutions or IP-based restrictions at the network level. Regularly update Ubuntu and PHP to reduce vulnerability risks. Furthermore, use SSL/TLS encryption for secure connections by enabling HTTPS with a valid certificate. Taking these steps protects sensitive employee data and fosters trust in the OrangeHRM installation.

Troubleshooting Common Issues

During or after installation, some users encounter common challenges. Incorrect folder permissions often lead to blank pages or “Forbidden” errors. Ensuring proper ownership of /var/www/html/orangehrm by www-data resolves many file access issues. Database connection errors arise if the user credentials are mismatched, or if localhost is replaced incorrectly. Adjust your orangehrm.conf or re-check config.php to confirm database credentials. Another common issue is incorrect PHP settings, such as insufficient memory_limit or disabled extensions. Revisiting your php.ini to enable required modules (like php-mysql or php-gd) often solves runtime glitches. If after changes a Service Unavailable error appears, reload or restart Apache, then verify logs within /var/log/apache2 for potential misconfigurations. Monitoring these logs is helpful for quickly identifying root causes of failed connections or syntax errors.

Performance Optimization

OrangeHRM performance relies on efficient use of resources. Caching plays a large role in speeding up page responses. Installing OPcache or a similar opcode cache for PHP reduces script load times. Tuning the my.cnf file in MariaDB (e.g., adjusting innodb_buffer_pool_size) helps handle higher volumes of queries. Using content delivery networks (CDNs) for static files and images also lowers server strain. Maintaining indexes in the OrangeHRM database improves data retrieval times. Simple housekeeping tasks, such as regularly pruning old logs or archiving unused employee records, further sustain performance.

Congratulations! You have successfully installed OrangeHRM. Thanks for using this tutorial for installing the OrangeHRM human resource management system on Ubuntu 24.04 LTS system. For additional help or useful information, we recommend you check the official OrangeHRM website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button