> For the complete documentation index, see [llms.txt](https://esmp-fun.gitbook.io/plugins/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://esmp-fun.gitbook.io/plugins/community-chat/getting-started/set-up-the-network.md).

# Set up the network

One person — the **network operator** — does this once for the whole network. Plan for about 30 minutes. When you're done, every community connects itself with [two steps and a token](/plugins/community-chat/getting-started/connect-a-server.md).

Your purchase comes with two files:

* **`ccsrv-relay.jar`** — the hub. You (the operator) run this one, once, on a machine that stays on.
* **`ccsrv-spoke.jar`** — the plugin. Each Minecraft server installs this one. You don't need it on the relay machine.

The relay can run on any computer with Java 25: **your existing Minecraft hosting** (often free — many hosts let you split your plan into a second small instance), a cheap VPS ($2–5/month), or — for a first test — simply your own PC. Steps 0–3 below are the same everywhere; Step 4 is where you pick a home for it.

## Step 0 — Check Java

Open a terminal on the relay machine and run:

```
java -version
```

If it says version 25 or higher, you're good. If not (or it says "not found"), install the latest Java from [adoptium.net](https://adoptium.net) and check again.

## Step 1 — Create the Discord bot

You create **one** bot; it serves every community.

1. Go to [discord.com/developers/applications](https://discord.com/developers/applications) and click **New Application**. Name it whatever your network should be called.
2. Open the **Bot** page (left sidebar).
3. Click **Reset Token** → copy the token somewhere safe. You'll paste it into the config in Step 3. Treat it like a password.
4. On the same Bot page, scroll down and switch **ON** the toggle called **Message Content Intent**. Don't skip this — without it the bot can see nothing and the bridge stays silent.
5. Open the **General Information** page and copy the **Application ID** — you need it in the next step.

## Step 2 — Invite the bot to every community's Discord

Paste this link into your browser, replacing `YOUR_APP_ID` with the Application ID from Step 1, then pick a server and approve:

```
https://discord.com/oauth2/authorize?client_id=YOUR_APP_ID&scope=bot&permissions=536988672
```

Repeat once per community. (Whoever runs each Discord needs to do the approving — send them the link.) The permission number covers exactly what the bridge needs: View Channels, Send Messages, Manage Webhooks, Read Message History.

## Step 3 — Create the config file

Shortcut: if you start the relay once without a config (Step 4's command), it creates a `config.yml` template next to the jar for you — open it and fill in the marked spots.

Or do it by hand: in the same folder as `ccsrv-relay.jar`, create a plain text file named exactly `config.yml` and paste this in:

```yaml
# Community Chat — relay config (minimal starter)

discord:
  token: "PASTE-YOUR-BOT-TOKEN"       # from Step 1

# One block per community. Copy-paste a block to add more.
communities:
  emerald:                             # internal name — pick anything, no spaces
    displayName: "EmeraldMC"           # the community's full name
    tag: "EMER"                        # short tag players see in chat, max 10 characters
    color: "#4caf50"                   # the tag's in-game color (hex)
    spokeToken: "INVENT-A-LONG-RANDOM-SECRET-1"
    guildId: 111111111111111111        # that community's Discord server id
    chatChannelId: 222222222222222222  # the Discord channel where network chat should live
  sapphire:
    displayName: "SapphireSMP"
    tag: "SAPH"
    color: "#2196f3"
    spokeToken: "INVENT-A-LONG-RANDOM-SECRET-2"
    guildId: 333333333333333333
    chatChannelId: 444444444444444444
```

Then fill in the blanks:

<details>

<summary><strong>Bot token</strong></summary>

The token you copied in Step 1 (Discord Developer Portal → your app → Bot → Reset Token). Paste it between the quotes.

</details>

<details>

<summary><strong>The ids</strong> — <code>guildId</code> and <code>chatChannelId</code></summary>

In Discord: Settings → Advanced → turn on **Developer Mode**. Now right-click a server icon → **Copy Server ID** (that's `guildId`), and right-click the chat channel → **Copy Channel ID** (that's `chatChannelId`).

</details>

<details>

<summary><strong><code>spokeToken</code></strong> — one invented password per community</summary>

A password you invent, one per community, at least 20 random characters. You'll hand each community its own token in Step 5. Mashing the keyboard is fine; a password generator is better.

</details>

Windows tip: make sure the file is really called `config.yml` and not `config.yml.txt` — Windows hides file extensions by default.

That's all a network needs. Every other setting (looks, anti-spam, automod, events) has a sensible default — see the [full relay settings reference](/plugins/community-chat/reference/relay-settings.md) when you want to tune things.

## Step 4 — Start it where it will live

For a quick test on your own PC, just run this in the folder with the jar and the config:

```
java -jar ccsrv-relay.jar
```

Within a few seconds the console should say `Discord connected` and `Listening on ...`. If it prints an error instead, the [troubleshooting page](/plugins/community-chat/help/troubleshooting.md) covers every common one.

For the real thing, follow the guide that matches your setup — each one takes you from a bare machine to a relay that starts itself and survives reboots:

* [**Run the relay on your Minecraft hosting**](/plugins/community-chat/getting-started/relay-on-a-minecraft-server.md) — on the same control panel your server already lives on (Kinetic, Apex, Bisect, …); no SSH, no Linux.
* [**Run the relay on a VPS**](/plugins/community-chat/getting-started/relay-on-a-vps.md) — a small always-on rented machine, independent of any one Minecraft server.

## Step 5 — Hand out the tokens

Send each community's admin two things:

1. their `spokeToken` from your config,
2. the relay address: `wss://crosschat.your-domain.com` — the domain address from the last step of your hosting guide ([Give the relay a domain address](/plugins/community-chat/getting-started/relay-behind-443.md)). Hand out the raw `ws://ADDRESS:PORT` form only for testing on your own server — hosts routinely block outbound connections to unusual ports, so an IP-and-port address handed to the whole network is the single most common source of "some servers connect, some don't".

And a link to [Connect a server](/plugins/community-chat/getting-started/connect-a-server.md) — their part takes two minutes. One note: the relay's port must be reachable from the internet — each hosting guide shows where to open it. The Minecraft servers need no open ports at all.

## Adding a community later

Copy-paste one `communities:` block in the config, invite the bot to their Discord (Step 2 link), restart the relay, and send them their token. The restart takes a few seconds; connected servers reconnect on their own and in-game chat is never interrupted.
