Direct answer
GNU screen keeps a terminal-based Minecraft server session attached to a pseudo-terminal after your SSH connection closes. It is not a replacement for backups or an OS service manager.
Step-by-step procedure
- Install the
screenpackage using your distribution’s package manager. - From the server directory run
screen -S minecraft, then launch the Java server using your tested startup command. - Detach using
Ctrl+A, thenD; this leaves the Minecraft process running in the session. - Reconnect with
screen -r minecraft; enterstopin the Minecraft console before ending the session.
Common mistakes and trade-offs
Avoid creating multiple screen sessions pointed at the same world. Do not treat closing the SSH terminal as proof that the server shut down.
How to verify it worked
Run screen -ls after disconnecting and reconnecting to verify one intended session exists and the Minecraft console remains responsive.
Version and platform differences
For automatic startup after machine reboot, use systemd or a panel; GNU screen alone does not arrange boot-time startup.
Official references
These sources were checked for the current MSH revision. Version-sensitive details should always be confirmed against the project documentation for the release you run.
Related guides
Help us improve this article
Tell us what is missing, unclear, outdated, or incorrect. You can also suggest something we should add.