Skip to content

Instantly share code, notes, and snippets.

@djotaku
Created September 2, 2022 23:32
Show Gist options
  • Save djotaku/aa9640311bed5e4bbf59f15faf887733 to your computer and use it in GitHub Desktop.
Save djotaku/aa9640311bed5e4bbf59f15faf887733 to your computer and use it in GitHub Desktop.
minecraft systemd unit file
[Unit]
Description=Minecraft Server
After=network.target
[Service]
User=minecraft
Group=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
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment