Automated PowerShell script to download, configure, and run a PaperMC Minecraft server with Amazon Corretto OpenJDK on Windows.
- β Automatic download of Amazon Corretto OpenJDK
- β Automatic download of PaperMC server
- β Optimized JVM parameters (Aikar's Flags)
- β Configurable Minecraft and Java versions
- β Automatic EULA acceptance
- β Configurable memory allocation
- β Self-contained installation (all files in subdirectories)
- β Easy to use start script
- Windows 10/11 or Windows Server 2016+
- PowerShell 5.1 or later
- Internet connection for downloads
- ~2GB free disk space
-
Download the script
git clone "https://github.com/Cyclenerd/minecraft-windows.git" cd minecraft-windows
-
Run the setup script
.\setup-papermc.ps1 -
Server will start automatically!
.\setup-papermc.ps1 `
-JavaVersion "21" `
-MinecraftVersion "1.21.11" `
-MinMemoryMB 1024 `
-MaxMemoryMB 2048| Parameter | Description | Default |
|---|---|---|
JavaVersion |
Amazon Corretto Java major version | 21 |
MinecraftVersion |
Minecraft version | 1.21.11 |
MinMemoryMB |
Minimum memory allocation (MB) | 1024 |
MaxMemoryMB |
Maximum memory allocation (MB) | 2048 |
Run with 4GB RAM:
.\setup-papermc.ps1 -MinMemoryMB 2048 -MaxMemoryMB 4096Use a different Minecraft version:
.\setup-papermc.ps1 -MinecraftVersion "1.20.4"Use a specific Java version:
.\setup-papermc.ps1 -JavaVersion "17"Use a specific Java and Minecraft version:
.\setup-papermc.ps1 -JavaVersion "25" -MinecraftVersion "26.1.1"After running the script, the following structure is created:
minecraft-windows/
βββ server-icon.ico # Icon for the desktop shortcut
βββ server-icon.png # Server icon (automatically copied to server/)
βββ setup-papermc.ps1 # Primary installation and setup script
βββ start-server.cmd # Server launch script (generated after first run)
βββ Start Minecraft Server.lnk # Desktop shortcut (generated after first run)
βββ README.md # This README file
βββ java/ # Embedded Java runtime (Amazon Corretto OpenJDK)
β βββ bin/
β βββ java.exe
βββ server/ # Folder for Minecraft server files and data
βββ paper.jar
βββ eula.txt
βββ server.properties
βββ server-icon.png
βββ logs/
βββ plugins/
βββ world/
# Run the setup script
.\setup-papermc.ps1The script will:
- Remove existing
java/directory (if present) and create fresh directories - Download and extract Amazon Corretto Java
- Download the latest PaperMC server
- Accept the Minecraft EULA
- Create a default
server.propertiesfile (if not exists) - Create a
start-server.cmdscript - Create a shortcut with custom icon (if
server-icon.icoexists) - Start the server
Important:
- The
java/folder is always deleted and re-downloaded to ensure a clean installation - The
server/folder is preserved - your worlds, plugins, and configurations are safe
You can safely re-run setup-papermc.ps1 to:
- Update to a different Java version
- Update to a different Minecraft/PaperMC version
- Change memory allocation settings
Your existing server data (worlds, plugins, configurations) will be preserved.
Use the generated start script:
start-server.cmdOr double-click start-server.cmd in Windows Explorer.
Press Ctrl+C in the PowerShell window, or type stop in the server console.
Edit server/server.properties to configure:
- Server port (default: 25565)
- Game mode
- Difficulty
- Max players
- Message of the day (MOTD)
- And more...
More to read: https://docs.papermc.io/paper/reference/server-properties/
Visit: https://aws.amazon.com/corretto/
Available major versions:
- Java 25 (Latest):
25 - Java 21 (LTS, Recommended):
21 - Java 17 (LTS):
17 - Java 11 (LTS):
11 - Java 8:
8
The script automatically downloads the latest build of the specified major version.
Visit: https://papermc.io/downloads/paper
Check available versions and builds via API:
# Get builds for a specific version
$version = "1.21.11"
$builds = Invoke-RestMethod -Uri "https://fill.papermc.io/v3/projects/paper/versions/$version/builds"
# Get the latest stable build
$stableBuild = $builds | Where-Object { $_.channel -eq "STABLE" } | Select-Object -First 1
if ($stableBuild) {
Write-Host "Latest stable build: $($stableBuild.build)"
Write-Host "Download URL: $($stableBuild.downloads.'server:default'.url)"
}If you get the error "running scripts is disabled on this system", you have two options:
Option 1: Bypass for Single Execution (Recommended)
PowerShell -ExecutionPolicy Bypass -File .\setup-papermc.ps1Option 2: Unblock and Change Execution Policy
The script is not signed, so you need to unblock it first:
# Unblock the downloaded script
Unblock-File -Path .\setup-papermc.ps1
# Change execution policy (allows unblocked local scripts)
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserThen run the script normally.
- Check your internet connection
- Verify the Java and Minecraft versions are valid
- Check if antivirus is blocking downloads
- Verify Java is installed: Check
java/bin/java.exeexists - Check if port 25565 is already in use
- Review logs in
server/logs/latest.log - Increase memory allocation if server crashes
| Paper Version | Recommended Java Version |
|---|---|
| 1.7.10 to 1.11 | Java 8 |
| 1.12 to 1.16.4 | Java 11 |
| 1.16.5 | Java 16 |
| 1.17 to 1.19 | Java 17 |
| 1.20 to 1.21.1 | Java 21 |
| 26.1+ | Java 25 |
Examples:
# For Minecraft 1.20.4
.\setup-papermc.ps1 -MinecraftVersion "1.20.6" -JavaVersion "21"
# For Minecraft 1.19.4
.\setup-papermc.ps1 -MinecraftVersion "1.19.4" -JavaVersion "17"
# For Minecraft 1.16.5
.\setup-papermc.ps1 -MinecraftVersion "1.16.5" -JavaVersion "16"The script uses Aikar's Flags, a set of optimized JVM parameters designed specifically for Minecraft servers. These flags improve:
- Garbage collection efficiency
- Memory management
- Overall server performance and TPS (ticks per second)
Reference: https://docs.papermc.io/paper/aikars-flags
To allow external connections:
- Forward port 25565 (TCP/UDP) on your router
- Configure Windows Firewall:
New-NetFirewallRule -DisplayName "Minecraft Server" -Direction Inbound -Protocol TCP -LocalPort 25565 -Action Allow
PaperMC supports Bukkit, Spigot, and Paper plugins:
-
Find plugins at:
- https://hangar.papermc.io/ (Official PaperMC plugin repository)
- https://dev.bukkit.org/bukkit-plugins
- https://www.spigotmc.org/resources/
-
Download the plugin
.jarfile (make sure it's compatible with your Minecraft version) -
Install the plugin:
# Place the .jar file in the plugins directory Copy-Item -Path "path\to\plugin.jar" -Destination "server\plugins\"
Or simply drag and drop the
.jarfile into theserver\plugins\folder -
Restart the server to load the plugin
-
Configure the plugin (if needed) by editing files in
server\plugins\<plugin-name>\
# Create a backup
Compress-Archive -Path "server/world*" -DestinationPath "backup-$(Get-Date -Format 'yyyy-MM-dd').zip"This repository includes GitHub Actions workflow that tests the script on Windows:
.github/workflows/test.yml
The workflow runs on every push and pull request to verify the script works correctly.
This project's code is licensed under the Apache License 2.0. See the LICENSE file for details.
The server icon (server-icon.ico and server-icon.png) is sourced from Windows 95 Network Neighborhood PNG Icon by SatelliteDish555 on DeviantArt. The icon is used under fair use and is not licensed under Apache License 2.0.