Version 8
A no-console Python .pyw GUI for starting/stopping a Forge (Java) Minecraft server on Windows.
It uses Forge’s official arg files (@user_jvm_args.txt and @...\win_args.txt), shows live logs,
lets you send server commands, manage the whitelist, view online players, and integrates with backups
and Windows Task Scheduler.
This repo archives the manager script so it’s easy to move to a new PC.
It does not include the Forge server files themselves.
- One-click start/stop (or auto-start on launch).
- Command box (send any server command).
- Whitelist tools: add/remove and view current list.
- Online players panel (auto-refresh every 30 s; manual refresh button).
- Backup button (runs
backup.bat; refuses if the server is running). - Watches
stop.flag(handy for Task Scheduler shutdowns). - Optional splash image (PNG/ICO) and player join/leave log.
- Runs as .pyw → no black console window.
- Stable filename:
minecraft_server_manager.pyw(version noted in header comment).
- Windows 10/11
- Java (JDK 17+; tested with JDK 21). Update
JAVA_PATHin the script. - A Forge server folder created with “Install server” (this produces
libraries\...\forge\...\win_args.txt).
Optional:
- Tailscale (or similar) if you’re letting friends connect privately.
- Pillow only if you want to generate a
.icofrom the PNG for a desktop shortcut icon.
-
Place the manager in your server root, e.g.
C:\Users\<you>\Minecraft\IceAndFireServer\alongside
user_jvm_args.txt,libraries\,mods\, etc. -
Open
minecraft_server_manager.pywin a text editor and adjust:JAVA_PATH = r"C:\Program Files\Java\jdk-21\bin\java.exe" XMS = "2G" # initial heap XMX = "10G" # max heap
Optional splash image at:
assets\IceFireYinYangTransparent.png -
Run it:
- Double-click the
.pyw, or - Shortcut target:
%SystemRoot%\pyw.exe "C:\...\minecraft_server_manager.pyw"
The GUI opens and (by default) auto-starts the server.
- Double-click the
If you see “Forge win_args.txt not found”, run the Forge installer with Install server pointed at this folder.
- Start / Stop – Launch/quit the server (clean stop).
- Save All – Flush world to disk.
- Backup – Runs
backup.bat(refuses while server is running). - Make stop.flag – Creates a
stop.flag; the app detects it and issuesstop(great for Task Scheduler). - Exit –
save-all→ clean stop → small delay → closes GUI. - Whitelist – Add/remove players and view the list (remove works offline by editing
whitelist.jsonif needed). - Online Players – Shows who’s on; auto-refreshes every 30 s; Refresh sends
liston demand. - Command – Send any server command (e.g.,
whitelist on,op <name>,gamerule keepInventory true).
- Add your own
backup.batin the server root. - The Backup button streams script output into the GUI log.
- The app refuses to run backup while the server is running (to avoid corrupt snapshots).
Example backup.bat (sample – adjust paths):
@echo off
set SRC=%CD%
set DST=D:\Backups\MinecraftBackups
if not exist "%DST%" mkdir "%DST%"
set TS=%DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%_%TIME:~0,2%-%TIME:~3,2%
set TS=%TS: =0%
powershell -NoProfile -Command "Compress-Archive -Path '%SRC%\world' -DestinationPath '%DST%\world_%TS%.zip' -Force"
echo Done.Windows_task_creator.ps1 builds the Windows Task Scheduler entries for you. Edit the times at the top of the script and run it from an elevated PowerShell prompt to register start tasks (launch minecraft_server_manager.pyw) and stop tasks (run StopServer-And-Hibernate.ps1).
Typical plan:
- Start tasks (wake PC) → run the GUI; auto-start kicks in.
- Stop tasks → drop
stop.flag, wait for a clean exit, hibernate or shutdown.
Make sure Power Options → Allow wake timers is enabled.
If StopServer-And-Hibernate.ps1 is blocked by antivirus, add it as an exception. Bitdefender steps:
- Open Bitdefender.
- Go to Protection → Antivirus → Settings.
- In Exceptions, click Add exception.
- Browse to
StopServer-And-Hibernate.ps1and add it, keeping both On-access and On-demand scanning enabled. - Save. The script runs normally afterwards.
Alternatively, you could use the optional StopServer-And-Hibernate.bat which has similar function to StopServer-And-Hibernate.ps1 using cmd rather than powershell.
Windows_task_creator.ps1– registers start/stop tasks in Windows Task Scheduler based on configurable times.StopServer-And-Hibernate.ps1– dropsstop.flag, waits for exit, then hibernates (add to AV exceptions if flagged).make_icon.py– turnsassets\IceFireYinYangTransparent.png→assets\IceFireYinYang.ico(requires Pillow).create_shortcut.ps1– creates a desktop shortcut that points to the.pywand assigns the icon.
MinecraftServerManager/
├─ minecraft_server_manager.pyw
├─ StopServer-And-Hibernate.ps1
├─ make_icon.py # optional
├─ create_shortcut.ps1 # optional
├─ README.md
├─ .gitignore
├─ CHANGELOG.md
└─ assets/
└─ IceFireYinYangTransparent.png # optional splash/icon
Do not commit your actual server (
world/,libraries/,mods/,whitelist.json, etc.). Those are large and/or private.
- Java not found – Update
JAVA_PATH. - Forge args missing – Re-run Forge Installer → Install server into this folder.
- Firewall – If using a 3rd-party firewall, allow Java for local LAN; for Tailscale, no inbound port-forwarding is needed.
- Backup fails – Stop the server first (the app enforces this on the Backup button).
MIT License (see LICENSE in this repo).