Run Minecraft server as a systemd (background) service: ======================================================== This allows you to have a Minecraft server to auto start on boot and run in the background. Only issue is that you cant interact with the server (so no banning players or changing weather as an example) but allows for a fully automated setup and can be run when you need your server in a remote location. ---------------------------------------------------------------------------------------- 1. First, create the /etc/systemd/system/minecraft.service file and add this contents: [Unit] Description=Start Minecraft After=network.target [Service] Type=simple ExecStart=/opt/minecraft/start_minecraft_server.bash TimeoutStartSec=0 [Install] WantedBy=default.target Then save using Ctrl+X. -------------------------------------------------------- 2. mark it as executable by: sudo chmod +x /etc/systemd/system/minecraft.service ------------------------------------------------------------------------------------------------- 3. create the /opt/minecraft/start_minecraft_server.bash file and add this contents using nano: #!/bin/bash #Standard Minecraft cd /opt/minecraft exec java -Xmx2048M -Xms2048M -jar server.jar nogui Then save using Ctrl+X. ------------------------------------------------------------ 4. mark it as executable by: sudo chmod +x /opt/minecraft/start_minecraft_server.bash ------------------------------------------------------------- 5. Reload systemd demond by: sudo systemctl daemon-reload ------------------------------------------------------------ 6. Enable and start minecraft server systemd by: sudo systemctl enable minecraft.service sudo systemctl start minecraft.service You now got a fully automated / background Mnecraft server! -------------------------------------------------------------------------------------------------- Source: https://fatmin.com/2018/01/29/linux-how-to-start-a-minecraft-server-at-boot-via-systemd/ Date: February 18th 2023