> For the complete documentation index, see [llms.txt](https://docs.aethercube.fr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aethercube.fr/developers/running-a-server/online-mode-tls-and-directory.md). Agents can also search and read this documentation through its [MCP server](https://docs.aethercube.fr/~gitbook/mcp).

# Online mode, TLS and the directory

Read this page when you want to open your server to the public: how players prove who they are, how the connection is secured and how the server gets listed.

## Online and offline mode

|                         | `online_mode: true` (default)                                         | `online_mode: false`                                                    |
| ----------------------- | --------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| Identity                | An account. The client presents a single-use ticket from the backend. | A name chosen by the player. Nobody checks it.                          |
| Backend                 | The server verifies each ticket and sends heartbeats.                 | Not used.                                                               |
| TLS                     | A real certificate chain and key.                                     | `tls.self_signed` is allowed.                                           |
| Directory               | Listed when `master.enabled` is `true`.                               | Never listed. `master.enabled` must be `false`.                         |
| Profile id              | The account id.                                                       | Derived from the name, so the same name gets the same profile.          |
| `permissions.operators` | Ignored.                                                              | Applied at every start, unless `server.allow_public_offline` is `true`. |

Offline mode is for development and private use, and the server logs a warning at every start to remind you. Never expose an offline server to the Internet: anyone can join under any name, an operator's included.

### Offline mode on a public address

An offline server only starts when `server.bind_address` is a loopback address (`127.0.0.1` or `::1`). The default `bind_address` is `0.0.0.0`, so with `online_mode: false` you must set `bind_address: 127.0.0.1`, or the server prints this and exits with status 2:

```
server.online_mode is false and server.bind_address (0.0.0.0) is not a loopback address: offline mode has no authentication, anyone could join under any name, operators included. Bind to 127.0.0.1, enable server.online_mode, or set server.allow_public_offline: true if this server is really meant to be open
```

If the server really is meant to be open, for example on a LAN with friends you trust, set `server.allow_public_offline: true`. It defaults to `false`. With it, the server starts and logs `OFFLINE MODE on <address> (server.allow_public_offline)` as a warning. Two things change:

* Names in `permissions.operators` are **not** made operators. On an open server anyone could type one of those names, so the list would hand out operator rights to a stranger. Give operator rights from the console instead (`permissions op <name>`), and keep in mind that a name proves nothing.
* Everything else about offline mode stays: no authentication, same name, same profile.

Prefer online mode as soon as people you do not know can reach the port.

## Registering a server

A public server needs an identity on the backend.

1. An operator of the backend registers the server with `POST /api/v1/master/servers/register`, using an operator bearer token. The answer holds a `server_id` and a `server_secret`. The secret is shown once.
2. Put the id in `backend.server_id`.
3. Save the secret in the file named by `backend.secret_file`, alone on its line. On POSIX systems set the mode to `600`: the server refuses a file that group or others can read.
4. Set `backend.endpoint` to the backend's HTTPS address. Plain `http` is accepted only when the host is a loopback address (`127.0.0.1`, `::1`, `localhost`), for a backend running on the same machine. Anything else is refused at start-up, because tickets and signed requests would cross the network in clear.

Heartbeats are signed with HMAC using that secret. Never put the secret in `server.yml`.

## TLS

The server accepts TLS 1.3 only. There is no plaintext port.

```yaml
tls:
  certificate_chain: config/tls/fullchain.pem   # PEM chain
  private_key: config/tls/privkey.pem           # PEM, PKCS#8
```

If your key is in another format, convert it to PKCS#8 first.

The server logs the BLAKE3 hash of its public key at every start (`TLS certificate SPKI BLAKE3`). Clients can pin it. A directory entry can carry this hash as `tls.spki_blake3`.

| Certificate                                            | What the client needs                      |
| ------------------------------------------------------ | ------------------------------------------ |
| Issued by a public authority, for the name players use | Nothing. The system trust store is enough. |
| Self-signed or private authority                       | The SPKI hash, to pin.                     |

## Ports

| Port           | Default | Protocol     | Expose it                               |
| -------------- | ------- | ------------ | --------------------------------------- |
| `server.port`  | 25565   | TCP, TLS 1.3 | Yes.                                    |
| `metrics.port` | 9464    | HTTP         | No. Loopback or a private network only. |

The backend's own ports are not part of the game server.

## The directory

With `master.enabled: true` and `online_mode: true`, the server sends a signed heartbeat every `master.heartbeat_interval_seconds` (5 to 15, default 10). The backend accepts one heartbeat per 5 seconds and drops the entry after 20 seconds without one.

The listing's metadata is managed on the backend. The public side of the directory is described in [Server directory](https://docs.aethercube.fr/developers/backend-api/directory.md).

At shutdown the server unregisters from the directory.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.aethercube.fr/developers/running-a-server/online-mode-tls-and-directory.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
