Run your own Minecraft Server
on Amazon Lightsail
Amazon Lightsail is the easiest way to get started on AWS and is an easy-to-use virtual private server (VPS).
In this tutorial, you set up a dedicated Minecraft server on Amazon Lightsail. Minecraft is best experienced with a dedicated server . Dedicated servers have many benefits such as:
- Performance: you might not notice it at first, but as you progress in the game, hosting and playing at the same time can cause you to lag, sometimes at the worst possible moment.
- Always on: if you are playing with two or more friends, it might be challenging for everyone to log on at the same time. A dedicated server is always available so you and you friends can log on any time.
- Latency: if your friends live far away, a dedicated server can split the latency difference and provide a better overall experience to everyone.
|About this Tutorial|
|Cost||$5.00 + Minecraft license|
|Last Updated||March 15, 2021|
b. Choose Change Region and Availability Zone to create your instance in another location.
Select the closest Region to you so that you have good latency when playing.
c. Choose Linux as your platform, and select Ubuntu as your Blueprint.
When choosing your Blueprint, ensure you are selecting from the subsection, OS Only, not Apps + OS.
To learn more about Lightsail Blueprints, see Choose an Amazon Lightsail instance image.
d. Choose your instance plan.
Select the $5/month instance plan.
Note: If you expect to build a large world with more players, consider choosing a more powerful instance.
e. Enter a name for your instance.
f. Double-check everything and then click Create instance.
a. Once your server is ready, select it, and click the Networking tab.
b. In the Networking tab, add a firewall rule to allow port 25565.
This is the default port used by the Minecraft network protocol.
c. Open port 25565 to enable Minecraft clients to connect to the server.
d. Navigate to the Connect tab, and select Connect using SSH.
e. SSH to your Lightsail instance from your browser by using the public IP address. You will need this Public IP address later in the tutorial, too.
f. This will open a browser popup with a browser window for you to run commands on your Lightsail instance. Once connected, run:
sudo apt -y update && sudo apt -y install default-jre screen
g. Update the server and install the Java Runtime.
a. Run the following commands within your Lightsail SSH session.
# screen will keep running Minecraft after we disconnect SSH screen # Create a directory to hold the Minecraft files: sudo mkdir /usr/games/minecraft cd /usr/games/minecraft # Visit https://www.minecraft.net/en-us/download/server # Download the server jar file sudo wget -O mcserver.jar https://launcher.mojang.com/v1/objects/bb2b6b1aefcd70dfd1892149ac3a215f6c636b07/server.jar # Run the minecraft server: sudo java -Xmx1G -Xms1G -jar mcserver.jar nogui
b. The first time you try to start the Minecraft server, it will display an error indicating that you must accept the EULA.
c. In order to accept the EULA, you need to write “eula=true” to the contents of eula.txt, but since this file is owned by root, you need to change ownership first.
To do so, enter the following command:
# change ownership of eula.txt sudo chown ubuntu eula.txt # accept the EULA echo "eula=true" > eula.txt # re-run the Minecraft server command sudo java -Xmx1G -Xms1G -jar mcserver.jar nogui
d. Monitor the console for any errors. If everything goes well, here’s what you should see:
Once the Minecraft server is up and running, if you need to run other commands in your SSH session without stopping the server, exit screen by pressing “CTRL+A” and then “d”.
Next time you connect to your Lightsail instance, you’ll be greeted with an empty bash prompt. Don’t worry, your server is probably running within a screen session. To list the active screen sessions, run “screen -ls”. In the output, each line begins with the ID of the session. If you only have a single screen session, you can connect to it by running “screen -r”. If there are multiple sessions, you will need to run “screen -r ” where ID is the session ID.
a. On your client machine install and launch Minecraft. Enter your unique IP address in the Multiplayer/server. Then press Done.
If you have trouble adding your server, double check the IP address and make sure port 25565 is open in Step 1.
Now you can share your server IP Address with your friends and family and enjoy a fast, reliable private Minecraft Server!
You used Amazon Lightsail to easily host a Minecraft server.
Amazon Lightsail is great for developers, WebPros, and anyone looking to get started on AWS in a quick and cheap way. You can launch SSD-based instances, databases, manage domains, load balancers, and much more.