xblaxk/minecraft_fabric
This is a image to run fabric minecraft server
28
This Docker repository provides a pre-configured environment for creating and managing Minecraft servers using the Fabric modloader. Fabric is a lightweight and modular modding toolchain that allows you to customize your Minecraft experience. This Docker setup simplifies the process of setting up a Fabric server by automating many of the required steps.
First, pull the Docker image from the repository:
docker pull xblaxk/minecraft_fabric:minecraft-version
Replace minecraft-version
with the desired Minecraft version tag.
To create and run the container with a mounted volume and memory limits, use the following command:
docker run -d \
-p 25565:25565 \
-p 25575:25575 \
-v MyFabricServer:/minecraft_server \
-e JAVA_MIN_HEAP_MB=256 \
-e JAVA_PERCENTAGE_MAX_HEAP=90 \
--memory="8g" \
--name fabric-minecraft-server \
xblaxk/minecraft_fabric:minecraft-version
Explanation of the Command:
-d
: Runs the container in detached mode.-p 25565:25565
: Maps the Minecraft server port to the host.-p 25575:25575
: Maps the RCON port to the host, allowing remote server management.-v MyFabricServer1.20.1:/minecraft_server
: Creates a Docker volume named MyFabricServer1.20.1
and mounts it to /minecraft_server
inside the container. This volume will store all server data persistently.-e SERVER_NAME="MyFabricServer"
: Sets the server name.-e JAVA_MIN_HEAP_MB=256
: Sets the minimum heap size for the JVM to 256 MB. Default: 256-e JAVA_PERCENTAGE_MAX_HEAP=90
: Sets the maximum heap size for the JVM as 90% of the total container memory. You can adjust this value as needed. Default 90%--memory="2g"
: Limits the maximum amount of RAM the container can use to 2 GB. Adjust this value based on your server's available resources.--name fabric-minecraft-server
: Names the Docker container.After running the container, your Minecraft server should be accessible via localhost:25565
(or replace localhost
with your server's IP address if running on a remote machine). You can manage the server remotely using RCON on localhost:25575
.
To add mods to your Fabric server, simply place the .jar
files into the /minecraft_server/mods
directory inside the container. If you're working from the host machine:
docker cp /path/to/mods/your-mod.jar fabric-minecraft-server:/minecraft_server/mods/
These mods will be automatically loaded the next time you start the server.
To enable RCON, follow these steps:
Locate the server.properties
File: The server.properties
file is located in the /minecraft_server
directory inside the container. You can access it by running:
docker exec -it fabric-minecraft-server vi /minecraft_server/server.properties
Edit the server.properties
File: Open the file and configure the following settings:
rcon.port=25575
rcon.password=your_secure_password
enable-rcon=true
rcon.port
: The port RCON will use (default 25575
).rcon.password
: Set a secure password for RCON access.enable-rcon
: Set this to true
to enable RCON.Save and Close the File: After editing, save the file and exit the editor.
Restart the Server: Restart the server for changes to take effect:
docker restart fabric-minecraft-server
Connect via RCON: Use an RCON client to connect to your server using the IP address, RCON port (25575
), and the password you set.
To stop the server, run:
docker stop fabric-minecraft-server
To start the server again:
docker start fabric-minecraft-server
To view server logs:
docker logs -f fabric-minecraft-server
To update your server to a new Minecraft version, pull the appropriate image and recreate the container:
docker pull xblaxk/minecraft_fabric:new-minecraft-version
docker stop fabric-minecraft-server
docker rm fabric-minecraft-server
docker run -d \
-p 25565:25565 \
-p 25575:25575 \
-v MyFabricServer:/minecraft_server \
-e JAVA_MIN_HEAP_MB=256 \
-e JAVA_PERCENTAGE_MAX_HEAP=90 \
--memory="8g" \
--name fabric-minecraft-server \
xblaxk/minecraft_fabric:minecraft-version
Contributions are welcome! Please fork the repository and submit a pull request if you have any improvements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for more details.
docker pull xblaxk/minecraft_fabric