User Tools

Site Tools


games:minecraft:create_a_minecraft_server

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
games:minecraft:create_a_minecraft_server [2021/07/08 12:20] – [Start the Minecraft Server] petergames:minecraft:create_a_minecraft_server [2021/07/08 19:48] (current) – [References] peter
Line 145: Line 145:
  
 ---- ----
 +
 +===== Create a Server startup script =====
 +
 +Create /etc/systemd/system/minecraft.service.
 +
 +<file bash /etc/systemd/system/minecraft.service>
 +[Unit]
 +Description=Minecraft server
 +Documentation=
 +Wants=network.target
 +After=network.target
 +
 +[Service]
 +WorkingDirectory=/home/minecraft/server
 +User=minecraft
 +Group=minecraft
 +Type=forking
 +# Run it as a non-root user in a specific directory
 +
 +ExecStart=/usr/bin/tmux -s new minecraft "java -jar server.jar"
 +
 +# Send "stop" to the Minecraft server console
 +ExecStop=/usr/bin/tmux kill-session -t minecraft
 +# Wait for the PID to die - otherwise it is killed after this command finishes!
 +ExecStop=/bin/bash -c "while ps -p $MAINPID > /dev/null; do /bin/sleep 1; done"
 +# Note that absolute paths for all executables are required!
 +
 +[Install]
 +WantedBy=multi-user.target
 +</file>
 +
 +----
 +
 +===== Run the Startup Script =====
 +
 +<code bash>
 +systemctl daemon-reload
 +systemctl start minecraft
 +</code>
  
 ===== References ===== ===== References =====
  
 https://www.minecraft.net/en-us/download/server https://www.minecraft.net/en-us/download/server
 +
 +https://teilgedanken.de/Blog/post/setting-up-a-minecraft-server-using-systemd/
 +
 +https://minecraft.fandom.com/wiki/Tutorials/Setting_up_a_server
 +
 +https://minecraft.fandom.com/wiki/Tutorials/Setting_up_a_server#Configuring_the_environment
 +
 +http://techtips-tom.blogspot.com/2013/01/mineos-turnkey-on-proxmox-vm-server.html
games/minecraft/create_a_minecraft_server.1625746859.txt.gz · Last modified: 2021/07/08 12:20 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki