Creating a Self-Hosted Minecraft Server with Fabric
Introduction
Fabric is a lightweight, modular modding toolchain for Minecraft. Running your own Fabric server gives you full control over which mods you install, how the server is configured, and who can join. This tutorial walks through setting up a Fabric Minecraft server from scratch on a Linux or Windows machine.
What You Will Need
Before starting, make sure you have the following.
- A computer or VPS to host the server
- Java 21 or later installed
- A stable internet connection
- Basic familiarity with the terminal or command prompt
Step 1 — Install Java
Fabric requires Java 21 or later for modern versions of Minecraft. Check if Java is already installed.
java -version
If Java is not installed, install it on Ubuntu or Debian with the following command.
sudo apt update && sudo apt install openjdk-21-jdk -y
On Windows, download and install the Java 21 JDK from https://adoptium.net.
Verify the installation after it completes.
java -version
Step 2 — Create a Server Directory
Create a dedicated folder for your server to keep everything organized.
On Linux run the following commands.
mkdir ~/minecraft-fabric-server
cd ~/minecraft-fabric-server
On Windows create a folder called minecraft-fabric-server somewhere convenient such as your Documents folder and open it.
Step 3 — Download the Fabric Installer
Go to https://fabricmc.net/use/installer and download the latest Fabric installer JAR file. Move it into your server directory.
Step 4 — Run the Fabric Installer
Open a terminal in your server directory and run the installer. Replace the filename with the actual version you downloaded.
java -jar fabric-installer-*.jar server -mcversion 1.21.1 -downloadMinecraft
Replace 1.21.1 with the Minecraft version you want to run. This command downloads the Minecraft server JAR and installs the Fabric server loader automatically.
When it finishes your directory will contain the following files.
fabric-server-launch.jar is the main launcher you will use to start the server. server.jar is the vanilla Minecraft server downloaded by the installer. fabric-server-launcher.properties points the launcher to the correct server JAR.
Step 5 — Accept the Minecraft EULA
Mojang requires you to accept their End User License Agreement before running a server. Start the server once to generate the eula.txt file.
java -jar fabric-server-launch.jar nogui
The server will stop immediately after generating the file. Open eula.txt in a text editor and change the following line.
eula=false
Change it to the following.
eula=true
Save and close the file.
Step 6 — Configure the Server
Start the server again to generate the server.properties file.
java -jar fabric-server-launch.jar nogui
Stop the server with Ctrl+C once it finishes loading. Open server.properties in a text editor to configure your server. The most important settings are the following.
server-port=25565 sets the port the server listens on. max-players=20 sets the maximum number of players allowed. gamemode=survival sets the default game mode. difficulty=normal sets the difficulty. level-name=world sets the name of the world folder. motd=A Minecraft Server sets the message shown in the server list. online-mode=true requires players to have a legitimate Minecraft account. Set this to false only for offline testing.
Save the file after making your changes.
Step 7 — Create the mods Folder
Fabric mods are placed in a mods folder inside your server directory. Create it now.
mkdir mods
Step 8 — Install Fabric API
Almost all Fabric mods depend on the Fabric API. Download it from https://modrinth.com/mod/fabric-api and place the JAR file into the mods folder.
Make sure you download the version that matches your Minecraft version.
Step 9 — Start the Server
Start your Fabric server with the following command.
java -Xmx2G -Xms1G -jar fabric-server-launch.jar nogui
The -Xmx2G flag sets the maximum RAM allocated to the server to 2GB. The -Xms1G flag sets the starting RAM to 1GB. Adjust these values based on how much RAM your machine has and how many players you expect.
The server will generate the world and load all mods. When you see the line Done in the console your server is running.
Step 10 — Create a Start Script
Instead of typing the full command every time, create a start script.
On Linux create a file called start.sh with the following content.
#!/bin/bash
java -Xmx2G -Xms1G -jar fabric-server-launch.jar nogui
Make it executable with the following command.
chmod +x start.sh
Run it with the following command.
./start.sh
On Windows create a file called start.bat with the following content.
java -Xmx2G -Xms1G -jar fabric-server-launch.jar nogui
pause
Double-click start.bat to launch the server.
Step 11 — Connect to Your Server
Open Minecraft on your client, go to Multiplayer, and click Add Server. Enter localhost as the address if connecting from the same machine, or enter your server machine's local IP address for other devices on the same network.
To find your local IP on Linux run the following command.
ip a
On Windows run the following command.
ipconfig
Step 12 — Opening Your Server to the Internet
To allow players outside your network to connect, you need to forward port 25565 on your router. Log into your router's admin panel (usually at 192.168.1.1 or 192.168.0.1) and create a port forwarding rule for TCP and UDP port 25565 pointing to your server machine's local IP address.
Players can then connect using your public IP address, which you can find by visiting https://whatismyip.com.
Useful Server Commands
The following commands can be typed directly into the server console.
op username gives a player operator privileges. deop username removes operator privileges. kick username removes a player from the server. ban username permanently bans a player. whitelist add username adds a player to the whitelist. whitelist on enables whitelist mode so only whitelisted players can join. stop shuts down the server safely.
Keeping the Server Running with Screen
On Linux you can use screen to keep the server running after you close your terminal.
sudo apt install screen -y
screen -S minecraft
./start.sh
Detach from the screen session with Ctrl+A then D. Reattach later with the following command.
screen -r minecraft
Conclusion
You now have a fully functional self-hosted Fabric Minecraft server. From here you can install mods by placing them in the mods folder and restarting the server. See the tutorial on installing mods on a Fabric server for a detailed guide on finding and managing mods.