Automatic set-up Fabric or Forge modded Minecraft dedicated servers, supporting .mrpack
exports for import with Prism Launcher and a Server <-> Discord relay bot.
Found the playbooks useful? Buy me a coffee ☕!
Ansible requires Linux. If you're running Windows, consider setting up WSL.
In this folder in Linux or WSL (instructions are for Ubuntu):
- Run
sudo apt-get update && sudo apt-get upgrade
- Install Python and Pip:
sudo apt-get install python3 python3-pip
- Install Python requirements:
pip install -r requirements.txt
- On the server, run:
sudo apt-get install openjdk-21-jre-headless python3 python3-pip
- install java and pythonuseradd -Um fmcs
- add the "fmcs" usersudo loginctl enable-linger fmcs
- enable systemd service lingering for the user
- Build your Ansible inventory and global/host variables using the samples:
- host_vars/mc.myhost.com.secret.yml.sample
- host_vars/mc.myhost.com.yml.sample
- inventory.yml.sample
- Ansible supports encrypted data vaults. Rename
.vault_pass.sh.sample
to.vault_pass.sh
and put your vault key in. Even if you're not using vaults, the file must still exist!
- Trigger
make servers
to build images and run servers.
-- Save the server icon(s) you want asroles/servers/files/{host}/{instance}.png
- Trigger
make perms
.
-- Define ops/whitelist in{host}.yml
- Trigger
make mrpack
.
-- The files are put into themrpacks
folder
- Ensure you have the required setup:
- Discord bot token
- Guild (Server) and Channel ID
- Trigger
make relay
.
- Trigger
make backup
.
-- Backups will appear inroles/backup/files/{host}
fmcs-server
bases all used ports off of mcs_base_port
; default 25565
.
Every server reserves mcs_reserve_ports
ports for itself; default 10
.
e.g. if you have multiple servers on one machine, they would be:
25565
,25575
, etc...
A list of ports, relative to mcs_base_port
:
+0 (UDP/TCP)
: Main server+1 (TCP)
: Rcon (the relay bot does not need this to port to be open on the host machine to work!)+2 (UDP)
: Port opened for voice chat mods such as Simple Voice Chat+3 (TCP)
: Autoconfigured for Dynmap
There is a pre-commit hook that you should enable to ensure you don't commit any unencrypted secret:
ln .hooks/pre-commit .git/hooks/pre-commit
Has something gone horribly wrong? Or do you just think something's missing?
Feel free to create a new issue or join the Discord.
If you're reporting a bug, it's most useful to me if you can find a way to consistently replicate the issue.