Skip to content

Instantly share code, notes, and snippets.

@mrpjevans
Last active June 8, 2022 17:58
Show Gist options
  • Save mrpjevans/dac16bb17dee38bf1a1a5be63645459f to your computer and use it in GitHub Desktop.
Save mrpjevans/dac16bb17dee38bf1a1a5be63645459f to your computer and use it in GitHub Desktop.
[Unit]
Description=Minecraft Server
After=network.target
[Service]
User=minecraft
Nice=1
KillMode=none
SuccessExitStatus=0 1
ProtectHome=true
ProtectSystem=full
PrivateDevices=true
NoNewPrivileges=true
WorkingDirectory=/usr/local/minecraft/server
ExecStart=/usr/bin/java -Xmx4096M -Xms512M -jar server.jar nogui
ExecStop=/usr/local/minecraft/tools/mcrcon/mcrcon -H 127.0.0.1 -P 25575 -p password stop
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment