This documentation is applicable only for IceHrm Open Source.
Installing IceHrm on Linux
This guide walks you through installing IceHrm on a Linux server with Nginx, MySQL, and PHP.
Server Selection
When choosing a server for IceHrm, consider the following recommendations:
Cloud Providers
- DigitalOcean - Affordable droplets starting at $5/month
- AWS EC2 - Scalable instances with pay-as-you-go pricing
- Linode - Developer-friendly with good documentation
- Vultr - High-performance SSD servers
Recommended Server Specs
For most small to medium businesses:
- OS: Ubuntu 22.04 LTS (recommended)
- CPU: 2 vCPU
- RAM: 2 GB
- Storage: 50 GB SSD
Installing PHP 8.1
Install PHP 8.1 with all required extensions:
# Update package list
sudo apt update
# Install software-properties-common if not present
sudo apt install -y software-properties-common
# Add PHP repository
sudo add-apt-repository ppa:ondrej/php
sudo apt update
# Install PHP 8.1 and required extensions
sudo apt install -y php8.1 php8.1-fpm php8.1-mysql php8.1-gd php8.1-xml \
php8.1-mbstring php8.1-curl php8.1-zip php8.1-intl php8.1-bcmath
Verify PHP Installation
php -v
Expected output:
PHP 8.1.x (cli) (built: ...)
Configure PHP-FPM
Edit the PHP-FPM configuration for optimal performance:
sudo nano /etc/php/8.1/fpm/php.ini
Update the following settings:
upload_max_filesize = 64M
post_max_size = 64M
memory_limit = 256M
max_execution_time = 300
date.timezone = UTC
Restart PHP-FPM:
sudo systemctl restart php8.1-fpm
MySQL Setup
Install MySQL
# Install MySQL Server
sudo apt install -y mysql-server
# Start MySQL service
sudo systemctl start mysql
sudo systemctl enable mysql
Secure MySQL Installation
Run the security script to set up root password and remove insecure defaults:
sudo mysql_secure_installation
Follow the prompts to:
- Set a root password
- Remove anonymous users
- Disallow root login remotely
- Remove test database
- Reload privilege tables
Create Database and User
Connect to MySQL:
sudo mysql -u root -p
Execute the following SQL commands to create the IceHrm database and user:
-- Create the database
CREATE DATABASE icehrm CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- Create a dedicated user
CREATE USER 'icehrm_user'@'localhost' IDENTIFIED BY 'your_secure_password';
-- Grant privileges
GRANT ALL PRIVILEGES ON icehrm.* TO 'icehrm_user'@'localhost';
-- Apply changes
FLUSH PRIVILEGES;
-- Exit MySQL
EXIT;
Replace your_secure_password with a strong, unique password.
Nginx Configuration
Install Nginx
sudo apt install -y nginx
sudo systemctl start nginx
sudo systemctl enable nginx
Create Server Block
Create a new Nginx configuration file for IceHrm:
sudo nano /etc/nginx/sites-available/icehrm
Add the following server block configuration:
server {
listen 80;
server_name your-domain.com;
root /var/www/icehrm;
index index.php index.html;
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
# Logging
access_log /var/log/nginx/icehrm_access.log;
error_log /var/log/nginx/icehrm_error.log;
# Main location block
location / {
try_files $uri $uri/ /index.php?$query_string;
}
# PHP processing
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_read_timeout 300;
}
# Deny access to sensitive files
location ~ /\. {
deny all;
}
location ~ ^/(app|src|vendor)/ {
deny all;
}
# Cache static assets
location ~* \.(jpg|jpeg|png|gif|ico|css|js|pdf|woff|woff2)$ {
expires 30d;
add_header Cache-Control "public, immutable";
}
}
Enable the Site
# Create symbolic link
sudo ln -s /etc/nginx/sites-available/icehrm /etc/nginx/sites-enabled/
# Test configuration
sudo nginx -t
# Reload Nginx
sudo systemctl reload nginx
Download IceHrm
Open Source Version
Download the latest open source release:
# Navigate to web directory
cd /var/www
# Download latest release
wget https://github.com/gamonoid/icehrm/releases/latest/download/icehrm.zip
# Install unzip if needed
sudo apt install -y unzip
# Extract the archive
unzip icehrm.zip
# Rename to icehrm (if extracted folder has different name)
mv icehrm-* icehrm
# Set permissions
sudo chown -R www-data:www-data /var/www/icehrm
sudo chmod -R 755 /var/www/icehrm
IceHrm Pro Version
If you have purchased IceHrm Pro:
- Log in to your IceHrm account at https://icehrm.com
- Navigate to your downloads section
- Download the Pro package
- Upload to your server via SFTP or SCP
# Extract Pro version
cd /var/www
unzip icehrm-pro-*.zip
mv icehrm-pro-* icehrm
# Set permissions
sudo chown -R www-data:www-data /var/www/icehrm
sudo chmod -R 755 /var/www/icehrm
Web-Based Installer
Once all components are configured, complete the installation through the web interface:
-
Open your browser and navigate to your domain:
http://your-domain.com -
Welcome Screen - The installer will check system requirements
-
Database Configuration - Enter your database details:
- Database Host:
localhost - Database Name:
icehrm - Database User:
icehrm_user - Database Password:
your_secure_password
- Database Host:
-
Admin Account - Create the administrator account:
- Admin Username
- Admin Email
- Admin Password
-
Complete Installation - Click "Install" to finish
-
Login - Access IceHrm with your admin credentials
After installation, delete or rename the install directory for security:
sudo rm -rf /var/www/icehrm/app/install
Post-Installation
After completing the installation:
- Configure cron jobs for scheduled tasks
- Set up WKHTMLTOPDF for PDF generation
- Configure email settings in System > Settings
- Set your company information in Admin > Company
- Configure Azure AD SSO if needed