Quickly Set Up a Minecraft Server on macOS + Docker
Operating a Minecraft server has become a fundamental skill it seems, so I'll jot down how to create one. (Source: Me) I hope to write a proper article someday, but for now, I'll just write it casually.
Setting Up a Minecraft Server is a Hassle
It’s nostalgic to think about the days of doing all sorts of things like Forge and Java. Fortunately, now you can run a Minecraft server, backups, and other features with just docker compose up. I think this is good enough for quickly setting up a server.
Install Orbstack
This phrase might sound unfamiliar, but just think of it as Docker.
You can consider this a replacement for Docker Desktop that works on macOS.
Create a Docker Compose
We will create a Docker compose file.
version: "3.8"
networks:
mc-network:
name: mc-network
driver: bridge
services:
mc:
image: itzg/minecraft-server:latest
tty: **true**
stdin_open: **true**
ports:
- "25565:25565"
- "25575:25575"
environment:
EULA: "TRUE"
TYPE: "FABRIC"
VERSION: "1.20.1"
# Various settings. Server configurations are specified as environment variables. Refer to the official documentation.
FABRIC_LOADER_VERSION: "0.16.10"
MEMORY: "16G"
MAX_PLAYERS: "100"
MOTD: "{Server Name}"
ICON: "{Any Icon}"
OVERRIDE_ICON: "true"
ONLINE_MODE: "true"
USE_AIKAR_FLAGS: "true"
TZ: "Asia/Tokyo"
FORCE_GAMEMODE: "true"
SIMULATION_DISTANCE: "32"
VIEW_DISTANCE: "32"
SPAWN_PROTECTION: "0"
PREVIEWS_CHAT: "true"
ALLOW_FLIGHT: "true"
RCON_PASSWORD: "admin"
volumes:
- "./data:/data"
networks:
- mc-network
rcon-web:
image: itzg/rcon
restart: "always"
ports:
- "4336:4326"
- "4337:4327"
environment:
RWA_USERNAME: admin
RWA_PASSWORD: admin
RWA_ADMIN: "TRUE"
# Refers to the hostname of 'mc' compose service below
RWA_RCON_HOST: mc
# Must match the RCON_PASSWORD configured for the container
RWA_RCON_PASSWORD: "admin"
networks:
- mc-network
backups:
image: itzg/mc-backup
restart: "always"
environment:
INITIAL_DELAY: "1m"
BACKUP_INTERVAL: "3h"
RCON_HOST: mc
RCON_PORT: "25575"
RCON_PASSWORD: "admin"
volumes:
- ./data/world:/data
- ./backups:/backups
networks:
- mc-network
# Volume settings (You don't have to change this if you don't care)
volumes:
mc: {}
Sample Images Used in YAML
This is just one example, so you can add various things to this or perhaps you only need the server part.
itzg/minecraft-server:latest
- The Minecraft server runs completely on this one image. https://docker-minecraft-server.readthedocs.io/en/latest/#using-docker-compose
itzg/mc-backup
- This image creates backups at regular intervals. There is a unique communication form called RCON (Remote Console) used by Minecraft, which saves the world automatically.
itzg/rcon
- This allows you to use rcon on the web.
- You can send commands from the web and perform various operations, making it very convenient.
- It makes server management easier. You might also consider integrating with Cloudflare Tunnel.
0 people clapped 0 times
Related articles
💻 Let's Try Team Development on GitHub
Let's Try Team Development on GitHub
For those of you who have registered an account on GitHub but haven't used it because you're not a developer, I've written a brief article explaining how to use it.
🤖 Let's Read Google Sheets via API!
Let's Read Google Sheets via API!
This is a re-publication of an article I wrote on another site last year.
It's super easy. I'll...
🍳 XR's Use May Be Like a HUD — Let's Cook with AI
XR's Use May Be Like a HUD — Let's Cook with AI
I borrowed an inmo XR, an Android-based XR headset, from Ukai (known from Mitou Junior) and did a small hackathon. After struggling to find a use, I built an AI-powered cooking assistant to enjoy cooking with an AI. Here I introduce my attempt to cook with AI using the XR glasses.
🗓️ Thoughts on Life Logging Systems
Thoughts on Life Logging Systems
With the advancement of LLMs, it has become easier to verbalize human behavior and analyze conversations with others. However, I felt that none of it quite fit, so I thought about various aspects from both technical and usability perspectives.