Setting up a Minecraft server on Linode is a straightforward process that requires some basic understanding of server administration. You can sign up for a Linode account and choose a plan that suits your needs, with prices starting at $5 per month.
To get started, you'll need to create a new Linode instance, which can be done through the Linode Cloud Manager. This will give you a fresh start with a new server, ready to be configured for your Minecraft needs.
Linode offers a variety of distributions, including Ubuntu, which is a popular choice for Minecraft servers. You can select Ubuntu as your distribution during the setup process, and Linode will configure it for you.
Once your Linode instance is set up, you can connect to it using SSH and start configuring your server for Minecraft. This is where things can get a bit more involved, but don't worry, we'll walk you through it step by step.
You might enjoy: Move Azure Ad Connect to New Server
Prerequisites
To set up a Minecraft server on Linode, you'll need to meet some prerequisites. You must have a version of the Minecraft game client from Minecraft.net.
First, create a Linode account and a Compute Instance. You can find guides on how to do this on the Linode website. Updating your system is also essential; follow the guide on Setting Up and Securing a Compute Instance to update your Linode's software using the command `sudo apt update && sudo apt upgrade`.
Next, install OpenJDK and the GNU Screen package. This is necessary for Minecraft version 1.13, which is only compatible with OpenJDK 8. If you're using OpenJDK 7, you'll need to remove it first using the command `sudo apt remove openjdk-7-*`.
Create a new user for Minecraft to run as. You can do this using the command `sudo adduser minecraft` and assigning a secure password.
Here are the ports you'll need to know for your Linode Minecraft server:
- HTTPS: Port 443
- HTTP: Port 80
- SMTP email: Port 25
- Minecraft Server: 25565
- FTP or File Transfer Protocol: 21
Setup and Configuration
To set up a Linode Minecraft server, you'll need to configure your firewall to allow incoming traffic on the Minecraft port, which is 25565. This is done by adding a firewall rule using the ufw command.
You'll also want to install the necessary packages, including the Java runtime environment (default-jre), a text editor (vim or nano), ufw, screen, and wget. These packages will help you manage your server and download files.
To check what ports are currently listening, you can use the ufw command with the -t and -u arguments, which imply TCP and UDP, respectively. Here's a breakdown of the packages you'll need to install:
- default-jre: Java runtime environment
- vim or nano: Text editor
- ufw: Uncomplicated Firewall
- screen: Terminal multiplexor
- wget: File downloader
Update to Latest Version
To update your Minecraft server to the latest version, you'll need to make a few changes to your directory and files. Change your current working directory to /minecraft by running the command `cd /minecraft`.
Creating a backup of your world file is crucial in case something goes wrong. Run the command `sudo cp -r world world_backup` to create a copy of your world file.
A different take: Nextjs Server Actions File Upload
You should also create a backup of your `minecraft_server.jar` file. Run the command `sudo cp minecraft_server.jar minecraft_server.jar_backup` to create a copy of the file.
To get the latest version of the `minecraft_server.jar` file, visit the Minecraft Server download page and copy the URL to the .jar file. Then, run the command `sudo wget https://launcher.mojang.com/v1/objects/0a269b5f2c5b93b1712d0f5dc43b6182b9ab254e/server.jar` to download the updated file. This command updated the Minecraft server versions from 1.13 to 1.17.
Once you've updated your `minecraft_server.jar` file, you can restart your Minecraft server to start using the new version.
For another approach, see: How to Make a Server Hosting Website
Configure the Server
To configure the server, start by making sure the necessary packages are installed. You'll need the Java runtime environment, a terminal multiplexor, and a file downloader.
The Java runtime environment is installed with the command `default-jre`. This will allow you to run your Minecraft server. You can also install an editor like `vim` or `nano` to make it easier to manage your server.
A terminal multiplexor like `screen` is required to run the Minecraft server. This will allow you to detach from the server and reattach later if needed.
You'll also need a file downloader like `wget` to download files from the internet. This will come in handy when updating your server.
Here are the packages you'll need to install:
- default-jre (Java runtime environment)
- vim or nano (editor)
- screen (terminal multiplexor)
- wget (file downloader)
If you're planning to use the Bedrock server, you'll want to make sure you have the necessary packages installed. However, if you're using the Java server, you can follow the instructions for installing the Java server on Linode via the Marketplace.
Server Management
To manage your Linode Minecraft server, you'll want to run the server from a GNU Screen session to ensure it keeps running even if your SSH connection drops. This can be done by executing `screen /home/minecraft/run.sh` after opening the `eula.txt` file and setting `eula` to `true`.
To disconnect from the screen session without stopping the server, press `CTRL+a` and then `d`. To reconnect later, use the command `screen -r`.
If you need to customize your game settings, you can do so by modifying the `server.properties` file. This file is created by default when you run the Minecraft server, and it contains various settings such as the world seed and spawn protection.
Here are some recommended settings to change in the `server.properties` file:
- `spawn-protection=16`: Change this to `0` for easier gameplay with friends.
- `enforce-whitelist=false`: Set this to `true` to restrict access to your server.
- `server-ip=`: Set this to your server's IP address.
- `view-distance=10`: Change this to `16` for better performance, but be aware of potential lag issues.
By following these steps and modifying the `server.properties` file, you can optimize your Minecraft server for a better experience.
Security and Access
Security is a top priority for any Minecraft server, and Linode's servers are no exception. Your server's firewall is the first line of defense against unauthorized access.
To understand your firewall, think of it as a gatekeeper that separates your Minecraft's internal network from the external internet. By default, your router acts as the firewall, blocking all incoming requests except for SSH traffic.
You can add a firewall rule using the ufw command to allow traffic to pass through port 25565, which is used for Minecraft connections. You can also use the ufw command to check what ports are currently listening on your server.
To do this, run the following command: `sudo ufw status`, which will show you the current firewall rules. If you want to see which ports are listening, you can use the `sudo ufw status verbose` command. This will give you a detailed list of all the ports that are currently open.
Here's a breakdown of the ufw command arguments:
- -t implies TCP
- -u implies UDP
By configuring your firewall correctly, you can ensure that only authorized players can connect to your Minecraft server.
Configure Your Firewall
Your router acts as your firewall, preventing anyone on the internet from accessing your Minecraft server by default. This means you need to enable traffic to pass through the port Minecraft uses, which is port 25565.
To do this, you can add a firewall rule using the ufw command. You can also add a port number to the IP address as a safety measure.
You can check what ports are currently listening by running the command `netstat -t -u`. This will show you a list of active ports, including the ones used by your Minecraft server.
Here are the arguments used in the command:
- -t implies TCP
- -u implies UDP
By configuring your firewall correctly, you can ensure that only authorized traffic reaches your Minecraft server, keeping it secure and protected from unwanted access.
Whitelists and Admins
To connect to the screen session, you need to whitelist yourself and give yourself admin privileges.
You'll know you're in the right place when the bottom line says "[done]". If it doesn't say that, just wait until the server finishes loading.
To add users to the whitelist, you'll need to wait until the server is fully loaded. Once it is, you can start issuing Minecraft server commands.
The key is to be patient and let the server do its thing.
Frequently Asked Questions
How many GB of RAM do you need for a Minecraft server?
For a small Minecraft server with up to 10 players, 4-6 GB of RAM is recommended. Larger servers may require 8 GB or more to prevent lag and ensure a smooth gaming experience.
Sources
- https://github.com/linode/docs/blob/develop/docs/guides/game-servers/how-to-set-up-minecraft-server-on-ubuntu-or-debian/index.md
- https://dev.to/samerickson/choosing-a-host-24m4
- https://albriggs.com/blog/2020/06/29/linode-minecraft-config/
- https://www.slideshare.net/slideshow/your-own-minecraft-server-on-a-linode-vps-25914050/25914050
- https://dev.to/samerickson/how-to-create-a-minecraft-server-setting-up-the-actual-server-eod
Featured Images: pexels.com