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:11] – [Obtain the link for the Minecraft download] petergames:minecraft:create_a_minecraft_server [2021/07/08 19:48] (current) – [References] peter
Line 119: Line 119:
   * To shut down your server, enter the command **stop**.   * To shut down your server, enter the command **stop**.
 </WRAP> </WRAP>
 +
 +<WRAP info>
 +**NOTE:**  Some people suggest the server runs quicker using <code bash>
 +java -jar server.jar --nogui
 +</code>
 +
 +  * But this prevents a GUI for typing commands, so only use this option is that is not a concern.
 +
 +</WRAP>
 +
  
 ---- ----
Line 136: Line 146:
 ---- ----
  
 +===== 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 =====
 +
 +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.1625746288.txt.gz · Last modified: 2021/07/08 12:11 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki