All guides
Self-hostSetupOpen source

How to self-host the GuildLabs Discord bot

6 min read

GuildLabs bots aren't a hosted service you rent — they're open-source programs you run yourself. That's the whole point: no monthly bill, no rate limits, and your community's data never leaves your machine. Every GuildLabs bot runs locally, and this guide gets one going from scratch in about ten minutes.

You'll need Node.js 20+ and a free Discord account. Everything else is free and open-source.

Download the bot

Download the bot bundle from the self-host page (it's a ~50 KB zip, no GitHub account needed), unzip it, and install dependencies in a terminal opened in that folder.

# after unzipping guildlabs-bot.zip
cd guildlabs-bot
npm install

Create a Discord application

  1. 1Open the Discord Developer Portal and click New Application — give it a name. This is your bot.
  2. 2Go to Bot, and under Privileged Gateway Intents enable Server Members Intent and Message Content Intent.
  3. 3Copy the Bot Token and keep it secret — it's effectively a password.
  4. 4Go to OAuth2 → General and copy the Client ID.

Configure your environment

Copy the example env file and paste in your token and client ID.

cp .env.example .env
# then edit .env:
DISCORD_TOKEN=your_bot_token
CLIENT_ID=your_client_id

Register commands and start it

npm run deploy   # registers the slash commands
npm start        # starts the bot (npm run dev = auto-restart)

When the terminal prints "online as …", the bot is live in Discord — for as long as that terminal stays running. Close it and the bot goes offline. That's exactly what self-hosted means: it runs on your machine, under your control.

Invite it to your server

Generate an invite URL with Administrator permission (it needs that to create roles and channels), replacing CLIENT_ID with yours:

https://discord.com/oauth2/authorize?client_id=CLIENT_ID&permissions=8&scope=bot+applications.commands

Build a server with it

Design a server on the GuildLabs builder, then bring it into Discord one of two ways. The simplest needs no public URL: click Deploy to Discord, copy the code, and run /deploy with it in your server — your local bot fetches the blueprint and builds everything. (Power users can instead point the site's BOT_API_URL at the bot's local API on port 3008.)

Privacy is the real reason to self-host. Maven's question-matching runs on a local model, so nothing your community says is ever sent to a third party — and there's no per-message API bill, which is why it's free.