During the first weeks of the COVID-19 pandemic, back in april 2020 my son ask me to build a Minecraft server in order to play on the same world wi...
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
Hi Julien, really nice guide! Following it I've been able to setup my own server too (only struggled creating the minecraft linux user and make it work without password.
To furtherly save some $$ I've implemented a change to the stop scenario to check if any player is connected and shutdown the server if someone is actually using it.
To do it I've found the nodejs library "mcping-js" that is really easy to use, here's the relevant code snippet:
Now I've scheduled the stop scenario to run every 30 minutes.
Thank you for the great guide! Also if anyone is having issues having the systemctl service not actually running, you can sanity check with:
systemctl status minecraft
systemctl is-enabled minecraft
and if it's not enabled, then you can run:
sudo systemctl enable minecraft
One more thing, if you're wondering why mcrcon is missing, follow install instructions for github.com/Tiiffi/mcrcon in the directory named in the script
/opt/minecraft/tools/
king
Have you considered using a Fargate instance instead of EC2 so you dont have to keep stopping and starting the instance to save money? As I understand it, Fargate is constantly running (just like ec2), but only charges on a usage basis, rather than based on the uptime (like ec2).
Hi 👋
Fargate is an ECS flavour where you are not managing directly the EC2 behind ECS. But Fargate comes with a pricing per hour: aws.amazon.com/fargate/pricing/
So if you create a Fargate task, you will pay for it as long as the task is up and idle or running 😇.
Hi Julien,
Thank you for this guide on setting up an AWS EC2 instance to use as a Minecraft server. I've been able to follow your directions and get everything set up, but I'm struggling to get the right version of Java installed on the Amazon Linux 2 AMI instance. I installed Java 8 on the server per your instructions, and I used the same URL to pull down the server.jar file. When I try to launch the Minecraft server I get a message stating the file was compiled with Java 60 and I only have Java 52 running. Any thoughts on how to get the correct match of Java and the server.jar file on the server together?
Thanks in advance!!
Let me check that it seems that the class version is not correct.
52 is Java 8
60 is Java 17 I think.
Maybe Minecraft server is now requirering Java 17? I will check that for you and update the article 🕵️
Thank you sir. From the quick research I did, I can't seem to find an option for Java above V11 for the Amazon Linux 2 OS. Hopefully your research yields better results than mine.
OK it's related to the Minecraft version, as 1.17 is now requiring Java 16 (instead of Java 8 on 1.16.5, that's a pretty big move!)
minecraft.fandom.com/wiki/Java_Edi...
I will update the article to be sure to download 1.16.5 because it seems less easy to get Java 16 on Amazon Linux 2.
Thanks !
Julien, I think I found the way to get a higher level of Java on Amazon Linux 2 using the Corretto library. Here are the commands:
sudo rpm --import yum.corretto.aws/corretto.key
sudo curl -L -o /etc/yum.repos.d/corretto.repo yum.corretto.aws/corretto.repo
sudo yum list available | grep java
sudo yum install -y java-17-amazon-corretto-devel.x86_64
sudo update-alternatives --config java
Select the Corretto Java 17 from the list
big thanks for digging that! I will update the article ASAP and test on my minecraft server !
done @mudhen459 thanks a lot !
Very handy description. However, on my AWS account I have never activated/used SES, so when I try to bring up the console where "it's time to create a new Rule Set in the Email Receiving section:" , this section is greyed out for me. Does the guide assume that one already have set up a domain/emailaddress for the SES?
Hello,
It seems that
Email Receiving
is only active in 3 AWS region (us-east-1, us-west-2 and eu-west-1). Are you in one of those regions?Source: docs.aws.amazon.com/general/latest...
Thanks !
Ah - I set it up in eu-north-1. That explains it then :-) Thank you!
Hm - still struggling with the email-part. Do I understand it correctly that you need to use AWS for MX for your domain to get SES to do what you need here?
Hello, yes it miss the MX declaration! Here is the detailed guide: docs.aws.amazon.com/ses/latest/dg/.... It's not needed to use Route53, but only to declare an MX entry in your DNS:
(replace regionInboundUrl by the AWS region you are using)
Incredible guide! I was able to set up my own EC2 version of a server running in just a few hours. Thank you. I'm excited to try implementing the Lambda Functions
Have you run into this error? "Can't keep up! Did the system time change, or is the server overloaded? Running [####]ms behind, skipping [##] tick(s)".
I'm running on the T2.Small like you recommended but it doesn't seem to be enough. Thoughts?
Hello!
I am running mine on a
t2.small
(complete list here), it's a 1 vcpu and 2 GB of memory that fit the bare minimum for a Minecraft server. I am not observing such issues, but there is not a lot of load on the server (probably 2 users maximum !).You can try to change and give a bit more memory (go to medium or large, and test both t2 and t3 - t3 is the latest generation so maybe more power for the same amount of money).
Good luck with the sizing, there is so much choice on EC2 😇
Hi, i need help, i did everything exect the autostart.
how you change directory to /etc/systemd/system/minecraft.service ?
i try cd and listing directories and only showing this
[root@ip server]# ls
server.jar
can you try:
or
Thanks !
really great man. There has been some mild changes here and there but was able to follow pretty well. You might add a bit of info about the mcrcon bin and what it does. That was a little confusing as you didn't put instructions about this. Thanks to some comments i got it figured out (pretty much. got some unrelated issues now). Another suggestion might be to add a bit more info about how the mail lamda's work. I know how these things go though... lol. anyway mostly wanted to say thanks!
First of all, beautiful setup, love the way everything was done here and setup in a nice guide for anyone to understand and learn from.
I do a lot in the Minecraft Multiplayer scene, and I was wondering, had you considered utilizing a game server host such as Minehut // Aternos (free hosts) as an alternative w/ a panel for your son to manage to play with friends? Assuming so, but was just wondering for my own personal curiosity :)
I just tried using this guide but cant get the mincraft server to start, I keep getting a pollkit error when executing systemctl daemon-reload.
any help would be appreciated.
You need sudo to run that command. It's a misleading warning.
What is the step where it’s failing?
Hey so I am having trouble making the minecraft server start on its own. I don't have that file path that you are using to make the server run on its own.
Glad it’s useful !
Quite a nice and useful piece of code for my current knowledge. Drift Boss is my favorite game, I hope when I graduate from school I can make good games like this.