Windows 10 / 11 / Server
This guide walks you through deploying MyEMS on Windows 10, Windows 11, and Windows Server.
Prerequisites
This guide describes how to install MyEMS on Windows 10, Windows 11, and Windows Server 2022. Hardware requirements depend on the selected database and the number of devices connected to the system. To run MyEMS, MySQL, and any one of Python 3.10, 3.11, or 3.12 on a single computer, at least 8GB of RAM is required.
Clone the source code:
Run Windows PowerShell as Administrator
cd C:\
git clone https://gitee.com/myems/myems
Install Python 3.10:
https://www.python.org/downloads/windows/
Python 3.10.11 installer, 64-bit for 64-bit systems
Download Windows installer (64-bit)
Run the Python installer
Double-click python-3.10.11-amd64.exe
Check "Add Python to PATH" and click Customize installation
Ensure all options are selected, especially pip, which is required for installing libraries later; click Next
Check the first option, change the Python installation path, then click Install
Note: Default path is C:\Program Files\Python310 – change to C:\Python310
Click Close when installation finishes
Type python in Command Prompt and press Enter; the Python version number indicates successful installation
Step 1 Database
Refer to Database
Below are detailed steps to download and install MySQL (Community Edition 8.0, free of charge).
1.1 Download MySQL Installer
- Open the official website: https://dev.mysql.com/downloads/mysql/
- Select the Windows platform. Two options are usually available:
- mysql-installer-web-community (online installer, small size)
- mysql-installer-community (offline full package, recommended)
- Click Download. Skip login if prompted (No thanks, just start my download)
1.2 Install MySQL
- Double-click the downloaded installer (administrator privileges may be required)
- Select setup type (Developer Default or Custom recommended)
- Developer Default: Installs MySQL Server, Workbench, Shell, and other common tools
- Custom: Allows component customization
- Click Next; the installer will automatically check dependencies and download missing components
- Click Execute to start installation. Click Next when finished
1.3 Configure MySQL Server
-
Type and Networking
- Config Type: Select Development Computer
- Port: Default 3306 (can remain unchanged)
- Click Next
-
Authentication Method
- Select Use Strong Password Encryption (new encryption standard)
- Or select the second option for legacy compatibility
- Click Next
-
Accounts and Roles
- Set the root password (save it securely)
- Optional: create a standard user (can be skipped)
- Click Next
-
Windows Service
- Check Configure MySQL Server as a Windows Service
- Service Name: MySQL80 (default)
- Check Start the MySQL Server at System Startup
- Click Next
-
Apply Configuration
- Click Execute to apply settings
- All steps showing green checkmarks mean success
- Click Finish
1.4 Complete Installation
- Continue clicking Next until Finish appears
- Check Start MySQL Workbench after Setup (optional)
- Click Finish to exit the wizard
1.5 Verify Installation
Method 1: Command line test
- Press
Win + R, typecmd, and press Enter - Enter:
mysql -u root -p - Enter your root password
- The
mysql>prompt confirms success
Method 2: Check Windows Services
- Press
Win + R, typeservices.msc - Locate
MySQL80; its status should be "Running"
1.6 Basic Initial Settings (Optional)
After logging into MySQL, run:
-- View databases
show databases;
-- Create a new database
create database mydb;
-- Create a user for remote access (optional)
create user 'myems'@'%' identified by 'password';
grant all privileges on *.* to 'myems'@'%';
flush privileges;
Common Issues
| Issue | Solution |
|---|---|
| Port 3306 occupied | Change to another port during installation (e.g., 3307) |
| Forgot root password | Restart MySQL with skip-grant-tables; advanced procedure |
| Service fails to start | Check port usage or view Windows Event Log |
Step 2 myems-api
Install the myems-api service:
# 1. Open a new CMD window as Administrator
# 2. Set environment variables
set PIP_NO_USER=1
set PYTHONNOUSERSITE=1
# 3. Navigate to project directory
cd C:\myems\myems-api
# 4. Reinstall all packages
C:\Python310\python.exe -m pip install --no-cache-dir --no-user -r requirements.txt
C:\Python310\python.exe -m pip install --no-cache-dir --no-user waitress
Create a .env file from example.env and edit it as needed:
copy .\example.env .env
Open and edit C:\myems\myems-api\.env with a text editor
Update database information
Install as a Windows Service (run CMD as Administrator):
# 1. Remove any existing old service
sc delete MyEMSAPI
# 2. Create log directory
mkdir C:\myems\myems-api\logs 2>nul
# 3. Download WinSW if not already installed
https://github.com/winsw/winsw/releases
Rename WinSW-x64.exe to MyEMSAPI.exe
cd C:\myems\myems-api
# 4. Create configuration file
Create `C:\myems\myems-api\MyEMSAPI.xml` using Notepad or the command below:
notepad C:\myems\myems-api\MyEMSAPI.xml
Paste the following content:
<service>
<id>MyEMSAPI</id>
<name>MyEMS API Service</name>
<description>MyEMS API Service</description>
<executable>C:\Python310\python.exe</executable>
<arguments>-m waitress --listen=0.0.0.0:8000 app:api</arguments>
<workingdirectory>C:\myems\myems-api</workingdirectory>
<logmode>rotate</logmode>
<logpath>C:\myems\myems-api\logs</logpath>
<onfailure action="restart" delay="10 sec"/>
<stoptimeout>15 sec</stoptimeout>
<startmode>Automatic</startmode>
</service>
Save and close Notepad.
# 5. Install service
MyEMSAPI.exe install
# 6. Start service
MyEMSAPI.exe start
# 7. Check status
MyEMSAPI.exe status
# 8. Test service
curl http://localhost:8000
# 9. Check logs if issues occur
C:\myems\myems-api\logs
Step 3 myems-admin
Install NGINX server: https://nginx.org/en/download.html
Start NGINX in the background:
start /b nginx.exe
Configure NGINX:
cd C:\Program Files\nginx-1.29.1\conf
Open and edit nginx.conf with a text editor
In the 'http' section, add the following directives:
http {
client_header_timeout 600;
client_max_body_size 512M;
gzip on;
gzip_min_length 512;
gzip_proxied any;
gzip_types *;
gzip_vary on;
proxy_buffering off;
...
}
Add the following server block. Replace http://127.0.0.1:8000/ with the actual address if myems-api runs on another server.
server {
listen 8001;
server_name myems-admin;
location / {
root C:\myems-admin;
index index.html index.htm;
}
## To avoid CORS issue, use Nginx to proxy myems-api to path /api
## Add another location /api in 'server'
## Replace default myems-api url http://127.0.0.1:8000/ with actual url if hosted on a different server
location /api {
proxy_pass http://127.0.0.1:8000/;
proxy_connect_timeout 75;
proxy_read_timeout 600;
send_timeout 600;
}
}
Install myems-admin: If the server has no internet access, compress the myems/myems-admin folder and upload it to the server, then extract it to c:\myems-admin.
Review and modify the configuration file if necessary:
c:\myems-admin\app\api.js
The "upload" folder stores user-uploaded files. Do NOT delete, move, or overwrite this folder when upgrading myems-admin.
C:\myems-admin\upload
Restart NGINX:
cd C:\Program Files\nginx-1.29.1
nginx.exe -s stop
start /b nginx.exe
Step 4 myems-modbus-tcp
In this step, you will install the myems-modbus-tcp service.
cd C:\myems\myems-modbus-tcp
# 1. Open a new CMD window as Administrator
# 2. Set environment variables
set PIP_NO_USER=1
set PYTHONNOUSERSITE=1
# 3. Navigate to project directory
cd C:\myems\myems-modbus-tcp
# 4. Reinstall all packages
C:\Python310\python.exe -m pip install --no-cache-dir --no-user -r requirements.txt
Create a .env file from example.env and edit it as needed:
copy .\example.env .env
Open and edit C:\myems\myems-modbus-tcp\.env with a text editor
Install as a Windows Service:
# 1. Remove any existing old service
sc delete MyEMSModbusTCP
# 2. Create log directory
mkdir C:\myems\myems-modbus-tcp\logs 2>nul
# 3. Download WinSW if not already installed
https://github.com/winsw/winsw/releases
Rename WinSW-x64.exe to MyEMSModbusTCP.exe
cd C:\myems\myems-modbus-tcp
# 4. Create configuration file
Create `C:\myems\myems-modbus-tcp\MyEMSModbusTCP.xml` using Notepad:
notepad C:\myems\myems-modbus-tcp\MyEMSModbusTCP.xml
Paste the following content:
<service>
<id>MyEMSModbusTCP</id>
<name>MyEMS Modbus TCP Service</name>
<description>MyEMS Modbus TCP Service</description>
<executable>C:\Python310\python.exe</executable>
<arguments>main.py</arguments>
<workingdirectory>C:\myems\myems-modbus-tcp</workingdirectory>
<logmode>rotate</logmode>
<logpath>C:\myems\myems-modbus-tcp\logs</logpath>
<onfailure action="restart" delay="10 sec"/>
<stoptimeout>15 sec</stoptimeout>
<startmode>Automatic</startmode>
</service>
Save and close Notepad.
# 5. Install service
MyEMSModbusTCP.exe install
# 6. Start service
MyEMSModbusTCP.exe start
# 7. Check status
MyEMSModbusTCP.exe status
# 8. Check logs if issues occur
C:\myems\myems-modbus-tcp\logs
If MyEMSModbusTCP.exe install and MyEMSModbusTCP.exe start succeed but status remains Stopped, Visual C++ Redistributable may be missing. VC++ download link: https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#visual-studio-2015-2017-2019-and-2022
Step 5 myems-cleaning
In this step, you will install the myems-cleaning service.
cd C:\myems\myems-cleaning
# 1. Open a new CMD window as Administrator
# 2. Set environment variables
set PIP_NO_USER=1
set PYTHONNOUSERSITE=1
# 3. Navigate to project directory
cd C:\myems\myems-cleaning
# 4. Reinstall all packages
C:\Python310\python.exe -m pip install --no-cache-dir --no-user -r requirements.txt
Create a .env file from example.env and edit it as needed:
copy C:\myems\myems-cleaning\example.env .env
Open and edit C:\myems\myems-cleaning\.env with a text editor
Install as a Windows Service:
# 1. Remove any existing old service
sc delete MyEMSCleaning
# 2. Create log directory
mkdir C:\myems\myems-cleaning\logs 2>nul
# 3. Download WinSW if not already installed
https://github.com/winsw/winsw/releases
Rename WinSW-x64.exe to MyEMSCleaning.exe
cd C:\myems\myems-cleaning
# 4. Create configuration file
Create `C:\myems\myems-cleaning\MyEMSCleaning.xml` using Notepad:
notepad C:\myems\myems-cleaning\MyEMSCleaning.xml
Paste the following content:
<service>
<id>MyEMSCleaning</id>
<name>MyEMS Cleaning Service</name>
<description>MyEMS Cleaning Service</description>
<executable>C:\Python310\python.exe</executable>
<arguments>main.py</arguments>
<workingdirectory>C:\myems\myems-cleaning</workingdirectory>
<logmode>rotate</logmode>
<logpath>C:\myems\myems-cleaning\logs</logpath>
<onfailure action="restart" delay="10 sec"/>
<stoptimeout>15 sec</stoptimeout>
<startmode>Automatic</startmode>
</service>
Save and close Notepad.
# 5. Install service
MyEMSCleaning.exe install
# 6. Start service
MyEMSCleaning.exe start
# 7. Check status
MyEMSCleaning.exe status
# 8. Check logs if issues occur
C:\myems\myems-cleaning\logs
Step 6 myems-normalization
In this step, you will install the myems-normalization service.
cd C:\myems\myems-normalization
# 1. Open a new CMD window as Administrator
# 2. Set environment variables
set PIP_NO_USER=1
set PYTHONNOUSERSITE=1
# 3. Navigate to project directory
cd C:\myems\myems-normalization
# 4. Reinstall all packages
C:\Python310\python.exe -m pip install --no-cache-dir --no-user -r requirements.txt
Create a .env file from example.env and edit it as needed:
copy C:\myems\myems-normalization\example.env .env
Open and edit C:\myems\myems-normalization\.env with a text editor
Install as a Windows Service:
# 1. Remove any existing old service
sc delete MyEMSNormalization
# 2. Create log directory
mkdir C:\myems\myems-normalization\logs 2>nul
# 3. Download WinSW if not already installed
https://github.com/winsw/winsw/releases
Rename WinSW-x64.exe to MyEMSNormalization.exe
cd C:\myems\myems-normalization
# 4. Create configuration file
Create `C:\myems\myems-normalization\MyEMSNormalization.xml` using Notepad:
notepad C:\myems\myems-normalization\MyEMSNormalization.xml
Paste the following content:
<service>
<id>MyEMSNormalization</id>
<name>MyEMS Normalization Service</name>
<description>MyEMS Normalization Service</description>
<executable>C:\Python310\python.exe</executable>
<arguments>main.py</arguments>
<workingdirectory>C:\myems\myems-normalization</workingdirectory>
<logmode>rotate</logmode>
<logpath>C:\myems\myems-normalization\logs</logpath>
<onfailure action="restart" delay="10 sec"/>
<stoptimeout>15 sec</stoptimeout>
<startmode>Automatic</startmode>
</service>
Save and close Notepad.
# 5. Install service
MyEMSNormalization.exe install
# 6. Start service
MyEMSNormalization.exe start
# 7. Check status
MyEMSNormalization.exe status
# 8. Check logs if issues occur
C:\myems\myems-normalization\logs
Step 7 myems-aggregation
In this step, you will install the myems-aggregation service.
cd C:\myems\myems-aggregation
# 1. Open a new CMD window as Administrator
# 2. Set environment variables
set PIP_NO_USER=1
set PYTHONNOUSERSITE=1
# 3. Navigate to project directory
cd C:\myems\myems-aggregation
# 4. Reinstall all packages
C:\Python310\python.exe -m pip install --no-cache-dir --no-user -r requirements.txt
Create a .env file from example.env and edit it as needed:
copy C:\myems\myems-aggregation\example.env .env
Open and edit C:\myems\myems-aggregation\.env with a text editor
Install as a Windows Service:
# 1. Remove any existing old service
sc delete MyEMSAggregation
# 2. Create log directory
mkdir C:\myems\myems-aggregation\logs 2>nul
# 3. Download WinSW if not already installed
https://github.com/winsw/winsw/releases
Rename WinSW-x64.exe to MyEMSAggregation.exe
cd C:\myems\myems-aggregation
# 4. Create configuration file
Create `C:\myems\myems-aggregation\MyEMSAggregation.xml` using Notepad:
notepad C:\myems\myems-aggregation\MyEMSAggregation.xml
Paste the following content:
<service>
<id>MyEMSAggregation</id>
<name>MyEMS Aggregation Service</name>
<description>MyEMS Aggregation Service</description>
<executable>C:\Python310\python.exe</executable>
<arguments>main.py</arguments>
<workingdirectory>C:\myems\myems-aggregation</workingdirectory>
<logmode>rotate</logmode>
<logpath>C:\myems\myems-aggregation\logs</logpath>
<onfailure action="restart" delay="10 sec"/>
<stoptimeout>15 sec</stoptimeout>
<startmode>Automatic</startmode>
</service>
Save and close Notepad.
# 5. Install service
MyEMSAggregation.exe install
# 6. Start service
MyEMSAggregation.exe start
# 7. Check status
MyEMSAggregation.exe status
# 8. Check logs if issues occur
C:\myems\myems-aggregation\logs
Step 8 myems-web
In this step, you will install the myems-web service.
Start NGINX:
start /b nginx.exe
Configure NGINX:
cd C:\Program Files\nginx-1.29.1\conf
Open and edit nginx.conf with a text editor
Add the following server block. Replace http://127.0.0.1:8000/ with the actual address if myems-api runs on another server.
server {
listen 80;
server_name myems-web;
location / {
root C:\myems-web\build;
index index.html index.htm;
# add try_files directive to avoid 404 error while refreshing pages
try_files $uri /index.html;
}
## To avoid CORS issue, use Nginx to proxy myems-api to path /api
## Add another location /api in 'server'
## Replace default myems-api url http://127.0.0.1:8000/ with actual url if hosted on a different server
location /api {
proxy_pass http://127.0.0.1:8000/;
proxy_connect_timeout 75;
proxy_read_timeout 600;
send_timeout 600;
}
}
Restart NGINX:
cd C:\Program Files\nginx-1.29.1
nginx.exe -s stop
start /b nginx.exe
Install MyEMS Web UI: Install Node.js: https://nodejs.org/ Version requirements:
- Node.js 22.22.2, 24.5.0 or later
- npm 10.9.7, 11.5.1 or later
Example path: C:\Program Files\nodejs
Configure environment variables
Modify configuration file:
cd C:\myems\myems-web
Open and edit src/config.js with a text editor
Build the project:
npm i
npm run build
A build directory will be created in C:\myems\myems-web
mkdir C:\myems-web
move "C:\myems\myems-web\build" "C:\myems-web"
If build fails with timeout error:
npm error code EIDLETIMEOUT
npm error Idle timeout reached for host `registry.npmjs.org:443`Switch to a Chinese npm mirror:
npm config set registry https://registry.npmmirror.com/
After Installation
Congratulations – you can now log in to the MyEMS Admin UI and Web UI.
Default Ports
MyEMS Web UI: 80 MyEMS API: 8000 MyEMS Admin UI: 8001
Assume server address is 192.168.1.8 (replace with your actual server IP) MyEMS Web UI: http://192.168.1.8 (port 80 can be omitted) MyEMS Admin UI: http://192.168.1.8:8001
Default Credentials
MyEMS Admin UI Username:
administrator
Password:
!MyEMS1
MyEMS Web UI Username:
administrator
Password:
!MyEMS1