How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud

Andrei Maksimov

Andrei Maksimov

0
(0)

Minecraft is a playground video game that helps determine completely random landscapes and build spectacular constructions ranging from tiny houses to massive castles. It was created by Mojang Studios and eventually purchased by Microsoft. Most computer video games from a decade ago are collecting dust on shelves, but Minecraft is still going strong. It is a three-dimensional video game in which players build and destroy various types of blocks. Survival and Creative are the game’s two main modes.

Players in Survival must gather their building materials and food. They also interact with moving creatures and blocklike mobs. While players in Creative are provided materials and do not need to eat to survive. The only job in creative mode is constructing. They can also instantly break any block.

Minecraft is compatible with a variety of operating systems. This tutorial shows you how to install Minecraft on CentOS, Ubuntu, or Windows in the AWS cloud.

Launching EC2 instance

For more information about launching an EC2 instance in the AWS cloud, review the Launch an instance using the Launch Instance Wizard guide.

Choose an AMI

Choose the required AMI image with the operating system of your choice (Ubuntu, CentOS or Windows).

1. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Launching EC2 instance - AMI

Choose an Instance Type

Use the following official server requirements table, to choose the right EC2 instance type.

For the purpose of this demo, we’ll choose the minimal instance type for our server – t2.micro.

2. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Launching EC2 instance - Instance type

Choose a VPC

Next we have to configure VPC details.

Use default VPC settings at this step.

3. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Launching EC2 instance - Instance details

Choose a Storage

Again, use the official server requirements table to get an idea, how much storage you need.

We’ll move forward with 30 GiB gp2 EBS volume.

4. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Launching EC2 instance - Storage

Add Tags

To be able to easily identify your server, add Tag with the following parameters:

  • KeyName
  • Valueminecraft-server
5. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Launching EC2 instance - Add Tags

Security Group

Security Group is an EC2 instance firewall.

It allows you to protect your server from unwanted connections.

In addition to the default SSH or RDP port, you need to open TCP/25565 to allow connections to your Minecraft server.

For Ubuntu and CentOS, use the following Security Group configuration.

6. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Launching EC2 instance - Security Group Linux

For Windows, configuration is a little bit different.

7. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Launching EC2 instance - Security Group Windows

Review and launch

Review and launch your EC2 instance by pressing Launch button.

AWS will ask you to choose your SSH key (for more information about using SSH, check out the Top 10 SSH Features You MUST Know To Be More Productive article).

Use your existing SSH key or if you do not have any, choose Create New SSH Keypair and download it.

8. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Launching EC2 instance - Review and launch

Elastic IP

By default, AWS will provide a random public IP-address for your EC2 instance, which will be changed if you stop and start EC2 instance.

If you’d like to have a constant dedicated static IP-address, you have to use Elastic IP.

In your EC2 console, choose Elastic IPs.

9. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Launching EC2 instance - Elastic IP

Click Allocate Elastic IP address button.

You may proceed with default settings.

Click Allocate button.

10. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Launching EC2 instance - Allocate Elastic IP

Next, we need to associate obtained public IP-address with the EC2 instance.

11. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Launching EC2 instance - Associate Elastic IP - 1

Choose your EC2 instance from the list and click Associate button.

12. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Launching EC2 instance - Associate Elastic IP - 2

Now, you can use this static IP-address to connect to your Minecraft server.

Setting up Minecraft server on CentOS

SSH to your Minecraft server using centos as a hostname.

23. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - CentOS - SSH to the server

Before installing a new package, update your system packages: 

sudo yum update -y
24. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - CentOS - yum update

Now, install the Java on CentOS by running the command:

sudo yum install java -y
25. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - CentOS - yum install java

Check the installed version by typing the command:

java -version
26. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - CentOS - java version

To install tmux utility, use the following command:

sudo yum install tmux -y
27. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - CentOS - yum install tmux

Install wget to download new packages:

sudo yum install wget -y
28. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - CentOS - yum install wget

Create a minecraft folder and jump into it:

mkdir minecraft
cd minecraft
29. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - CentOS - mkdir minecraft

Copy and paste the command in the terminal to download the Minecraft server properties file:

wget https://launcher.mojang.com/v1/objects/bb2b6b1aefcd70dfd1892149ac3a215f6c636b07/server.jar
30. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - CentOS - wget server

Do not pay attention to the errors and execute the following commands to extract the properties and EULA files:

java -Xmx1024M -Xms1024M -jar server.jar nogui
31. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - CentOS - Server first launch

Use the nano editor to accept the Minecraft EULA license agreement:

nano eula.txt

Change eula value to true:

31. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - CentOS - nano eula

The easiest way to run Minecraft server in the background is by using Tmux (for more information about Tmux, check our article How To Start Using Tmux Like A Pro In 5 Minutes).

To run Minecraft server in the background, you need to run the tmux command first:

tmux

Now, run the Minecraft server:

java -Xmx1024M -Xms1024M -jar server.jar nogui
32. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - CentOS - server launch - 1


It will take up to a couple of minutes to launch the server completely.

33. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - CentOS - server launch - 2

To detach from the Tmux session press Ctrl+b then press d.

To reopen the Tmux session, type:

tmux attach -t 0

Setting up Minecraft on Ubuntu

SSH to your Minecraft server using ubuntu as a hostname.

13. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Launching EC2 instance - SSH Ubuntu server

Before installing any new packages, it is good to update package repositories:

sudo apt update
14. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Launching EC2 instance - apt-get update

Now, install the Java on Ubuntu by running the command:

sudo apt-get -y install default-jdk
15. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Launching EC2 instance - apt-get install default-jdk

Check the Java version:

java -version
16. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Launching EC2 instance - java version (ubuntu)

Create a directory minecraft and jump there.

mkdir minecraft
cd minecraft
17. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Ubuntu - mkdir minecraft

Copy and paste the command to get Minecraft server file:

wget https://launcher.mojang.com/v1/objects/bb2b6b1aefcd70dfd1892149ac3a215f6c636b07/server.jar
18. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Ubuntu - wget server

Use the following command to run Minecraft server:

java -Xmx1024M -Xms1024M -jar server.jar nogui

During the first run command will exit with the following errors:

  • [main/ERROR]: Failed to load properties from file: server.properties
  • [main/WARN]: Failed to load eula.txt
  • [main/INFO]: You need to agree to the EULA in order to run the server. Go to eula.txt for more info.

But at the same time it will create all required files.

19. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Ubuntu - first launch

Use the nano editor to accept the Minecraft EULA agreement:

nano eula.txt

Change eula value to true:

20. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Ubuntu - Accept EULA

The easiest way to run Minecraft server in the background is by using Tmux (for more information about Tmux, check our article How To Start Using Tmux Like A Pro In 5 Minutes).

To run Minecraft server in the background, you need to run the tmux command first:

tmux

Now, run the Minecraft server:

java -Xmx1024M -Xms1024M -jar server.jar nogui
21. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Ubuntu - Launch server in tmux - 1


It will take up to a couple of minutes to launch the server completely.

22. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Ubuntu - Launch server in tmux - 2

To detach from the Tmux session press Ctrl+b then press d.

To reopen the Tmux session, type:

tmux attach -t 0

Install Minecraft server on Windows

Use RDP to connect to you Windows 2019 EC2 instance, launch PowerShell and install Chocolatey:

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
38. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Windows - Install chocolatey

Install Java using the following command.

choco install javaruntime
39. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Windows - Install java

Open Windows Command Line interface by typing cmd and check installed Java version:

java -version
40. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Windows - Java version

Install Google Chrome browser:

choco install googlechrome
41. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Windows - Install Google Chrome

Now, in the Google Chrome browser download the Minecraft server from the official website: Minecraft Server Download | Minecraft.

Save “minecraft_server 1.16.5 jar” to the C:\minecraft folder:

42. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Windows - Download server

In the Windows Command Line go to C:\minecraft folder and launch the server:

cd C:\minecraft
java -Xmx1024M -Xms1024M -jar server.jar nogui
43. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Windows - Server launch - 1

In File Explorer open C:\minecraft folder and edit eula.txt file.

Change eula value to true.

44. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Windows - Server launch - 2

Now, run the Minecraft server in Windows Command Line interface once more again:

java –Xmx1024 –Xms1024M –jar srver.jar nogui
45. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Windows - Server launch - 3

Wait a couple of minutes while server is starting.

Windows Firewall configuration

By default, Windows EC2 instance has Windows Defender (firewall) enabled, which will prevent connections to your Minecraft server.

To enable connections to the server, launch wf.msc:

46. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Windows Firewall - wf.msc launch

Click to Incoming Rules and then New Rule action.

47. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Windows Firewall - New rule - 1

Choose Port configuration.

48. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Windows Firewall - New rule - 2

Specify port TCP/25565.

49. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Windows Firewall - New rule - 3

Choose Allow the connection from the list.

50. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Windows Firewall - New rule - 4

Enable the following networks:

  • Domain
  • Private
  • Public
51. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Windows Firewall - New rule - 5

Add the rule Name, for example, Minecraft server.

52. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Windows Firewall - New rule - 6

Now you’ll be able to connect to your Windows Minecraft server.

Testing Minecraft server

Install Minecraft client or use already existing one.

Now, add Minecraft server IP-address by clicking on the “Multiplayer” button. 

34. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Testing - Multiplayer

Then, click “Add server” button add server.

35. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Testing - Add server - 1

Enter your Minecraft server name and Server IP address and click Done button to connect to the server. 

36. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Testing - Add server - 2

Wait a couple of moments to connect with the server:

37. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Testing - Add server - 3

Once the server is connected, you are ready to play the game:

38. How to Setup a Minecraft Server on Ubuntu, Windows, and CentOS in AWS cloud - Testing - Gameplay

Potential issues

Lack of server resources

If you’re facing the following errors:

  • [Server thread/WARN]: Can’t keep up! Is the server overloaded? Running 11361ms or 227 ticks behind
  • [Server Watchdog/FATAL]: A single server tick took 64.97 seconds (should be max 0.05)
  • [Server Watchdog/FATAL]: Considering it to be crashed, server will forcibly shutdown.

You need to increase Minecraft server CPU and RAM resources by switching to a bigger instance type.

Conclusion

Minecraft is a sandbox video game that allows you to explore randomly generated landscapes and construct magnificent structures ranging from modest houses to massive castles. It was created by Mojang Studios and eventually purchased by Microsoft. Minecraft runs on different operating systems. In this write-up, we have demonstrated how to set up a Minecraft server on Ubuntu, CentOS, and Ubuntu. This guide will walk you through the process of setting up a Minecraft server on your preferred platform.

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Subscribe to our updates

Like this article?

Share on facebook
Share on Facebook
Share on twitter
Share on Twitter
Share on linkedin
Share on Linkdin
Share on pinterest
Share on Pinterest

Want to be an author of another post?

We’re looking for skilled technical authors for our blog!

Leave a comment

If you’d like to ask a question about the code or piece of configuration, feel free to use https://codeshare.io/ or a similar tool as Facebook comments are breaking code formatting.