> For the complete documentation index, see [llms.txt](https://docs.mantic.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mantic.dev/server-bot/setup-guide.md). Agents can also search and read this documentation through its [MCP server](https://docs.mantic.dev/~gitbook/mcp).

# Setup Guide

Install Server Bot, connect it to Discord, verify its licence, and link the hosted Control Panel.

Create your Discord bot, start the loader, and link the Control Panel. Keep your bot token and Server Bot licence key private.

## 1. Create the Discord bot

1. Create an application in the [Discord Developer Portal](https://discord.com/developers/applications).
2. On its **Bot** page, enable **Presence Intent**, **Server Members Intent**, and **Message Content Intent**. Copy the bot token for the hosting step.
3. Invite the bot to your Discord server using the `bot` and `applications.commands` scopes.

<details>

<summary>Invite permissions and token safety</summary>

Start with **View Channels**, **Send Messages**, **Embed Links**, and **Read Message History**. Add permissions for the features you plan to use, such as **Manage Channels** for tickets or **Manage Roles** for role assignment. Give specific permissions instead of **Administrator**.

If the token is exposed, reset it in the Developer Portal and update it on your host.

</details>

## 2. Start it on a Java host

1. Use **Java 17 or newer**. In Mantic’s Discord downloader, choose **Download Bot Loader**, then upload the JAR to your host.
2. Run it once to create the `bot/` folder. Use the downloaded filename in your host’s startup command.
3. Stop the bot, set `license` and `bot-token` in `bot/config.yml`, then start it again.

```sh
java -jar ServerBotLoader.jar
```

[Sparked Host](https://billing.sparkedhost.com/aff.php?aff=2015) offers Discord bot hosting from **$1 per month** on its Basic plan. Mantic may earn a commission from sign-ups through this link.

<details>

<summary>Hosting, network access and main server ID</summary>

Keep the launcher and `bot/` folder on persistent storage. Allow outbound HTTPS to `handler.mantic.dev` for runtime downloads and `auth.mantic.dev` for online licence validation. During a distribution outage, the loader can use a previously verified runtime if it already has one.

You can set `SERVERBOT_TOKEN` on your host instead of entering the token in the file. The environment variable takes precedence.

To choose the main server directly, set `administration-guild-id` in `bot/config.yml`. Enable **Developer Mode** under **User Settings → Advanced** in Discord, then right-click the server icon and choose **Copy Server ID**.

</details>

<details>

<summary>Run inside Spigot or BungeeCord</summary>

Standalone hosting is recommended so you can restart Server Bot independently. To load it as a plugin, put the **Server Bot Loader JAR** in the Spigot server or BungeeCord proxy’s `plugins/` folder and start the host. Use Java 17 or newer and follow your server’s Java requirements.

If you are switching an existing installation, stop it and back up its bot folder. Copy its contents into `plugins/ServerBotV2/` and keep only the Loader JAR for Server Bot in `plugins/`.

The first start creates `plugins/ServerBotV2/config.yml`. Stop the host, set `license` and `bot-token` in that file, then start the host again. Put optional module JARs in `plugins/ServerBotV2/modules/`. In the Minecraft host console, run `serverbot hosted pair`, or `serverbot hosted pair SERVER_ID` for multiple Discord servers. Open the link printed in the console and follow the sign-in steps below. Run `serverbot help hosted` for pairing help.

To update the Loader itself, stop Spigot or BungeeCord before replacing the JAR. Use a Loader and runtime release that both support plugin hosting.

</details>

## 3. Link the Control Panel

1. With the bot online, run `hosted pair` in your **hosting console**. For a bot in multiple servers, use `hosted pair SERVER_ID` to select the main server.
2. Open the printed setup link within **10 minutes** and confirm the pairing with a Discord account that has **two-factor authentication** enabled.
3. At [bots.mantic.dev](https://bots.mantic.dev), sign in with the same account and choose **Your bots → Open workspace**.

<details>

<summary>Pairing help and access for other accounts</summary>

For a bot in one server, `hosted pair` can select that server automatically. If you cannot find the setup link, run `help hosted`, then run `hosted pair` again. Look for the link in the same hosting console.

After the initial pairing, accounts you allow in **Panel access** can find the bot under **Your bots**. The bot connects outbound to the hosted panel. You can use it without opening an inbound panel port or creating a separate OAuth application.

</details>

## 4. Configure and verify

Open **Configuration** in the Control Panel to set up your features, then use **Review changes** before saving. In Discord, run `/help` to check that the bot responds.

<details>

<summary>Configuration, previews and Discord settings</summary>

Configuration is shared across the bot’s connected servers. The server selector changes channel and role suggestions and message previews. Use **Edit YAML** if your account has file permission. Use each feature’s setup or management section to publish panels or review active items.

You can also use `/settings` in Discord. The server and your account must be permitted in **Panel access**.

</details>

## Upgrade safely

<details>

<summary>Upgrade checklist and launcher updates</summary>

1. Stop the bot from your hosting service.
2. Make a private backup of the complete `bot/` folder, including hidden directories, and the launcher working directory.
3. Replace the launcher only with the official release supplied for your installation. Keep your existing configuration and data; do not start with a new empty `bot/` folder.
4. Start the bot and run `diagnostics` to confirm the expected runtime and module state. Check the host console for startup errors before removing your backup.

On Linux and macOS, current loaders stage signed launcher updates at startup and apply them during a clean shutdown. The launcher keeps its existing filename and saves the previous JAR beside it with a `.previous` suffix. If you are upgrading from an older loader, install the current loader once under the filename your host already uses and keep the same `java -jar` startup command. A force kill leaves an update staged until a clean shutdown.

Keep compatible module JARs with the runtime release. If a module fails, disable it and check the error or module update before deleting its configuration or stored data.

</details>

## Keep the data together

<details>

<summary>What to back up</summary>

Keep the `bot/` folder and the launcher working directory on persistent storage. Important private data lives in `bot/data/.hosted-panel` (hosted identity and approvals), `bot/data/.server-backups` (server snapshots), and `bot/data/.distribution-cache` (verified runtime cache). File edit backups are kept under `bot/panel-backups/`. Include these in a protected host backup; never send them with support requests because they may contain private server data.

</details>

For more help, see the [Hosted Control Panel](https://docs.mantic.dev/server-bot/control-panel.md), [Console commands](https://docs.mantic.dev/server-bot/console-commands.md), and [Backups and data](https://docs.mantic.dev/server-bot/backups-and-data.md) guides.
