
This guide will explain setting up a Minecraft server on FreeBSD 13.
You'll need to install the following packages:
Run the following command to install all of the necessary packages:
Once completed, run the following command to verify the installation of the JDK:
If you see the following, you can proceed to the next step:
To add an extra layer of security, set up a firewall. This will reduce the attack surface of your server. Furthermore, it'll also mitigate Log4Shell (if you happen to use an older version of Minecraft) and SSH brute force attempts.
In this guide, you'll use Packet Filter (PF) as it comes pre-installed on FreeBSD. To get started, run the following commands to enable PF and its logging service:
Next up edit /etc/pf.conf via the following command:
Then paste the following rulesets into the file:
Exit nano by pressing Ctrl+X, then Y. to save the file.
Finally, start the firewall:
Note: You might need to reconnect to your SSH session.
It is recommended to create a new user specifically for your server to ensure that the Minecraft server does not have root access. Giving a server or application root access poses a security risk.
To create a new user, run the following command and follow everything being prompted:
Once finished, switch to that user (change minecraft with the name of the user you created):
Run the following commands to download Minecraft 1.18.1:
You can find the download link for the latest version on the Minecraft website
This applies to any server after version 1.7.9. By running this command, you agree to the Mojang EULA.
To start, create a file called startup.sh and populate it with the following:
Save the file, then make it executable:
Finally, run the following command to start the server:
If all is successful, you will be able to connect to the IP address of your VPS with the Minecraft Java game client. You have just set up Minecraft on FreeBSD 13.
0 Comments
Be the first to comment and share your perspective with the community.