Minecraftd is a wrapper script and systemd unit to host a minecraft server.
Minecraftd can start a minecraft server in the background via systemd or directly from the command line. A simple fifo is created to allow sending commands directly to the server's stdin.
Minecraftd can be run by any user that has write access to the minecraft server directory. The systemd unit is configured to run minecraftd as user minecraft.
make install
Installation does not create a minecraft server directory. You must create a server directory and/or congfigure minecraftd to use that directory after installation.
Note that installation is not explicitly required to run the minecraftd
script. You may create a minecraftd.conf
in any directory and run
minecraftd
there to source it and start a minecraft server.
Minecraftd is also available in the AUR.
- bash
- java
- minecraft server jar
minecraftd [COMMAND]
start
: Start minecraft server.
stop
: Stop minecraft server.
command [COMMAND...]
: Send COMMAND to minecraft server stdin.
connect
: Launch interactive minecraft server stdin prompt.
-H
, --help
: Display help and exit.
systemctl enable minecraftd.service
systemctl start minecraftd.service
Minecraftd sources the following config files (if they exist) in order:
- /etc/minecraftd.conf
- /etc/minecraftd.d/*
- ~/.config/minecraftd.conf
- ./minecraftd.conf
These files are strictyaml containing the following keys:
jar
: Minecraft server jar file. (default: /usr/share/java/minecraft-server.jar)
mem
: Maximum memory allocated to minecraft server. (default: 2G)
srv
: Minecraft server directory. (default: /srv/minecraft)
This doesn't require tmux or screen as some other minecraft server control scripts do. Don't get me wrong, I love tmux, but I'd rather not have systemd running tmux running a server when I could just have systemd run a server.