How to Build a Minecraft Paper Server Using AWS Lightsail

Posted by

How to Build a Minecraft Paper Server Using AWS Lightsail

Minecraft Server on AWS Lightsail

Minecraft is a globally popular sandbox game. If you want to enjoy it with friends, setting up a private server is a great option. In this post, we'll explore in detail how to build a Minecraft Paper server using AWS Lightsail.

1. What is AWS Lightsail?

AWS Lightsail is a virtual private server (VPS) service provided by Amazon Web Services (AWS). It's suitable for hosting simple web applications and websites, easy to use, and cost-effective.

AWS Lightsail Dashboard

2. What is a Paper Server?

Paper is a high-performance Minecraft server software based on Spigot. It offers better performance and optimization than Spigot and supports various plugins.

3. Creating an AWS Lightsail Instance

  1. Log in to your AWS account.
  2. Navigate to the Lightsail dashboard.
  3. Click the "Create instance" button.
  4. Choose the instance location. If you're using it in Korea, selecting the "Seoul" region is recommended.
  5. Select "Linux/Unix" as the platform.
  6. Under blueprints, select "OS Only" and then choose "Ubuntu 20.04 LTS".
  7. Choose an instance plan. For a Minecraft server, you need at least 2GB RAM, so select a plan above that.
  8. Specify an instance name and click the "Create instance" button.

Creating AWS Lightsail Instance

4. Configuring the Firewall

You need to configure the firewall to allow external access to the Minecraft server.

  1. Go to the management page of the created instance.
  2. Click on the "Networking" tab.
  3. In the "Firewall" section, click "Add rule".
  4. Select "Custom" for the application.
  5. Choose "TCP" as the protocol.
  6. Enter "25565" in the port range. (Default Minecraft port)
  7. Click the "Create" button.

AWS Lightsail Networking Settings

5. Connecting to the Instance

  1. Select the created instance from the Lightsail dashboard.
  2. Click on the "Connect" tab.
  3. Click the "Connect using SSH" button to launch the browser-based SSH client.

6. Installing Java

Java is required to run the Paper server. Install Java using the following commands:

sudo apt update
sudo apt install openjdk-17-jre-headless -y

After installation, check the Java version with:

java -version

7. Downloading and Setting Up the Paper Server

  1. Create and move to a directory to store the server files.
mkdir minecraft_server
cd minecraft_server
  1. Download the Paper server file. (Check the Paper official website for the latest version link)
wget https://papermc.io/api/v2/projects/paper/versions/1.19.4/builds/550/downloads/paper-1.19.4-550.jar
  1. Create a server launch script.
nano start.sh
  1. Enter the following content into the script:
#!/bin/bash
java -Xms1G -Xmx2G -jar paper-1.19.4-550.jar nogui
  1. Save and exit the script. (Ctrl+X, Y, Enter)

  2. Give execution permission to the script.

chmod +x start.sh

8. First Server Launch and Setup

  1. Launch the server for the first time with the following command:
./start.sh
  1. The server will create and immediately shut down. This is normal.

  2. Open the eula.txt file to agree to the license.

nano eula.txt
  1. Change eula=false to eula=true and save.

  2. Restart the server.

./start.sh

Minecraft Paper Server Startup

9. Optimizing Server Settings

You can modify the server.properties file to optimize the server's performance.

nano server.properties

Key settings include:

  • view-distance: Sets the server's rendering distance. The default is 10, but can be adjusted based on server performance.
  • max-players: Sets the maximum number of players that can connect simultaneously.
  • spawn-protection: Sets the protection range of the spawn area.
  • difficulty: Sets the game difficulty. (peaceful, easy, normal, hard)

10. Installing Plugins

One of the advantages of a Paper server is its support for various plugins. Here's how to install plugins:

  1. Stop the server. (Enter the stop command in the console)
  2. Move to the plugins folder.
  3. Download the .jar file of the desired plugin and place it in this folder.
  4. Restart the server.

Minecraft Plugin Icons

11. Running the Server in the Background

To keep the server running even after the SSH session ends, you can use the screen command.

  1. Install screen.
sudo apt install screen -y
  1. Create a new screen session and launch the server.
screen -S minecraft
./start.sh
  1. After the server starts, press Ctrl+A, D to detach the session.

  2. To reconnect later, use the following command:

screen -r minecraft

12. Backing Up the Server

Regular backups are crucial. Here's an example of a simple backup script:

#!/bin/bash
BACKUP_DIR="/home/ubuntu/backups"
SERVER_DIR="/home/ubuntu/minecraft_server"
BACKUP_NAME="minecraft_backup_$(date +%Y%m%d_%H%M%S).tar.gz"

# Create backup directory
mkdir -p $BACKUP_DIR

# Stop the server
screen -S minecraft -X stuff "say Server will stop for backup in 5 seconds.\n"
sleep 5
screen -S minecraft -X stuff "stop\n"
sleep 10

# Create backup
tar -czf $BACKUP_DIR/$BACKUP_NAME -C $SERVER_DIR .

# Restart the server
screen -S minecraft -X stuff "./start.sh\n"

echo "Backup completed: $BACKUP_NAME"

You can register this script as a cron job to run periodically.

Conclusion

You've now successfully built a Minecraft Paper server using AWS Lightsail! Through this server, you and your friends can explore and create in Minecraft's infinite world. Server management requires attention, so don't forget regular backups and updates.

Additionally, you can monitor the server's performance and upgrade the Lightsail instance specifications as needed. You can also connect a domain to make it easier to access.

Through operating a Minecraft server, you can learn a lot about Linux system management, network configuration, and game server optimization. Enjoy running your Minecraft server!

Minecraft Server Landscape

Leave a Reply

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다