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
Copy file name to clipboardExpand all lines: docs/configuration/server-properties.md
+35-4Lines changed: 35 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -238,15 +238,46 @@ By default an existing `server-icon.png` file will not be replaced, that can be
238
238
239
239
### RCON
240
240
241
-
RCON is **enabled by default** to allow for graceful shut down the server and coordination of save state during backups. RCON can be disabled by setting `ENABLE_RCON` to "false".
241
+
RCON is **enabled by default** to allow for graceful shut down of the server and coordination of save state during backups. RCON can be disabled by setting `ENABLE_RCON` to "false".
242
242
243
243
!!! warning
244
244
245
245
Disabling RCON will remove and limit some features, such as interactive and color console support.
246
246
247
-
The default password is randomly generated on each startup; however, a specific one can be set with `RCON_PASSWORD`.
247
+
#### RCON Password
248
248
249
-
**DO NOT MAP THE RCON PORT EXTERNALLY** unless you are aware of all the consequences and have set a **secure password** with `RCON_PASSWORD`.
249
+
The default password is randomly generated on each startup. However, you can specify a password using one of the following environment variables:
250
+
251
+
* Set `RCON_PASSWORD` to your desired password.
252
+
* Set `RCON_PASSWORD_FILE` to the path of a file containing the password.
253
+
254
+
Using `RCON_PASSWORD_FILE` is the recommended method for managing sensitive data, as it allows full support for [Docker Secrets](https://docs.docker.com/compose/how-tos/use-secrets/).
255
+
256
+
??? example
257
+
```yaml title="compose.yaml"
258
+
services:
259
+
mc:
260
+
image: itzg/minecraft-server:latest
261
+
pull_policy: daily
262
+
tty: true
263
+
stdin_open: true
264
+
ports:
265
+
- "25565:25565"
266
+
environment:
267
+
EULA: "TRUE"
268
+
RCON_PASSWORD_FILE: /run/secrets/rcon_pass # Points to the path where the secret is mounted
269
+
volumes:
270
+
# attach the relative directory 'data' to the container's /data path
271
+
- ./data:/data
272
+
secrets:
273
+
- rcon_pass
274
+
275
+
secrets:
276
+
rcon_pass:
277
+
file: ./rcon_password # local file containing the password
278
+
```
279
+
!!! warning
280
+
**BE CAUTIOUS OF MAPPING THE RCON PORT EXTERNALLY** unless you are aware of all the consequences and have set a **secure password**.
250
281
251
282
!!! info
252
283
@@ -444,4 +475,4 @@ When using `docker run` from a bash shell, the entries must be quoted with the `
The container can host an SSH console. It is enabled by setting `ENABLE_SSH` to `true`.
6
+
The SSH server only supports password based authentication. The password is the same as the RCON password.
7
+
8
+
!!! question
9
+
See [the RCON password](../configuration/server-properties.md/#rcon-password) section under configuration/server-properties for more information on how to set an RCON password.
10
+
11
+
The SSH server runs on port `2222` inside the container.
12
+
13
+
??? tip "Tip: Exposing the SSH port"
14
+
15
+
!!! warning "Security Implications"
16
+
By default, publishing ports in Docker binds them to all network interfaces (`0.0.0.0`), making the SSH console accessible to any device that can reach your host machine.
17
+
18
+
Since the SSH console grants **full administrative access** to your server, it is critical to use a strong [RCON password](../configuration/server-properties.md/#rcon-password).
19
+
20
+
If you wish to restrict access to the local machine only, refer to the [Docker documentation](https://docs.docker.com/engine/network/port-publishing/#publishing-ports) on binding to specific IP addresses (e.g., `127.0.0.1:2222:2222`).
21
+
22
+
If SSH access is only intended for inter-container connections, consider **NOT** forwarding the port to the host machine, and putting the containers in a shared [Docker network](https://docs.docker.com/engine/network/#user-defined-networks).
Copy file name to clipboardExpand all lines: docs/sending-commands/websocket.md
+15-6Lines changed: 15 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
---
2
-
title: With websocket
2
+
title: With WebSocket
3
3
---
4
4
5
-
With `WEBSOCKET_CONSOLE` set to `true`, logs can be streamed, and commands sent, over a websocket connection.
5
+
With `WEBSOCKET_CONSOLE` set to `true`, logs can be streamed, and commands sent, over a WebSocket connection.
6
6
The API is available on `/console`.
7
7
8
8
## Password
@@ -21,7 +21,16 @@ The listen address and port can be set with `WEBSOCKET_ADDRESS` (defaults to `0.
21
21
## Log history
22
22
When a connection is established, the last 50 (by default, configurable with `WEBSOCKET_LOG_BUFFER_SIZE`) log lines are sent with a `logHistory` type message.
23
23
24
-
??? tip "Tip: Remember to forward the websocket port on the host"
24
+
??? tip "Tip: Remember to forward the WebSocket port on the host"
25
+
26
+
!!! warning "Security Implications"
27
+
By default, publishing ports in Docker binds them to all network interfaces (`0.0.0.0`), making the WebSocket console accessible to any device that can reach your host machine.
28
+
29
+
Since the WebSocket console grants **full administrative access** to your server, it is critical to use a strong [WebSocket password](#password) or [RCON password](../configuration/server-properties.md/#rcon-password).
30
+
31
+
If you wish to restrict access to the local machine only, refer to the [Docker documentation](https://docs.docker.com/engine/network/port-publishing/#publishing-ports) on binding to specific IP addresses (e.g., `127.0.0.1:80:80`).
32
+
33
+
If WebSocket access is only intended for inter-container connections, consider **NOT** forwarding the port to the host machine, and putting the containers in a shared [Docker network](https://docs.docker.com/engine/network/#user-defined-networks).
25
34
26
35
```yaml title="compose.yaml"
27
36
services:
@@ -34,12 +43,12 @@ When a connection is established, the last 50 (by default, configurable with `WE
0 commit comments