OrangeHRM 5.8.1 Installation on Ubuntu 24.04 Using Ansible
This guide explains how to install OrangeHRM 5.8.1 on an Ubuntu 24.04 server using an Ansible playbook. It is written for beginners and provides every command required to complete the installation.
Prerequisites
Before starting, ensure that:
- You have an Ubuntu 24.04 server.
- You have a user account with sudo privileges.
- Your server has Internet access.
- Ansible is already installed.
Step 1 - Connect to Your Ubuntu Server
Log in to your server using SSH.
ssh username@your_server_ip
Example:
ssh john@192.168.1.100
Step 2 - Verify Ubuntu Version
Check that you are running Ubuntu 24.04.
lsb_release -a
You should see output similar to:
Description: Ubuntu 24.04 LTS
Step 3 - Verify Ansible Installation
Check whether Ansible is installed.
ansible --version
If Ansible is not installed, run:
sudo apt update
sudo apt install ansible -y
Step 4 - Create the Ansible Project Directory
Create a folder for your Ansible project.
mkdir ~/ansible-project
cd ~/ansible-project
Step 5 - Create an Inventory Folder
mkdir inventory
Step 6 - Create the Inventory File
nano inventory/hosts
Add the following content:
[all]
localhost ansible_connection=local
Save the file.
- Press CTRL + O
- Press Enter
- Press CTRL + X
Step 7 - Copy the OrangeHRM Playbook
Create the playbook file.
nano orangehrm.yml
Copy and paste the OrangeHRM Ansible playbook into the file.
Save the file.
- CTRL + O
- Enter
- CTRL + X
Step 8 - Verify the Playbook Syntax
Check that the YAML syntax is correct.
ansible-playbook --syntax-check orangehrm.yml
You should receive:
playbook: orangehrm.yml
Step 9 - Run the Playbook
Execute the installation.
ansible-playbook -i inventory/hosts orangehrm.yml
The playbook performs the following tasks automatically:
- Updates the Ubuntu package repository.
- Installs Apache.
- Installs MySQL Server.
- Installs PHP and all required PHP extensions.
- Stops and disables Nginx (if installed).
- Enables the Apache Rewrite module.
- Starts Apache and MySQL.
- Downloads OrangeHRM 5.8.1.
- Extracts the OrangeHRM files.
- Creates the OrangeHRM database.
- Creates the OrangeHRM database user.
- Configures file permissions.
- Opens port 80 in the firewall.
- Restarts Apache.
Step 10 - Confirm Successful Installation
When the playbook finishes successfully, you should see something similar to:
PLAY RECAP
localhost : ok=22
changed=13
failed=0
The value failed=0 confirms that the installation completed successfully.
Step 11 - Find Your Server IP Address
Run the following command:
hostname -I
Example output:
102.202.44.172
Step 12 - Open OrangeHRM
Open your web browser and navigate to:
http://YOUR_SERVER_IP/orangehrm
Example:
http://102.202.44.172/orangehrm
Step 13 - Start the OrangeHRM Setup Wizard
The OrangeHRM Setup Wizard will appear.
- Select Fresh Installation.
- Click Next.
Step 14 - Configure the Database
Enter the following information:
| Field | Value |
|---|---|
| Database Host Name | localhost |
| Database Host Port | 3306 |
| Database Name | orangehrm |
| Database Type | MySQL |
| Use the same Database User for OrangeHRM | Yes |
| Database Username | orangeuser |
| Database Password | OrangePass123! |
Important:
If the installer displays "Database Already Exists", select:
- Existing Empty Database
Then continue with the installation.
Step 15 - Create the Administrator Account
Create the administrator account that will be used to log in to OrangeHRM.
Example:
| Field | Example |
|---|---|
| First Name | Admin |
| Last Name | User |
| Username | admin |
| Password | Create a secure password |
Step 16 - Complete the Installation
Click the Install button.
OrangeHRM will create the required database tables and complete the installation.
Step 17 - Log In
Use the administrator username and password you created during the installation.
Troubleshooting
Check Apache Status
sudo systemctl status apache2
Restart Apache
sudo systemctl restart apache2
Check MySQL Status
sudo systemctl status mysql
Restart MySQL
sudo systemctl restart mysql
Verify Port 80
sudo ss -tulpn | grep :80
Find the Server IP Address
hostname -I
Conclusion
You have successfully installed OrangeHRM 5.8.1 on Ubuntu 24.04 using an Ansible playbook. The playbook automated the installation of Apache, MySQL, PHP, OrangeHRM, database creation, user configuration, file permissions, firewall configuration, and web server setup. The remaining steps are completed through the OrangeHRM web-based installation wizard.

