Sign inSign up

dm0275/minecraft-server

By dm0275

•Updated 10 months ago

Image
Web servers
1

7.6K

dm0275/minecraft-server repository overview

⁠Minecraft Server

⁠Overview

This Docker image offers a customizable Minecraft server, supporting both Vanilla and Forge editions. For more information, please visit this GitHub repository⁠.

⁠Configurable Settings (via environment variables)

SettingDefault ValueNotes
JAVA_MIN_MEM1G
JAVA_MAX_MEM2G
GAMEMODE0See notes on acceptable values
MAXPLAYERS20
DIFFICULTY1See notes on acceptable values
MOTDDocker Minecraft ServerMessage to be displayed in the server list of players.
ENABLE_CMD_BLOCKnull
MAX_TICK_TIME60000
GENERATOR_SETTINGSnull
ALLOW_NETHERtrue
FORCE_GAMEMODEfalse
ENABLE_QUERYfalse
PLAYER_IDLE_TIMEOUT0
SPAWN_MONSTERStrue
OP_PERMISSION_LEVEL4
PVPtrue
SNOOPER_ENABLEDtrue
LEVEL_TYPEDEFAULT
HARDCOREfalse
NETWORK_COMPRESSION_THRESHOLD256
RESOURCE_PACK_SHA1null
MAX_WORLD_SIZE29999984
SERVER_PORT25565
SERVER_IPnull
SPAWN_NPCStrue
ALLOW_FLIGHTfalse
LEVEL_NAMEworld
VIEW_DISTANCE10
RESOURCE_PACKnull
SPAWN_ANIMALStrue
WHITE_LISTfalse
GENERATE_STRUCTUREStrue
ONLINE_MODEtrue
MAX_BUILD_HEIGHT256
LEVEL_SEEDnull
PREVENT_PROXY_CONNECTIONSfalse
USE_NATIVE_TRANSPORTtrue
ENABLE_RCONfalse

Gamemode: Survival mode is gametype=0, Creative is gametype=1, Adventure is gametype=2, and Spectator is gametype=3

Difficulty: Defines the difficulty (such as damage dealt by mobs and the way hunger and poison affects players) of the server. Possible values are 0 (Peaceful)-3(Hard)

⁠Usage

The recommended method to start Minecraft servers is by using the mcrun CLI tool, which can be downloaded from here⁠.

To start a Forge server, use the following command:

mcrun forge start --world-name <world_name>

Additional flags are also available to customize the server configuration:

Usage:
  mcrun forge start [flags]

Flags:
      --enable-cmd-block    Enable Command Block (default: true)
      --gamemode string     Set Gamemode: 0 for Survival, 1 for Creative, 2 for Adventure, and 3 for Spectator (default: "0")
  -h, --help                Display help for the start command
      --max-memory string   Set maximum memory limit (default: "3G")
      --min-memory string   Set minimum memory limit (default: "3G")
      --port string         Specify server port (default: "25565")
      --seed string         Set Minecraft world seed
      --version string      Specify Minecraft version (default: "forge-1.20.1")
      --world-name string   Set a name for the Minecraft server

Alternatively, you can run the server directly using Docker:

docker run --rm -d -e JAVA_MIN_MEM=3G -e JAVA_MAX_MEM=3G \
    -e GAMEMODE=1 -e MAX_PLAYERS=10 \
    -v $WORLD_DIR:/opt/minecraft/world -v $MODS_DIR:/opt/minecraft/mods -p 25565:25565 \
    dm0275/minecraft-server:latest

Or via Docker Compose

version: '3'

services:
  minecraft:
    image: "dm0275/minecraft-server:latest"
    container_name: minecraft
    ports:
      - "$PORT:25565"
    volumes:
      - $WORLD_DIR:/opt/minecraft/world
      - $DATA_DIR:/opt/minecraft/data
      - $MODS_DIR:/opt/minecraft/mods
    environment:
      - GAMEMODE
      - MAX_PLAYERS
volumes:
  world: {}
  data: {}
  mods: {}

Tag summary

Content type

Image

Digest

sha256:c852ea1ed…

Size

667.3 MB

Last updated

10 months ago

docker pull dm0275/minecraft-server