Helper scripts to do various things.
Disclaimer: You should never trust these scripts, as with all scripts on the Internet. Double-check them and use them on your own risk.
Run your Minecraft server as non-privileged user inside a screen managed by systemd, so it starts on server-startup and stopps on server shutdown. Allows as many servers as you like to run in parallel. minecraftctl
offers starting and stopping servers, creating new instances and opening the terminal by multiple users in parallel.
Inside folder minecraft-server-systemd
:
minecraftctl
[email protected]
- Create a unix user and group
minecraft
- You can use other user and group names, adjust
[email protected]
'sUser=
andGroup=
settings andminecraftctl
'sSCREEN_OWNER
constant accordingly
- You can use other user and group names, adjust
- Put
[email protected]
into/etc/systemd/system/
- Put
minecraftctl
into/usr/local/bin/
and ensure it is executable by everyone and owned by root- You can put
minecraftctl
somewhere else, but you then need to adjust theSAFE_SELF
constant inside the script
- You can put
- Create a sudoers entry to allow users or a group of your choice to execute
minecraftctl
with elevated permissions
minecraftctl
: show helpminecraftctl start <server-id>
: start the server with given idminecraftctl stop <server-id>
: stop the server with given idminecraftctl restart <server-id>
: restart the server with given idminecraftctl status <server-id>
: show the status of the server with given idminecraftctl enable <server-id>
: enable the server with given id to be started automatically on system bootminecraftctl disable <server-id>
: disable the server with given id to be no longer started automatically on system bootminecraftctl create <server-id> <executable>
: create a new server instance with given id and executable
Download the latest or any other paper executable.
Inside folder downloader
:
paper-download
- Put
paper-download
into/usr/local/bin/
and ensure it is executable by everyone
paper-download
: download latest paper build of the latest minecraft version availablepaper-download <minecraft-version>
: download latest paper build of the given minecraft versionpaper-download <minecraft-version> <build>
: download the given paper build of the given minecraft version
Put your worlds into a ramdisk for faster load and save times.
Inside folder world-ramdisk
:
minecraft-ramdisk-prepare.service
minecraft-ramdisk.timer
minecraft-ramdisk.service
- Put
minecraft-ramdisk-prepare.service
,minecraft-ramdisk.timer
andminecraft-ramdisk.service
into/etc/systemd/system/
- Adjust paths inside both service units to match your world storage
- Tell your server to use the worlds inside your ramdisk
- Either use
--world-dir /dev/shm/minecraft/
if your server supports it - Or create symlinks to your worlds from the server directory to the shared memory worlds
- Either use