Skip to content

How to Deploy Humant HRMS on a Windows Server

  • by

This guide explains how to install Humant HRMS on Windows Server 2019 or Windows Server 2022 using Node.js, Java, PostgreSQL, and Git.

Prerequisites

Before installing Humant HRMS, install:

  • Node.js 16.x LTS
  • Java JDK 11
  • PostgreSQL 12 or newer
  • Git

Verify the installations in PowerShell:

node -v
npm -v
java -version
psql --version

Step 1 — Upload Humant HRMS

Copy the complete Humant HRMS project to the server.

For example:

C:\humant\

You can use RDP file transfer, WinSCP, or a network share.

Using robocopy:

robocopy "C:\local\humant" "\\SERVER\C$\humant" /E /XD node_modules .git

Step 2 — Create the Humant HRMS Database

Set the PostgreSQL password if required:

$env:PGPASSWORD = "postgres"

Create the database:

psql -U postgres -c "CREATE DATABASE humant;"

Create the database user:

psql -U postgres -c "CREATE USER humantuser WITH PASSWORD 'your_strong_password';"

Grant privileges:

psql -U postgres -c "GRANT ALL PRIVILEGES ON DATABASE humant TO humantuser;"

Step 3 — Configure the Humant HRMS Environment

Set the database environment variables at the machine level:

[System.Environment]::SetEnvironmentVariable(
  "HUMANT_DATASOURCE_URL",
  "jdbc:postgresql://localhost:5432/humant",
  "Machine"
)

[System.Environment]::SetEnvironmentVariable(
  "HUMANT_DATASOURCE_USERNAME",
  "humantuser",
  "Machine"
)

[System.Environment]::SetEnvironmentVariable(
  "HUMANT_DATASOURCE_PASSWORD",
  "your_strong_password",
  "Machine"
)

[System.Environment]::SetEnvironmentVariable(
  "HUMANT_DATASOURCE_DRIVER",
  "org.postgresql.Driver",
  "Machine"
)

[System.Environment]::SetEnvironmentVariable(
  "HUMANT_JPA_DIALECT",
  "org.hibernate.dialect.PostgreSQLDialect",
  "Machine"
)

Restart the relevant services or open a new PowerShell session so the environment variables become available.

Step 4 — Install Humant HRMS Dependencies

Navigate to the Humant HRMS project:

Set-Location C:\humant

Install the frontend dependencies:

npm install --legacy-peer-deps

Step 5 — Build the Humant HRMS Frontend

Build the Angular application:

npm run build -- --prod

The production Humant HRMS files will be generated in the dist directory.

Step 6 — Start the Humant HRMS Backend

Open the backend directory:

Push-Location C:\humant\backend

Start Spring Boot:

.\mvnw.cmd spring-boot:run

The Humant HRMS backend runs on port 8080.

For a persistent Windows deployment, you can use NSSM to run the backend as a Windows service.

Install the service:

nssm install HumantBackend "C:\humant\backend\mvnw.cmd" "spring-boot:run"

Set the application directory:

nssm set HumantBackend AppDirectory "C:\humant\backend"

Start the service:

nssm start HumantBackend

Step 7 — Start the Humant HRMS Frontend

For a simple deployment, start the Angular frontend:

Set-Location C:\humant
npm run serve -- --port 4201 --host 0.0.0.0

The Humant HRMS frontend will be available on port 4201.

For a production installation, you can instead serve the compiled dist directory through IIS.

Step 8 — Configure IIS for Humant HRMS

For production, point IIS to:

C:\humant\dist\

Configure URL Rewrite so that Angular routes are redirected to:

index.html

This allows direct navigation to Humant HRMS application routes without returning a 404 error.

Step 9 — Configure Windows Firewall

Allow the backend port:

New-NetFirewallRule -DisplayName "Humant Backend" `
  -Direction Inbound `
  -Protocol TCP `
  -LocalPort 8080 `
  -Action Allow

Allow the frontend port:

New-NetFirewallRule -DisplayName "Humant Frontend" `
  -Direction Inbound `
  -Protocol TCP `
  -LocalPort 4201 `
  -Action Allow

If IIS is used for production, allow the standard HTTP and HTTPS ports instead.

Step 10 — Access Humant HRMS

For the Angular frontend server, open:

http://your-server-ip:4201

The Humant HRMS backend Swagger interface is available at:

http://your-server-ip:8080/swagger-ui.html

Use the administrator credentials configured by your Humant HRMS database seed process to log in.