Installation Guide
This guide covers the complete installation process for deploying jshERP on your own infrastructure. Follow these instructions to set up a production-ready jshERP instance.
System Requirements
Before beginning installation, ensure your system meets these requirements:
Hardware Requirements
Minimum Specifications:
CPU: 2 cores
RAM: 4 GB
Storage: 20 GB available space
Network: Stable internet connection
Recommended Specifications:
CPU: 4+ cores
RAM: 8+ GB
Storage: 50+ GB SSD
Network: 10 Mbps+ bandwidth
Software Requirements
Java Runtime JRE 1.8 or higher
Database MySQL 8.0.24 or higher
Cache Server Redis 6.2.1 or higher
Web Server Nginx 1.12.2 or higher (optional but recommended)
Supported Operating Systems
Linux (Ubuntu 20.04+, CentOS 7+, Debian 10+)
Windows Server 2016+
macOS 10.14+ (for development)
For production deployments, Linux is strongly recommended for better performance and stability.
Development Environment Setup
If you’re planning to develop or build jshERP from source:
IDE : IntelliJ IDEA 2025.1.4.1 or later
JDK : Java Development Kit 1.8
Maven : Maven 3.3.9 or higher
Node.js : Node 20.17.0 or higher
Database : MySQL 8.0.24
Redis : Redis 6.2.1
Nginx : Nginx 1.12.2
Installation Methods
Choose the installation method that best fits your needs:
Fastest way to deploy - use pre-compiled binaries.
Containerized deployment for easy management.
Compile from source code for customization.
Method 1: Pre-built Package Installation
This is the recommended method for most users.
Step 1: Install Prerequisites
Install Java 8
On Ubuntu/Debian: sudo apt update
sudo apt install openjdk-8-jre-headless
java -version
On CentOS/RHEL: sudo yum install java-1.8.0-openjdk
java -version
On Windows:
Download and install JRE 8 from the Oracle website or AdoptOpenJDK.
Install MySQL 8
On Ubuntu/Debian: sudo apt install mysql-server-8.0
sudo systemctl start mysql
sudo systemctl enable mysql
On CentOS/RHEL: sudo yum install mysql-server
sudo systemctl start mysqld
sudo systemctl enable mysqld
Secure your MySQL installation: sudo mysql_secure_installation
Install Redis
On Ubuntu/Debian: sudo apt install redis-server
sudo systemctl start redis
sudo systemctl enable redis
On CentOS/RHEL: sudo yum install redis
sudo systemctl start redis
sudo systemctl enable redis
Set a Redis password: sudo nano /etc/redis/redis.conf
Find and uncomment the line: Restart Redis: sudo systemctl restart redis
Install Nginx (Optional)
On Ubuntu/Debian: sudo apt install nginx
sudo systemctl start nginx
sudo systemctl enable nginx
On CentOS/RHEL: sudo yum install nginx
sudo systemctl start nginx
sudo systemctl enable nginx
Step 2: Create Database
Connect to MySQL
Enter your MySQL root password when prompted.
Create Database and User
CREATE DATABASE jsh_erp DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER ' jsh_user '@ 'localhost' IDENTIFIED BY 'your_secure_password' ;
GRANT ALL PRIVILEGES ON jsh_erp. * TO 'jsh_user' @ 'localhost' ;
FLUSH PRIVILEGES;
EXIT;
Import Database Schema
Download the SQL schema file and import it: mysql -u jsh_user -p jsh_erp < jsh_erp.sql
The schema file is located in the source code at: jshERP-boot/docs/jsh_erp.sql
Replace your_secure_password with a strong password. Store it securely as you’ll need it for application configuration.
Step 3: Download and Extract jshERP
Download Package
Download the pre-built package from:
Extract Package
# Create installation directory
sudo mkdir -p /opt/jshERP
# Extract package
sudo unzip jshERP-package.zip -d /opt/jshERP
# Set permissions
sudo chown -R $USER : $USER /opt/jshERP
Create Upload Directory
sudo mkdir -p /opt/jshERP/upload
sudo mkdir -p /opt/tmp/tomcat
sudo chown -R $USER : $USER /opt/jshERP/upload
sudo chown -R $USER : $USER /opt/tmp/tomcat
Edit Configuration File
Navigate to the configuration file: cd /opt/jshERP
nano application.properties
Update Database Settings
Modify the following settings in application.properties: # Server Port
server.port =9999
# Session Timeout (seconds)
server.servlet.session.timeout =36000
# Context Path
server.servlet.context-path =/jshERP-boot
# Database Configuration
spring.datasource.url =jdbc:mysql://127.0.0.1:3306/jsh_erp? useUnicode =true& characterEncoding =utf8& useCursorFetch =true& defaultFetchSize =500& allowMultiQueries =true& rewriteBatchedStatements =true& useSSL =false
spring.datasource.driverClassName =com.mysql.cj.jdbc.Driver
spring.datasource.username =jsh_user
spring.datasource.password =your_secure_password
# Redis Configuration
spring.redis.host =127.0.0.1
spring.redis.port =6379
spring.redis.password =1234abcd
# File Upload Configuration
file.uploadType =1
file.path =/opt/jshERP/upload
server.tomcat.basedir =/opt/tmp/tomcat
# File Size Limits (10MB)
spring.servlet.multipart.max-file-size =10485760
spring.servlet.multipart.max-request-size =10485760
# Tenant Configuration
manage.roleId =10
tenant.userNumLimit =1000000
tenant.tryDayLimit =3000
# Plugin Configuration
plugin.runMode =prod
plugin.pluginPath =plugins
plugin.pluginConfigFilePath =pluginConfig
Save Configuration
Save the file and exit the editor (Ctrl+O, Enter, Ctrl+X in nano).
Security Important :
Change all default passwords
Use strong database passwords
Enable firewall rules to restrict access
Consider using SSL/TLS for database connections in production
Step 5: Start the Application
Start Backend Service
cd /opt/jshERP
java -jar jshERP.jar
For production, run as a background service: nohup java -jar jshERP.jar > /opt/jshERP/logs/app.log 2>&1 &
Verify Backend is Running
Check if the service is running: curl http://localhost:9999/jshERP-boot
Or check the logs: tail -f /opt/jshERP/logs/app.log
Deploy Frontend
If you have the frontend build: # Copy frontend files to web server directory
sudo cp -r jshERP-web/dist/ * /var/www/html/jshERP/
Set up Nginx as a reverse proxy for better performance:
Create Nginx Configuration
sudo nano /etc/nginx/sites-available/jsherp
Add Configuration
server {
listen 80 ;
server_name your-domain.com; # Replace with your domain
# Frontend
location / {
root /var/www/html/jshERP;
index index.html;
try_files $ uri $ uri / /index.html;
}
# Backend API
location /jshERP-boot {
proxy_pass http://localhost:9999;
proxy_set_header Host $ host ;
proxy_set_header X-Real-IP $ remote_addr ;
proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for ;
proxy_set_header X-Forwarded-Proto $ scheme ;
# WebSocket support
proxy_http_version 1.1 ;
proxy_set_header Upgrade $ http_upgrade ;
proxy_set_header Connection "upgrade" ;
# Timeouts
proxy_connect_timeout 600 ;
proxy_send_timeout 600 ;
proxy_read_timeout 600 ;
send_timeout 600 ;
}
# Static files and uploads
location /jshERP-boot/upload {
alias /opt/jshERP/upload;
}
# File upload size limit
client_max_body_size 10M ;
}
Enable Site and Restart Nginx
sudo ln -s /etc/nginx/sites-available/jsherp /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
For production deployments, configure SSL/TLS using Let’s Encrypt or your SSL certificate.
Step 7: Access jshERP
Your jshERP installation is now ready!
Or if accessing directly:
http://your-server-ip:9999/jshERP-boot
Default Login Credentials:
Tenant: jsh
Username: admin
Password: 123456
IMPORTANT : Change the default password immediately after first login!
Method 2: Docker Deployment
Deploy jshERP using Docker containers for easier management.
Prerequisites
Install Docker and Docker Compose:
# Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
# Install Docker Compose
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$( uname -s )-$( uname -m )" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
Create Docker Compose Configuration
Create Project Directory
mkdir -p ~/jshERP-docker
cd ~/jshERP-docker
Create docker-compose.yml
version : '3.8'
services :
mysql :
image : mysql:8.0.24
container_name : jsherp-mysql
environment :
MYSQL_ROOT_PASSWORD : rootpassword
MYSQL_DATABASE : jsh_erp
MYSQL_USER : jsh_user
MYSQL_PASSWORD : jsh_password
volumes :
- mysql-data:/var/lib/mysql
- ./jsh_erp.sql:/docker-entrypoint-initdb.d/jsh_erp.sql
ports :
- "3306:3306"
networks :
- jsherp-network
command : --default-authentication-plugin=mysql_native_password
redis :
image : redis:6.2.1-alpine
container_name : jsherp-redis
command : redis-server --requirepass 1234abcd
ports :
- "6379:6379"
volumes :
- redis-data:/data
networks :
- jsherp-network
jsherp-backend :
image : openjdk:8-jre-alpine
container_name : jsherp-backend
volumes :
- ./jshERP.jar:/app/jshERP.jar
- ./application.properties:/app/application.properties
- jsherp-upload:/opt/jshERP/upload
working_dir : /app
command : java -jar jshERP.jar
ports :
- "9999:9999"
depends_on :
- mysql
- redis
networks :
- jsherp-network
environment :
- JAVA_OPTS=-Xmx2g -Xms512m
nginx :
image : nginx:1.21-alpine
container_name : jsherp-nginx
ports :
- "80:80"
- "443:443"
volumes :
- ./nginx.conf:/etc/nginx/conf.d/default.conf
- ./frontend:/usr/share/nginx/html
depends_on :
- jsherp-backend
networks :
- jsherp-network
networks :
jsherp-network :
driver : bridge
volumes :
mysql-data :
redis-data :
jsherp-upload :
Place Required Files
Place these files in the ~/jshERP-docker directory:
jshERP.jar - Backend JAR file
application.properties - Configuration file (update database hosts to service names)
jsh_erp.sql - Database schema
frontend/ - Frontend build files
Update application.properties for Docker
spring.datasource.url =jdbc:mysql://mysql:3306/jsh_erp? useUnicode =true& characterEncoding =utf8& useCursorFetch =true& defaultFetchSize =500& allowMultiQueries =true& rewriteBatchedStatements =true& useSSL =false
spring.datasource.username =jsh_user
spring.datasource.password =jsh_password
spring.redis.host =redis
spring.redis.port =6379
spring.redis.password =1234abcd
Start Containers
Check status: View logs: docker-compose logs -f jsherp-backend
Docker Management Commands
# Stop all containers
docker-compose down
# Restart specific service
docker-compose restart jsherp-backend
# View logs
docker-compose logs -f
# Execute command in container
docker-compose exec jsherp-backend sh
# Update and restart
docker-compose pull
docker-compose up -d
Method 3: Build from Source
Build jshERP from source code for customization or the latest features.
Clone Repository
git clone https://gitee.com/jishenghua/jshERP.git
cd jshERP
Build Backend
Navigate to Backend Directory
Update Configuration
Edit src/main/resources/application.properties with your database and Redis settings.
Build with Maven
mvn clean package -DskipTests
The compiled JAR will be in:
Build Frontend
Navigate to Frontend Directory
Build for Production
The build output will be in:
Deploy Built Files
Follow the same deployment steps as Method 1, using your built jshERP.jar and dist/ files.
Post-Installation
Create Systemd Service (Linux)
Create a systemd service for automatic startup:
sudo nano /etc/systemd/system/jsherp.service
Add the following content:
[Unit]
Description =jshERP Application
After =mysql.service redis.service
[Service]
Type =simple
User =jsherp
WorkingDirectory =/opt/jshERP
ExecStart =/usr/bin/java -Xmx2g -Xms512m -jar /opt/jshERP/jshERP.jar
Restart =on-failure
RestartSec =10
[Install]
WantedBy =multi-user.target
Enable and start the service:
sudo systemctl daemon-reload
sudo systemctl enable jsherp
sudo systemctl start jsherp
sudo systemctl status jsherp
Firewall Configuration
Configure firewall to allow necessary ports:
# UFW (Ubuntu/Debian)
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw allow 9999/tcp
sudo ufw enable
# Firewalld (CentOS/RHEL)
sudo firewall-cmd --permanent --add-port=80/tcp
sudo firewall-cmd --permanent --add-port=443/tcp
sudo firewall-cmd --permanent --add-port=9999/tcp
sudo firewall-cmd --reload
Backup Configuration
Set up automated database backups:
#!/bin/bash
# Save as /opt/jshERP/backup.sh
BACKUP_DIR = "/opt/jshERP/backups"
DATE = $( date +%Y%m%d_%H%M%S )
mkdir -p $BACKUP_DIR
# Database backup
mysqldump -u jsh_user -p 'your_password' jsh_erp > $BACKUP_DIR /jsh_erp_ $DATE .sql
# Compress
gzip $BACKUP_DIR /jsh_erp_ $DATE .sql
# Keep only last 30 days
find $BACKUP_DIR -name "*.sql.gz" -mtime +30 -delete
Add to crontab for daily backups:
Add:
0 2 * * * /opt/jshERP/backup.sh
Troubleshooting
Check logs: tail -f /opt/jshERP/logs/app.log
Common issues:
Database connection failed: Verify MySQL is running and credentials are correct
Port already in use: Check if another application is using port 9999
Redis connection failed: Verify Redis is running and password is correct
Insufficient memory: Increase JVM memory with -Xmx parameter
Cannot connect to database
Verify MySQL is running: sudo systemctl status mysql
Test connection: mysql -u jsh_user -p -h localhost jsh_erp
Check firewall: Verify user permissions: SHOW GRANTS FOR 'jsh_user' @ 'localhost' ;
Frontend shows 404 or blank page
Verify frontend files are in the correct directory
Check Nginx configuration and restart Nginx
Clear browser cache
Check browser console for JavaScript errors
Verify API endpoint in frontend configuration
Check upload directory permissions:
ls -la /opt/jshERP/upload
Verify directory exists and is writable
Check file size limits in application.properties and Nginx
Review application logs for errors
Security Hardening
For production deployments:
Change All Default Passwords
Application admin password
Database passwords
Redis password
Enable HTTPS
Use Let’s Encrypt for free SSL certificates: sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d your-domain.com
Restrict Database Access
Only allow localhost connections or specific IPs in MySQL configuration.
Enable Firewall
Only open necessary ports and restrict access by IP when possible.
Regular Updates
Keep all software components updated with security patches.
Configure Backups
Set up automated database and file backups to a secure location.
JVM Optimization
java -Xmx4g -Xms1g -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -jar jshERP.jar
MySQL Optimization
Edit /etc/mysql/mysql.conf.d/mysqld.cnf:
[mysqld]
innodb_buffer_pool_size = 2G
innodb_log_file_size = 512M
max_connections = 500
query_cache_size = 0
query_cache_type = 0
Redis Optimization
Edit /etc/redis/redis.conf:
maxmemory 1gb
maxmemory-policy allkeys-lru
Getting Help
If you encounter issues during installation:
For the latest installation instructions and updates, always check the official documentation at www.gyjerp.com .
Next Steps
After successful installation:
Follow the Quick Start Guide to configure your system
Review the Features Overview to understand capabilities
Explore the user manual for detailed operational procedures
Set up regular backups and monitoring
Congratulations! Your jshERP installation is complete.