Skip to content

Instantly share code, notes, and snippets.

@ActuallyFro
Last active May 20, 2025 01:11
Show Gist options
  • Select an option

  • Save ActuallyFro/a37d7cf1b1514a123e80a5aede588b56 to your computer and use it in GitHub Desktop.

Select an option

Save ActuallyFro/a37d7cf1b1514a123e80a5aede588b56 to your computer and use it in GitHub Desktop.
ChatGPT AND Minecraft Wiki -- FTW +Tmux (#BooScreen)
[Unit]
Description=Minecraft Server (Spigot) using tmux
After=network.target
# FILE Location: `sudo nano /etc/systemd/system/minecraft-server.service`
# INSTALL WITH:
# =============
# `sudo systemctl daemon-reexec`
# `sudo systemctl daemon-reload`
# `sudo systemctl enable minecraft-server.service`
# IF edited -- after install, run: `systemctl daemon-reload`
# `sudo systemctl status minecraft-server.service`
[Service]
WorkingDirectory=/home/bedrock/spigot_build
User=bedrock
Group=bedrock
Type=forking
ExecStart=/usr/bin/tmux new-session -d -s minecraft-server '/usr/bin/java -Xms6G -Xmx7G -jar spigot-1.21.5.jar nogui'
ExecStop=/usr/bin/tmux send-keys -t minecraft-server 'stop' C-m && sleep 15
ExecStopPost=/usr/bin/tmux kill-session -t minecraft-server
Restart=on-failure
# StandardOutput=journal
# StandardError=journal
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment