Official Mojang Minecraft Server
Default command line arguments
-Xmx${JAVA_XMX} -Xms${JAVA_XMS} -jar server.jar noguiMax Players
Maximum number of players allowed on the server
20Server Port
Server port (automatically assigned)
${PORT}RCON Port
RCON port (automatically assigned)
${RCON_PORT}Query Port
Query port (automatically assigned)
${QUERY_PORT}Server IP
Server IP address (automatically assigned)
${IP}Max Memory (Xmx)
Maximum memory allocation for the Java process (e.g., 2G, 4G, 8G)
2GInitial Memory (Xms)
Initial memory allocation for Java (e.g., 1G, 2G)
1GCPU Limit
CPU limit for Docker container (e.g., 1.0, 2.0)
1.0Memory Limit
Memory limit for Docker container (e.g., 2g, 4g)
2gDisk Limit
Disk limit for Docker container (e.g., 10g, 20g)
10gNetwork Limit
Network bandwidth limit for Docker container (e.g., 1g, 2g)
1gAutomatically configure server.properties with assigned ports and IP
#!/bin/bash
echo "Updating server.properties with assigned configuration..."
# Create server.properties if it doesn't exist
if [ ! -f "server.properties" ]; then
echo "# Minecraft server properties" > server.properties
echo "# Generated by GameCP" >> server.properties
echo "" >> server.properties
fi
# Update server-port
if grep -q "^server-port=" server.properties; then
sed -i "" "s/^server-port=.*/server-port=${PORT}/" server.properties
else
echo "server-port=${PORT}" >> server.prop...Downloads the Minecraft server JAR file before installation
#!/usr/bin/env bash echo "Accepting EULA..." echo "eula=true" > eula.txt echo "Downloading Minecraft server JAR..." wget -q https://piston-data.mojang.com/v1/objects/6bce4ef400e4efaa63a13d5e6f6b500be969ef81/server.jar echo "Download completed."
Creates a backup of the world before stopping the server
#!/bin/bash echo "Creating world backup before server stop..." mkdir -p backups timestamp=$(date +"%Y%m%d_%H%M%S") cp -r world "backups/world_$timestamp" echo "World backup completed: world_$timestamp"
Updates server.properties with correct settings after installation
#!/bin/bash
echo "Updating server.properties..."
echo "server-port=${PORT}" >> server.properties
echo "server-ip=${IP}" >> server.properties
echo "rcon.port=${RCON_PORT}" >> server.properties
echo "query.port=${QUERY_PORT}" >> server.propertiesCleans up old log files before starting the server
#!/bin/bash
echo "Cleaning up old log files..."
if [ -d "logs" ]; then
if command -v find >/dev/null 2>&1; then
find logs -name "*.log" -mtime +7 -delete 2>/dev/null || true
echo "Log cleanup completed."
else
echo "find command not available, skipping log cleanup"
fi
else
echo "Logs directory does not exist, skipping cleanup"
fiMain Minecraft server configuration file
//server.propertiespropertieseclipse-temurin:21-jre-alpine
minecraft-vanilla
Community
January 8, 2026