For the complete documentation index, see llms.txt. This page is also available as Markdown.

19.2 Minecraft Server

Minecraft is a sandbox game developed in Java. This section covers deploying the Minecraft server on FreeBSD. Setting up the server requires installing the Java runtime environment first; the server and client typically require the same Java version.

/
├── etc/
   └── rc.conf # System configuration file, includes minecraft service configuration
├── usr/
   └── local/
       ├── bin/
          └── minecraft-server # Minecraft server executable
       └── etc/
           └── minecraft-server/ # Minecraft server configuration directory
               ├── eula.txt # End-user license agreement file
               ├── java-args.txt # Java parameters configuration
               └── server.properties # Server configuration file
├── var/
   ├── log/
      └── minecraft-server/ # Log and debug output directory
   └── db/
       └── minecraft-server/ # World files directory

Installing OpenJDK

Note that outdated JDK versions are not supported by the server. This section was tested with JDK 21 and runs normally.

Install OpenJDK 21 using pkg:

Or compile and install OpenJDK 21 using Ports, which can be optimized for server hardware:

Using Ports or the Official Server Program

There are two ways to set up a Minecraft server:

Testing has confirmed that the Minecraft official server is a pure Java program that runs directly on FreeBSD 15.0 after installing OpenJDK. The Ports version provides FreeBSD-specific integration, including service management scripts and default configuration files.

You can also use games/minecraft-server available in Ports:

View configuration information:

Run the server:

The prompt indicates that you need to agree to the license agreement. Change eula=false to eula=true in the /usr/local/etc/minecraft-server/eula.txt file.

Run the installed Minecraft server program again:

Press Ctrl + C to interrupt the program.

Disabling Online Authentication

Under the current default configuration, the server has online authentication enabled (online-mode=true). This mechanism communicates with the Mojang session server and Microsoft authentication service to verify player identity, ensuring:

  • Each player has a unique UUID assigned by Mojang/Microsoft, bound to their purchased account

  • Players cannot log in using another person's username

  • Bans and permission management are based on real account identity

Warning

You should only use online-mode=false when you fully understand the risks and have deployed additional protective measures.

If you need to allow players who have not purchased the game to connect in a LAN or testing environment, edit the /usr/local/etc/minecraft-server/server.properties file and change online-mode=true to online-mode=false.

Then run the installed Minecraft server program again:

Running Minecraft on FreeBSD

Security Risks of Disabling Online Authentication

Completely disabling Mojang/Microsoft account verification introduces the following serious security risks:

  1. Administrator account impersonation: Anyone can enter an administrator (OP) username to log in directly, gaining full administrative privileges, items, and territories on the server. Since UUIDs are generated locally based on usernames (OfflinePlayer:username), the server cannot distinguish between a real administrator and an impersonator.

  2. Bans become completely ineffective: Banned users only need to change their username to rejoin without purchasing a new account, rendering the ban mechanism useless.

  3. Whitelist becomes ineffective: In offline mode, the whitelist only checks usernames rather than account identity, and cannot prevent impersonation.

  4. Extremely low barrier for bot attacks: Attackers can generate random usernames in bulk for automated attacks without purchasing any Minecraft accounts.

  5. Player data loss risk: In offline mode, UUIDs are bound to usernames rather than accounts. If a player changes their username, all their items, builds, permissions, and other data will be permanently lost.

  6. Risk of violating the Minecraft EULA: Allowing players who have not purchased the game to connect may violate Mojang's End User License Agreement.

  7. Skins and licensed features unavailable: In offline mode, all players' appearances display as the default Steve/Alex skins.

If you genuinely need to use offline mode (e.g., in a closed LAN environment, or when using BungeeCord/Velocity proxy forwarding), the following mitigation measures are recommended:

  • Install authentication plugins (such as AuthMeReloaded) to require players to register passwords, preventing username impersonation

  • Use firewall restrictions to allow only trusted IP ranges to connect

  • Use plugins like CoreProtect to log all block operations for traceability and rollback

  • Use permission plugins like LuckPerms for fine-grained permission control, avoiding the * wildcard

  • Regularly back up world data

Last updated