#To install a minecraft server run this:
curl -fsSL https://raw.githubusercontent.com/MrScratchcat/minecraft-server-builder/refs/heads/main/server-creator.sh | bashSupported server types: Vanilla, Fabric, Forge and NeoForge.
Version lists are fetched live from Mojang, Fabric, Forge and NeoForge, so new releases are available immediately without updating the script. The matching Java version for the chosen Minecraft version is picked automatically.
Mods only work on Fabric, Forge and NeoForge servers (not Vanilla), and every mod has to match your Minecraft version and your loader — a Forge 1.20.1 mod will not load on NeoForge or Fabric. Most content mods also need to be installed in each player's client; only server-side mods (backups, performance, admin tools) work with normal vanilla clients.
sudo docker cp mymod.jar minecraft-server-container:/minecraft/mods/
sudo docker restart minecraft-server-containerIf the mods folder does not exist yet, create it first:
sudo docker exec minecraft-server-container mkdir -p /minecraft/modsMods added this way survive restarts, but they are lost if you ever delete and recreate the container, because only the world folder is on a persistent volume.
Create the container with an extra -v flag that points a folder on your
computer at /minecraft/mods:
mkdir -p ~/minecraft-mods
sudo docker rm -f minecraft-server-container # remove the old container (your world is safe on its volume)
sudo docker run -d \
--name minecraft-server-container \
-p 25565:25565 \
-v minecraft-data-:/minecraft/world \
-v ~/minecraft-mods:/minecraft/mods \
--restart always \
minecraft-serverNow adding a mod is just: drop the jar into ~/minecraft-mods and run
sudo docker restart minecraft-server-container. Nothing is lost when the
container is recreated.
Tip: run sudo docker inspect minecraft-server-container | grep -A3 Mounts
before removing the container to see the exact name of your world volume, and
use that name in the -v flag so the new container keeps your world. If you
used a different port or container name during setup, adjust the commands to
match.