---
title: "Install with Docker · Mesh"
description: "Start an amd64 Mesh relay on the public network with persistent storage and the required TCP and UDP ports."
canonical_url: "https://www.mesh-network.org/docs/relay-docker"
locale: en
meta:
  "og:description": "Start an amd64 Mesh relay on the public network with persistent storage and the required TCP and UDP ports."
  "og:image": "https://www.mesh-network.org/_og/d/h_630%2Ca_~TWVzaCDigJQgUHJpdmF0ZSwgUGVyc2lzdGVudCwgRW5kLXRvLUVuZCBFbmNyeXB0ZWQgTWVzc2FnaW5n%2Cc_Mesh%2Cdomain_WWW.MESH-NETWORK.ORG%2Cp_Ii9kb2NzL3JlbGF5LWRvY2tlciI%2Cs__TeEPZTlZ4hvB6QY.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": "Install with Docker · Mesh"
  "twitter:description": "Start an amd64 Mesh relay on the public network with persistent storage and the required TCP and UDP ports."
  "twitter:image": "https://www.mesh-network.org/_og/d/h_630%2Ca_~TWVzaCDigJQgUHJpdmF0ZSwgUGVyc2lzdGVudCwgRW5kLXRvLUVuZCBFbmNyeXB0ZWQgTWVzc2FnaW5n%2Cc_Mesh%2Cdomain_WWW.MESH-NETWORK.ORG%2Cp_Ii9kb2NzL3JlbGF5LWRvY2tlciI%2Cs__TeEPZTlZ4hvB6QY.png"
  "twitter:image:alt": "Mesh — Private, Persistent, End-to-End Encrypted Messaging"
  "twitter:title": "Install with Docker · Mesh"
---

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

Mesh relay

# **Install with Docker**

Start an amd64 Mesh relay on the public network with persistent storage and the required TCP and UDP ports.

Docker is the only officially documented relay installation method. No standalone relay binary is currently published.

## Prerequisites

- Docker on a Linux `amd64` host.
- A public IPv4 address or DNS name for the relay.
- An external port available and reachable over both TCP and UDP ( `41234` by default).
- Enough persistent disk space for the relay databases and state.

Replace `relay.example.org` below. Do not advertise `0.0.0.0`, `localhost` or a private address to the public network.

## Start the relay

Pull the current image:

bash

```
docker pull ghcr.io/mockingmagician/mesh-relay:latest
```

Create a named volume and start the container:

bash

```
docker volume create mesh-relay-data

docker run -d \
  --name mesh-relay \
  --restart unless-stopped \
  -p 41234:41234/tcp \
  -p 41234:41234/udp \
  -v mesh-relay-data:/data \
  ghcr.io/mockingmagician/mesh-relay:latest \
  --host relay.example.org \
  --external-port 41234
```

Origins are downloaded from the website registry at startup and cached in the volume. The first startup requires outbound HTTPS access to the website (or an explicit list using `--origins`). `--host` and `--external-port` form the address advertised to other relays; they do not change the container bind address.

## Use a different external port

The relay always listens on port `41234` inside the container. To publish it as `relay.example.org:12000`, map port `12000` to the internal port for both protocols and advertise the same value:

bash

```
docker run -d \
  --name mesh-relay \
  --restart unless-stopped \
  -p 12000:41234/tcp \
  -p 12000:41234/udp \
  -v mesh-relay-data:/data \
  ghcr.io/mockingmagician/mesh-relay:latest \
  --host relay.example.org \
  --external-port 12000
```

The Docker host port and `--external-port` must match. Allow that chosen port in the host firewall, provider firewall and any NAT rule.

## Docker Compose

The equivalent Compose service is:

compose.yaml

```
services:
    relay:
        image: ghcr.io/mockingmagician/mesh-relay:latest
        container_name: mesh-relay
        restart: unless-stopped
        ports:
            - '41234:41234/tcp'
            - '41234:41234/udp'
        volumes:
            - mesh-relay-data:/data
        command:
            - --host
            - relay.example.org
            - --external-port
            - '41234'

volumes:
    mesh-relay-data:
```

Start it with `docker compose up -d`.

## Verify the container

bash

```
docker ps --filter name=mesh-relay
docker logs --tail 100 mesh-relay
```

Confirm that Docker publishes the chosen external port over TCP and UDP, then test reachability from outside the host network. A running container alone does not prove that NAT and firewall rules are correct.

## Next steps

Read [Configuration](https://www.mesh-network.org/docs/configuration) before changing arguments, then configure [updates and backups](https://www.mesh-network.org/docs/operations).

```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/relay-docker#webpage","@type":"WebPage","description":"Start an amd64 Mesh relay on the public network with persistent storage and the required TCP and UDP ports.","name":"Install with Docker · Mesh","url":"https://www.mesh-network.org/docs/relay-docker","isPartOf":{"@id":"https://www.mesh-network.org/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://www.mesh-network.org/docs/relay-docker"]}]}]}
```

## Sitemap

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