---
title: "Configuration · Mesh"
description: "Configure the relay through the command-line arguments supported by the Docker entrypoint."
canonical_url: "https://www.mesh-network.org/docs/configuration"
locale: en
meta:
  "og:description": "Configure the relay through the command-line arguments supported by the Docker entrypoint."
  "og:image": "https://www.mesh-network.org/_og/d/h_630%2Ca_~TWVzaCDigJQgUHJpdmF0ZSwgUGVyc2lzdGVudCwgRW5kLXRvLUVuZCBFbmNyeXB0ZWQgTWVzc2FnaW5n%2Cc_Mesh%2Cdomain_WWW.MESH-NETWORK.ORG%2Cp_Ii9kb2NzL2NvbmZpZ3VyYXRpb24i%2Cs_9AmI7_zAvxhkFzSC.png"
  "og:image:alt": "Mesh — Private, Persistent, End-to-End Encrypted Messaging"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Configuration · Mesh"
  "twitter:description": "Configure the relay through the command-line arguments supported by the Docker entrypoint."
  "twitter:image": "https://www.mesh-network.org/_og/d/h_630%2Ca_~TWVzaCDigJQgUHJpdmF0ZSwgUGVyc2lzdGVudCwgRW5kLXRvLUVuZCBFbmNyeXB0ZWQgTWVzc2FnaW5n%2Cc_Mesh%2Cdomain_WWW.MESH-NETWORK.ORG%2Cp_Ii9kb2NzL2NvbmZpZ3VyYXRpb24i%2Cs_9AmI7_zAvxhkFzSC.png"
  "twitter:image:alt": "Mesh — Private, Persistent, End-to-End Encrypted Messaging"
  "twitter:title": "Configuration · Mesh"
---

> Index of every page on this site: [llms.txt](https://www.mesh-network.org/llms.txt)

Mesh relay

# **Configuration**

Configure the relay through the command-line arguments supported by the Docker entrypoint.

The image builds `/data/config.json` from its command-line arguments every time the container starts. Treat the container arguments as the source of truth: manual changes to `config.json` are overwritten on restart.

Environment variables such as `RELAY_PORT`, `LOG_LEVEL` and `MAX_CONNECTIONS` are not supported.

## Supported operator arguments

| **Argument** | **Default** | **Purpose** |
| --- | --- | --- |
| `--host` | `0.0.0.0` | Public IPv4 address or DNS name advertised to other relays. Set this explicitly for a public relay. |
| `--external-port` | `41234` | Public TCP and UDP port advertised with `--host`. It must match the Docker host port mapped to internal port `41234`. |
| `--origins` | Automatic discovery | Explicit comma-separated `host:port` list. A nonempty list disables downloading. |
| `--no-origin-discovery` | Disabled | Do not download origins; allows starting an isolated relay without an explicit list. |

Unknown arguments are ignored by the current entrypoint. IPv6 literals are not accepted because relay addresses currently use the `host:port` format.

## Fixed container settings

The current image fixes several settings rather than exposing them as operator options:

| **Setting** | **Value** |
| --- | --- |
| Client and relay port | `41234` |
| Message database | `/data/relay.db` |
| Heartbeat interval | 60 seconds |
| Unseen relay cleanup interval | 60 minutes |
| Maximum rebound count | 7 |
| Client transport | TCP |
| Relay-to-relay transport | UDP |

The container always listens internally on `41234`. If the Docker host publishes another port, map that port to `41234` for both protocols and pass the host port through `--external-port`.

## Origins

An origin gives a new relay an initial peer from which it can discover the network.

Without an explicit list, the relay downloads `https://mesh-network.org/origins.json` at each startup with a 5-second timeout. The validated manifest is stored in `/data/origins-cache.json`. If the website is unavailable, the last valid cache is used; without a valid cache, startup fails with an explicit error. A cache write failure does not prevent using a valid downloaded list.

For private networks or isolated relays, use `--no-origin-discovery`. When using JSON configuration outside the Docker entrypoint, set `originDiscovery: false`. The `testnet` mode never downloads the public registry. Previously discovered peers are not removed when the registry changes. There is no periodic refresh.

### Applications and CLI

A new client installation downloads and saves origins. An existing valid list, including an empty list, is preserved. In Settings, **Récupérer les origines** fills the draft; **Sauvegarder** applies it. Failures preserve settings and allow retrying or manual configuration.

During `mesh-cli init`, the CLI prioritizes `MESH_RELAY_ORIGINS`, otherwise downloading the registry. `mesh-cli init --no-origin-discovery` allows isolated initialization. An existing configuration works without another download.

bash

```
mesh-cli origins fetch          # Preview without modifying configuration
mesh-cli origins fetch --apply  # Replace only origins, preserving identity keys
```

### Maintaining the registry

Edit `packages/website/public/origins.json` in the repository and redeploy the website. The format is `{ "schemaVersion": 1, "network": "mainnet", "origins": ["relay.example.org:41234"] }`. The list must be nonempty and contain only DNS or IPv4 addresses with a port between 1 and 65535, without a URL scheme. Downloads are public, without authentication, with CORS `*` and HTTP revalidation.

When first rolling out this feature, publish and verify the registry **before** distributing new clients and relays. To switch an existing relay to automatic discovery, remove its `--origins` argument and recreate its container while retaining the volume.

## Persistent data

Everything under `/data` must survive container replacement. Losing the volume loses stored envelopes, databases and local relay state. See [Operations](https://www.mesh-network.org/docs/operations) for a backup procedure.

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://www.mesh-network.org/#website","@type":"WebSite","description":"Peer-to-peer messaging network, maintained by the Mesh Network Association","inLanguage":"en-US","name":"Mesh","url":"https://www.mesh-network.org/","workTranslation":[{"@id":"https://www.mesh-network.org/fr#website"},{"@id":"https://www.mesh-network.org/es#website"},{"@id":"https://www.mesh-network.org/it#website"},{"@id":"https://www.mesh-network.org/de#website"},{"@id":"https://www.mesh-network.org/zh#website"},{"@id":"https://www.mesh-network.org/ja#website"},{"@id":"https://www.mesh-network.org/no#website"},{"@id":"https://www.mesh-network.org/pl#website"},{"@id":"https://www.mesh-network.org/ru#website"}]},{"@id":"https://www.mesh-network.org/docs/configuration#webpage","@type":"WebPage","description":"Configure the relay through the command-line arguments supported by the Docker entrypoint.","name":"Configuration · Mesh","url":"https://www.mesh-network.org/docs/configuration","isPartOf":{"@id":"https://www.mesh-network.org/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://www.mesh-network.org/docs/configuration"]}]}]}
```

## Sitemap

See the full [sitemap](https://www.mesh-network.org/sitemap.md) for all pages.
