- Provision an Minecraft server where you and your friends can connect and play.
- An AWS account with access and secret keys.
- An Hetzner Cloud account with a valid API access token.
Instance Type | OS | RAM | vCPUs |
---|---|---|---|
t2.medium | Ubuntu 22.04 | 4GB | 2 |
Instance Type | OS | RAM | vCPUs |
---|---|---|---|
CPX21 | Ubuntu 22.04 | 4GB | 3 |
If you want, you can customize some options on your Minecraft Server. To do it, you need to edit ./ansible/playbook.yml
minecraft-server role.
server_jar_url
: The server.jar file that will run the server. The version of this file must match the version of the Minecraft Client. (Default 1.20.1)
The other variables are self-explainable.
- Init terraform:
cd terraform/<aws | hetzner> && terraform init
- Create, if not existent, an SSH key:
ssh-keygen
-
Config your credentials on
./env/.env.<aws | hetzner>
-
Provision your server:
./provision.sh <aws | hetzner>
If you already have a server, you can only run the ansible playbook that install and configure a Minecraft Server on your server.
-
Write the user that ansible will user and your IP address on
./ansible/hosts.ini
-
Install ansible community.general collection:
ansible-galaxy collection install community.general
- Run:
cd ansible && ansible-playbook -i hosts.ini -v playbook.yml
If you want to destroy your Minecraft Server instances, just run:
./destroy.sh <aws | hetzner>
- Grab your server IP address (
output.json
) - Go to Multiplayer on your Minecraft Client
- Add your brand new server and start playing!
- SSH into your server:
ssh minecraft@<server ip address>
- Your Minecraft Server simply is a systemd process, that you can manage with:
sudo /bin/systemctl (status | start | stop | restart | enable | disable)
TODO
~ 7.00€ / month |
---|