Run your own Minecraft Server

on Amazon Lightsail

Amazon Lightsail is the easiest way to get started on AWS. It offers virtual servers, storage, databases and networking, plus a cost-effective, monthly plan.

In this tutorial, you set up a dedicated Minecraft server on Amazon Lightsail.

Before you begin, accept the EULA for Minecraft. 

Get started with Amzon Lightsail for free. 

About this Tutorial
Time 10 minutes                                           
Cost $5.00
Use Case Compute
Products Amazon Lightsail
Audience Developer
Level Beginner
Last Updated April 16, 2020

1. Create an Amazon Lightsail account

This tutorial is free tier eligible. 

Once you've created a Lightsail account, sign into the Lightsail console. 

Already have an account? Sign-in

2. Launch your Lightsail instance

a. Choose Create instance in the Instances tab of the Lightsail home page.

minecraft1

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.

minecraft2

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.

minecraft3

d. Choose your instance plan.

Select the $5/month instance plan.

Note: The $3.50 Instance type is enough for a small server with a few friends, but if you expect to build a large world with more players, consider choosing a more powerful instance.

Learn more on our Lightsail pricing page.

Screen Shot 2020-04-09 at 12.22.04 PM

e. Enter a name for your instance.

Screen Shot 2020-04-09 at 12.22.16 PM

f. Double-check everything and then click Create instance. 

image9

3. Configure and connect to your server

a. Once your server is ready, select it, and click the Networking tab. 

 

Screen Shot 2020-04-09 at 12.22.33 PM

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.

Screen Shot 2020-04-09 at 12.22.41 PM

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. 

minecraft12

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
minecraft13

g. Update the server and install the Java Runtime.

 

4. Install and run Minecraft Server

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/minecaft

# 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/4d1826eebac84847c71a77f9349cc22afd0cf0a1/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.

minecraft14

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:

minecraft15

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.

5. Connect your Minecraft Client

a. On your client machine install and launch Minecraft. Enter your unique IP address in the Multiplayer/server. Then press Done.

minecraft16

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!

5. Next steps

Now that you can connect to your instance, what you do next depends on how you plan to use it. For example, you can:

Congratulations

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.

Was this tutorial helpful?

Thank you
Please let us know what you liked.
Sorry to disappoint you
Is something out-of-date, confusing or inaccurate? Please help us improve this tutorial by providing feedback.