The auto-pause feature monitors client connections and pauses the Java process when no players are connected. When a client attempts to connect, the process automatically resumes. This saves CPU resources without affecting the player experience.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/itzg/docker-minecraft-server/llms.txt
Use this file to discover all available pages before exploring further.
As of Minecraft 1.21.2, the native
pause-when-empty-seconds server property is recommended instead. Configure it using the PAUSE_WHEN_EMPTY_SECONDS environment variable.Enabling Auto-Pause
Set theENABLE_AUTOPAUSE environment variable to enable this feature:
Watchdog Configuration
Vanilla Servers
For vanilla Minecraft servers, setMAX_TICK_TIME to -1:
PaperMC Servers
PaperMC has its own watchdog that must be disabled separately:Other Server Types
Check your server type’s documentation for watchdog configuration and disable it accordingly.How Auto-Pause Works
Player attempts connection
When a player tries to connect, the
knockd daemon detects the connection attempt at the network interface level.Configuration Variables
| Variable | Default | Description |
|---|---|---|
AUTOPAUSE_TIMEOUT_EST | 3600 | Seconds between last client disconnect and pausing |
AUTOPAUSE_TIMEOUT_INIT | 600 | Seconds between server start and pausing (if no connections) |
AUTOPAUSE_TIMEOUT_KN | 120 | Seconds between port knock and pausing (if no connections) |
AUTOPAUSE_PERIOD | 10 | Seconds between state machine checks |
AUTOPAUSE_KNOCK_INTERFACE | eth0 | Network interface for knock detection |
AUTOPAUSE_STATUS_RETRY_LIMIT | 10 | Number of status check retries |
AUTOPAUSE_STATUS_RETRY_INTERVAL | 2s | Time between status check retries |
Example Configuration
Network Interface Configuration
The knock detection works at the network interface level. The correct interface must be configured for non-default networking:Finding the Correct Interface
Pause State Indicators
.paused File
When the server is paused, a.paused file is created in the /data directory:
.skip-pause File
Create a.skip-pause file to prevent auto-pausing:
The auto-pause timer resets when the
.skip-pause file is present.Rootless Auto-Pause
When running rootless containers, additional configuration is required:Required Capabilities
Add theCAP_NET_RAW capability:
Port Forwarder Configuration
Change from RootlessKit to slirp4netns: Docker:Health Checks with Auto-Pause
When auto-pause is enabled, use themc-health wrapper for health checks:
Troubleshooting
Enable Debug Logging
Add debug output to troubleshoot issues:Common Issues
Server keeps restarting:- Ensure
MAX_TICK_TIME=-1is set - Check for other watchdog configurations in your server type
- Verify the correct network interface is configured
- Check the timeout values are appropriate
- Enable debug logging to see state transitions
- Verify
AUTOPAUSE_KNOCK_INTERFACEmatches your network setup - Ensure
CAP_NET_RAWis granted for rootless containers - Check that you’re not using the loopback interface