Back to Templates
GameCP OfficialMinecraft
Verified

Minecraft Vanilla

Official Mojang Minecraft Server

v1
1/8/2026

Startup Command

Default

Default command line arguments

Default
-Xmx${JAVA_XMX} -Xms${JAVA_XMS} -jar server.jar nogui

Environment Variables

MAX_PLAYERS

RequiredRead Only

Max Players

Maximum number of players allowed on the server

Default
20

SERVER_PORT

Read Only

Server Port

Server port (automatically assigned)

Default
${PORT}

RCON_PORT

Read Only

RCON Port

RCON port (automatically assigned)

Default
${RCON_PORT}

QUERY_PORT

Read Only

Query Port

Query port (automatically assigned)

Default
${QUERY_PORT}

SERVER_IP

Read Only

Server IP

Server IP address (automatically assigned)

Default
${IP}

JAVA_XMX

RequiredRead Only

Max Memory (Xmx)

Maximum memory allocation for the Java process (e.g., 2G, 4G, 8G)

Default
2G

JAVA_XMS

RequiredRead Only

Initial Memory (Xms)

Initial memory allocation for Java (e.g., 1G, 2G)

Default
1G

CPU_LIMIT

RequiredRead Only

CPU Limit

CPU limit for Docker container (e.g., 1.0, 2.0)

Default
1.0

MEMORY_LIMIT

RequiredRead Only

Memory Limit

Memory limit for Docker container (e.g., 2g, 4g)

Default
2g

DISK_LIMIT

RequiredRead Only

Disk Limit

Disk limit for Docker container (e.g., 10g, 20g)

Default
10g

NETWORK_LIMIT

RequiredRead Only

Network Limit

Network bandwidth limit for Docker container (e.g., 1g, 2g)

Default
1g

Lifecycle Scripts

Update Server Properties

Automatically configure server.properties with assigned ports and IP

before start
#!/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...

Download Server JAR

Downloads the Minecraft server JAR file before installation

before install
#!/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."

Backup World Before Stop

Creates a backup of the world before stopping the server

before stop
#!/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"

Update Server Properties After Install

Updates server.properties with correct settings after installation

after install
#!/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.properties

Cleanup Old Logs Before Start

Cleans up old log files before starting the server

before start
#!/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"
fi

Configuration Files

Server Properties

Main Minecraft server configuration file

//server.propertiesproperties
55 fields

Container Configuration

Docker Image

eclipse-temurin:21-jre-alpine

Technical Profile

Template ID

minecraft-vanilla

Author

Community

Last Updated

January 8, 2026

Status

Active