You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# GuardCraft - Guarded Containerized Minecraft Server
2
+
3
+
GuardCraft is a containerized Minecraft (Java) server that is designed to be secure and easy to use. It is built on top of the [Java JRE Chainguard Image](https://images.chainguard.dev/directory/image/jre/versions).
4
+
5
+
## Features
6
+
The GuardCraft server is designed to be secure and easy to use. It includes the following features:
7
+
- Minimal container image with low-to-zero CVEs
8
+
- Easy configuration with environment variables
9
+
- Easy setup with Docker Compose
10
+
11
+
Currently, Guardcraft is available only for Minecraft Java version.
12
+
13
+
*This setup was validated on an Ubuntu 24.04 system.*
14
+
15
+
### GuardCraft Resource Pack
16
+
This is a WIP feature that will be available *SOON*.
17
+
18
+
## Usage
19
+
To build the image, run:
20
+
21
+
```shell
22
+
docker build -t guardcraft-java .
23
+
```
24
+
25
+
Use the following command to run the image in your local environment:
26
+
27
+
```shell
28
+
docker compose up
29
+
```
30
+
You should be able to see output with relevant information about the server setup:
java-server-1 | [18:11:15] [Server thread/INFO]: Starting Minecraft server on *:25565
51
+
...
52
+
```
53
+
54
+
Once the server is up and running, you can connect to it using a Minecraft Java client **on the same local network**.
55
+
56
+
To connect to the server, you'll need to add a new server using the host machine's local IP address and port `25565` (the default port). You can also use the `localhost` address if you're running the server on the same machine as the client.
57
+
58
+
> Find your local IP address on Linux systems: `ip -o route get to 8.8.8.8 | sed -n 's/.*src \([0-9.]\+\).*/\1/p'`
59
+
60
+

61
+
When connecting, you should see details about your user on the server logs:
62
+
63
+
```shell
64
+
java-server-1 | [18:12:21] [Server thread/INFO]: Server empty for 60 seconds, pausing
65
+
java-server-1 | [18:14:29] [User Authenticator #1/INFO]: UUID of player boredcatmom is xxxxx-xxxx-xxxx-xxxx-xxxxxxxx
66
+
java-server-1 | [18:14:30] [Server thread/INFO]: boredcatmom[/192.168.178.167:37192] logged in with entity id 78 at (20.5, 66.0, 4.5)
67
+
java-server-1 | [18:14:30] [Server thread/INFO]: boredcatmom joined the game
68
+
69
+
````
70
+
71
+
## Configuration
72
+
The GuardCraft server can be configured using dynamic environment variables that get replaced in the `server.properties` file. Any properties can be configured with the following format: `MC_<property_name>`. Hyphens (`-`) should be replaced with underscores (`_`). For example, to set the `server-port` property, use the `MC_server_port` environment variable.
73
+
74
+
Included `docker-compose.yaml` file:
75
+
76
+
```yaml
77
+
services:
78
+
java-server:
79
+
image: guardcraft-java
80
+
restart: unless-stopped
81
+
ports:
82
+
- 25565:25565
83
+
environment:
84
+
# Server properties Set Up
85
+
# MC_* variables will be replaced in the server.properties file
86
+
# Hyphens should be replaced with underscores
87
+
MC_gamemode: "survival"
88
+
MC_difficulty: "easy"
89
+
MC_motd: "Welcome to GuardCraft!"
90
+
MC_level_name: "GuardCraft"
91
+
MC_level_seed: "-1718501946501227358"
92
+
```
93
+
94
+
This will set up a server in**Survival** mode, with **Easy** difficulty, and a **Welcome to GuardCraft!** message of the day. The server will be named **GuardCraft** and will use the specified seed to generate the world. You should spawn in an area with a village nearby.
0 commit comments