# Quick start

> Run a host with Docker, create a community from a script, and invite yourself, in about ten minutes.

This page takes you from nothing to a running community you own. You need Docker, and either
Rust or Node.js 22+ for the small script that creates the community.

1. **Start a host.**

   ```sh
   docker run -d --name zaun-host --restart unless-stopped --memory 512m \
     -v zaun-host:/var/lib/zaun-host ghcr.io/zaunchat/zaun-host
   ```

   The first start creates the host's keys, database and configuration in the `zaun-host`
   volume, then serves. There are no ports to publish: members reach it through SimpleX relays.

2. **Allow community creation, once.** By default nobody may create communities on a host.
   Open it while you create yours:

   ```sh
   docker exec zaun-host sed -i 's/^community_creation = .*/community_creation = "open"/' \
     /var/lib/zaun-host/zaun-host.toml
   docker restart zaun-host
   ```

3. **Note the host's address and key.**

   ```sh
   docker exec zaun-host zaun-host address   # the SimpleX address
   docker exec zaun-host zaun-host id        # the host id and public key
   ```

4. **Create the community** with `zaun-client`. You become its owner, and its root key (its
   identity) is saved in the client's directory: back it up.

   **JavaScript:**

   ```js
   import { Client } from "zaun-client";

   const client = await Client.start({ name: "Me", key: "a store passphrase" });
   const community = await client.createCommunity({
     host: "<address>",
     hostKey: "<public key from zaun-host id>",
     name: "My community",
     displayName: "Me",
   });
   console.log(await community.createInvite({ maxUses: 10 }));
   ```

   **Rust:**

   ```rust
   use zaun_client::Client;
   use zaun_client::protocol::{b64, keys::PublicKey};

   let client = Client::builder("./owner").name("Me").key("a store passphrase").start()?;
   let host_key = PublicKey::from_bytes(&b64::decode("<public key from zaun-host id>")?)?;
   let community = client.create_community("<address>", host_key, "My community", "Me")?;
   let invite = community.create_invite(10, None)?; // 10 uses, no expiry
   println!("{invite}");
   ```

5. **Close creation again**, so strangers can't create communities on your host:

   ```sh
   docker exec zaun-host sed -i 's/^community_creation = .*/community_creation = "closed"/' \
     /var/lib/zaun-host/zaun-host.toml
   docker restart zaun-host
   ```

6. **Invite people** with the `zaun://join/…` link. Treat it as a secret: anyone with it can join.

> **Caution: Back up the owner's directory**
>
> The community's root key lives in the owner's client directory (`./owner/zaun/<community>/root.key`).
> Without it you can never move the community to another host or change its signed profile.
## What next?

- [Install a bot](/docs/guide/bots/quickstart/) that answers `/ping`.
- [Configure the host](/docs/guide/host/configuration/): attachments, voice, bots, your own relays.
- [Build an app](/docs/guide/client/connecting/) with `zaun-client`.
