Build/Provision dedicated minecraft servers with forge mod support in seconds.
I began work on minutemen when I offered to host a small modded minecraft server for some friends and I. I was unimpressed with the current opensource offerings I found online so I decided to build my own. Most of the scripts/tutorials I found on forums/blogs either went against Linux best practices or went as far as suggesting screen
in lieu of a named pipe and proper init system. I found these solutions to be unacceptable.
- Written 100% in Bash ๐ช Depends only on common Linux utilities; no additional languages required
- Designed to be rerunnable with no repercussions
- Built with security in mind
- Supports
Fedora
andUbuntu
. If your distro of choice isn't compatible make an issue. - Utilizes Systemd
- Does NOT depend on
screen
; instead named pipes are used - Supports multiple concurrent minecraft servers on a single host
- Supports multiple versions of ForgeMod. Each instance can run a different version.
curl | bash is indefensible. Just because the transport is over HTTPS doesn't guarantee the content hasn't been maliciously modified on the server. It also doesn't guarantee that you won't receive a partial download that happens to stop at some inopportune time.
curl https://raw.githubusercontent.com/egladman/minutemen/master/bootstrap.sh | bash
git clone [email protected]:egladman/minutemen.git
cd minutemen
./bootstrap.sh -v -e 28.1.0
Note: Checkout manifest.json
to see all supported forgemod versions. Other versions can be added with minimum effort.
- Run the help utility for more info
./bootstrap.sh -h
- Override jvm max heap size in megabytes
./bootstrap.sh -m 4096M
- Have you created a monster and don't know what to do?
Delete the main installation folder and rerun bootstrap.sh
rm -rf /opt/minecraft
- Kill instance
Warning: You run the risk of data loss. Can you use systemctl stop minutemen@<uuid>
?
systemctl kill -s SIGKILL minutemen@<uuid>
- If you're running multiple builds place the forge installer jar in
/opt/minecraft/.cache
to reduce network activity. The.jar
is cached after the first install.
- If you add mods (i.e.
.jar
) to/opt/minecraft/instances/<uuid>/mods
or/opt/minecraft/.forgemods
be sure to set permissions
chown -R mminecraft:mminecraft /opt/minecraft/.forgemods
# or
chown -R mminecraft:mminecraft /opt/minecraft/instances/<uuid>/mods/
- Mods placed in
/opt/minecraft/.forgemods
will be automatically be installed
- Generate a password with the following command:
#Tested againt mkpasswd 5.5.3 on Fedora31
mkpasswd --method=sha512crypt mySuperSecretPassword
Tip: Run mkpasswd --method=help
to print all the available encryption algorthims. SHA-512
is by far the strongest provided by mkpasswd
.
- For example if you'd like user:
mminecraft
to have password:HelloWorld
you'd run:
mkpasswd --method=sha512crypt HelloWorld
mkpasswd
will return the following:
$6$RN.HLGL5BosPQ2ZS$kVfGYi709anfOLAn7Hc18zwTfhRhwEcLfSMvhKl2yVU1wIJV4P4sJTheebx8BMpzr0HWl/cIsp3GK8FO670v9.
Note: By default mkpasswd
salts the string. So each time you run mkpasswd
you'll get a different hash by design.
- Pass the hash into
bootstrap.sh
as an environment variable
MC_USER_PASSWORD_HASH='$6$RN.HLGL5BosPQ2ZS$kVfGYi709anfOLAn7Hc18zwTfhRhwEcLfSMvhKl2yVU1wIJV4P4sJTheebx8BMpzr0HWl/cIsp3GK8FO670v9.' ./bootstrap.sh
-
The forge installer stdout is saved to
/opt/minecraft/log/<uuid>
-
View process details
systemctl status minutemen@<uuid>
- View logs that would typically be printed to stdout
journalctl -u minutemen@<uuid>.service -f
To run the following commands you'll need to authenticate as mminecraft
su - mminecraft
/opt/minecraft/bin
โโโ backup
โโโ backup-restore
โโโ cmd
โโโ save
โโโ start
โโโ stop
backup
- Summary: Copies
/opt/minecraft/instances/<uuid>
directory and saves it to/opt/minecraft/backups/<uuid>
as<epoch-time>.tar.gz
- Example:
/opt/minecraft/bin/backup <uuid>
backup-restore
- Summary: Recover from backup.
- Example:
/opt/minecraft/bin/backup-restore <uuid> <epoch-time>
cmd
- Summary: Execute any console command. See full list here
- Example:
/opt/minecraft/bin/cmd <uuid> say HELLO
save
- Summary: Executes console command
save-all flush
. - Example:
/opt/minecraft/bin/save <uuid>
start
- Summary: Skip systemd and run the server manually
- Example:
/opt/minecraft/bin/start <uuid>
stop
- Summary: Executes console command
stop
- Example:
/opt/minecraft/bin/stop <uuid>