# Installing zaun-host

> Run zaun-host with Docker, Docker Compose, systemd, or a binary you build from source.

`zaun-host` is one static binary. It runs on Linux, x86_64 or aarch64 (Raspberry Pi 4/5), in about
512 MB of memory. Pick one way to run it:

**Docker:**

```sh
docker run -d --name zaun-host --restart unless-stopped --memory 512m \
  -v zaun-host:/var/lib/zaun-host ghcr.io/zaunchat/zaun-host
docker exec zaun-host zaun-host address   # the address members and owners connect to
```

The first start runs `zaun-host init` for you, then serves. The image is Alpine with one static
binary, runs as an unprivileged user, and is built for amd64 and arm64. There are **no ports to
publish**: members reach the host through SimpleX relays.

**Docker Compose:**

The repository's `deploy/compose.yaml` runs the same image with a read-only root file system and no
Linux capabilities:

```sh
curl -O https://raw.githubusercontent.com/zaunchat/zaun-community/main/deploy/compose.yaml
docker compose up -d
docker compose exec zaun-host zaun-host address
```

**From source:**

You need Rust; the exact version is pinned in `rust-toolchain.toml` and installed for you by
`rustup`.

```sh
git clone https://github.com/zaunchat/zaun-community && cd zaun-community
cargo build --release -p zaun-host
./target/release/zaun-host init --data-dir ./zaun-data
./target/release/zaun-host run --data-dir ./zaun-data
```

**systemd:**

Build or copy the binary to `/usr/local/bin/zaun-host`, then use the hardened unit from
`deploy/zaun-host.service` (it runs as `zaun-host`, reads `/var/lib/zaun-host/zaun-host.toml`, and
limits memory to 512 MB):

```sh
sudo useradd --system --no-create-home zaun-host
sudo install -d -o zaun-host -g zaun-host -m 0700 /var/lib/zaun-host
sudo -u zaun-host zaun-host init --data-dir /var/lib/zaun-host
sudo cp deploy/zaun-host.service /etc/systemd/system/
sudo systemctl enable --now zaun-host
```

## Choosing relays

By default the host uses the official SimpleX servers. To use your own `smp-server` (or anyone
else's), pass `--smp smp://<fingerprint>@<host>` to `init`, or list servers in `smp_servers`. With
your own SMP servers, also list an XFTP server (`--xftp`), or attachments are off.

> **Note**
>
> Server addresses that embed a queue-creation password are refused in the configuration: that's a
> secret, and the config file never holds secrets.
## Next

[First run](/docs/guide/host/first-run/): check the host and create your first community.
