Terraform scripts to quickly deploy a modded minecraft server onto aws
- Works for Forge mc versions 1.18.x -up to-> 1.21.x
Install the following :
Setup the following :
- AWS Account
- Connect AWS account to AWS CLI by creating an access key
Clone repo with git :
git clone https://github.com/Vsomera/aws-modded-mc-server.git
cd /aws-modded-mc-server
- Replace all instances of
s3_bucket_name
in the files below with a unique s3 bucket name (should all be the same name)
├───config
│ ec2_role.json
│ s3_policy.json <--- Change s3_bucket_name
├───modules
├───scripts
│
│ .gitignore
│ main.tf <--- Change s3_bucket_name
│ minecraft.service
│ readme.md
- First generate an ssh key to access minecraft ec2 instance
ssh-keygen -t rsa -b 4096 -f ~/.ssh/mc-ec2-key
chmod 400 ~/.ssh/mc-ec2-key
- Running command below outputs server ip address and builds server infastructure
terraform apply
-
Download mod loader for minecraft version pick between 1.18.x - 1.21.x
-
Choose or use existing mods
- Downloads mods : Modrinth / CurseForge (Must match minecraft version)
-
Put all mods in a folder named
mods
and zip the folder tomods.zip
- You can optinally zip configs or defaultconfigs if you wish to add them to your server
- Navigate to AWS s3 console
- Upload the following files to the
/setup
folder inside your s3 bucket :
REQUIRED:
- loader-x.xx.x-xx.x.x-installer.jar
- minecraft.service (provided in directory)
OPTIONAL
- mods.zip
- configs.zip
- defaultconfigs.zip
- Connect via SSH using provided key or ec2 console
- Use ip address provided by terraform output
ssh -i ~/.ssh/mc-ec2-key ubuntu@x.xxx.xx.x
- Run the following commands located in
ec2_commands.md
within your ec2 instance