OrangeHRM is an open-source human resource management (HRM) software that allows organizations of all sizes to manage their HR activities, such as employee records, payroll, benefits, and recruitment. In this tutorial, we will explain how to install OrangeHRM on the latest version of NixOS.
Before you begin, make sure you have the following prerequisites:
Before we begin, let's make sure our system is up-to-date by using the following command:
sudo nix-channel --update && sudo nixos-rebuild switch
We need to install some of the required dependencies first. Run the following command to install:
sudo nix-env -i bash httpd mariadb php phpMyAdmin phpExtensions.pdo_mysql sqlite zlib libmcrypt libpng libjpeg-turbo freetype fontconfig ghostscript cups
Next, we need to configure MariaDB, which is a relational database management system that OrangeHRM uses to store its data.
Run the following command to install MariaDB:
sudo nix-env -i mariadb
After installation, start MariaDB and enable it to start automatically at boot time:
sudo systemctl start mariadb
sudo systemctl enable mariadb
Now, we can secure our setup using the mysql_secure_installation
command.
sudo mysql_secure_installation
Answer the questions accordingly to secure MariaDB.
Create a new database and user for OrangeHRM. You can create the database and user with the following command. Replace password
with a strong password of your choice.
sudo mysql -u root -p
MariaDB [(none)]> CREATE DATABASE orangehrm;
MariaDB [(none)]> CREATE USER 'orangehrm_user'@'localhost' IDENTIFIED BY 'password';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON orangehrm.* TO 'orangehrm_user'@'localhost';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;
Download the latest stable release of OrangeHRM from the official website:
sudo wget https://github.com/orangehrm/orangehrm/archive/refs/tags/4.4.6.zip
Unzip the downloaded file and move the extracted OrangeHRM directory to the /var/www/
directory:
sudo unzip 4.4.6.zip
sudo mv orangehrm-4.4.6 /var/www/orangehrm
Now, change the ownership of the OrangeHRM directory to the Apache service user:
sudo chown -R apache:apache /var/www/orangehrm
Next, we need to configure the Apache web server to host OrangeHRM.
Create a new file named orangehrm.conf
in the /etc/httpd/conf/extra
directory:
sudo nano /etc/httpd/conf/extra/orangehrm.conf
Add the following contents to the file:
Alias /orangehrm /var/www/orangehrm
<Directory /var/www/orangehrm>
Require all granted
AllowOverride All
</Directory>
Save and close the file.
I Let's restart the Apache service:
sudo systemctl restart httpd
Finally, we can complete the OrangeHRM installation by opening a web browser and navigating to http://localhost/orangehrm
.
Follow the on-screen instructions to complete the installation by entering the database credentials and creating an admin account.
After the installation is complete, log in to the OrangeHRM dashboard using the admin credentials to start using the software.
Congratulations! You have successfully installed and configured OrangeHRM on NixOS. You can now use this software to manage your organization's HR activities.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!