Sign inSign up

xblaxk/minecraft_fabric

By xblaxk

•Updated about 2 years ago

This is a image to run fabric minecraft server

Image
Languages & frameworks
0

95

xblaxk/minecraft_fabric repository overview

⁠Minecraft Fabric Modloader Server Docker Repository

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.

⁠Features

  • Pre-configured Fabric Modloader: Automatically installs and configures Fabric modloader.
  • Customizable Server: Easily add and manage mods.
  • Persistent Data: Server data, including world files, are stored in a Docker volume, ensuring persistence between runs.
  • RCON Support: RCON (Remote Console) is enabled, allowing you to manage your server remotely via port 25575.
  • Resource Management: Configure the server’s memory usage with environment variables, allowing fine control over resource allocation.
  • Ease of Use: Quickly deploy a Minecraft server with Fabric using a single Docker command.

⁠Requirements

  • Docker installed on your system.
  • Basic understanding of Docker commands and Minecraft server configuration.

⁠How to Use

⁠Step 1: Pull the Docker Image

First, pull the Docker image from the repository:

docker pull xblaxk/minecraft_fabric:minecraft-version

Replace minecraft-version with the desired Minecraft version tag.

⁠Step 2: Create and Run the Container

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.
⁠Step 3: Access the Server

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.

⁠Step 4: Adding Mods

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.

⁠Step 5: Enable RCON on Your Minecraft Server

To enable RCON, follow these steps:

  1. 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
    
  2. 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.
  3. Save and Close the File: After editing, save the file and exit the editor.

  4. Restart the Server: Restart the server for changes to take effect:

    docker restart fabric-minecraft-server
    
  5. Connect via RCON: Use an RCON client to connect to your server using the IP address, RCON port (25575), and the password you set.

⁠Step 6: Managing the Server

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
⁠Step 7: Updating the 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
⁠Step 8: Contributing

Contributions are welcome! Please fork the repository and submit a pull request if you have any improvements or bug fixes.

⁠License

This project is licensed under the MIT License. See the LICENSE file for more details.

Tag summary

Content type

Image

Digest

sha256:a03826d01…

Size

238.8 MB

Last updated

about 2 years ago

docker pull xblaxk/minecraft_fabric:1.20.1