Installing Nuit
Nuit is a self-hostable Discord bot. This guide walks you through running your own instance from scratch.
Prerequisites
- Bun v1.3.12 or later
- A Discord application with a bot token
- A PostgreSQL database (e.g. Supabase)
- Git — manual setup only
Installation
Using the CLI
Install the Nuit CLI globally:
bun install -g @nuit-bot/cliThen run:
nuit initThe CLI will prompt you for a folder name, then hatch your bot by asking for:
- Discord token — from your Discord application's Bot page
- Discord client secret — from the OAuth2 page of your Discord application
- PostgreSQL connection URL — your database connection string
- Better Auth base URL — the URL your instance will be publicly accessible at
TIP
Your Discord client ID is fetched automatically from Discord's API using your bot token — you don't need to provide it manually.
Manually
Clone the repo:
git clone https://github.com/Nuit-Bot/Nuit.gitChange directory into the bot:
cd NuitIf you want a more stable build (so less updates, recommended for production), type this command:
git switch -c main --track origin/mainInstall packages:
bun install # --frozen-lockfile in productionMake environment variables:
cp .env.example .envEdit the .env file to add your bot token and other environment variables.
Make the database migrations:
# Better Auth migrations
bun x auth migrate
# Drizzle ORM schema migrations
bun x drizzle-kit generate
bun x drizzle-kit migrateIn a first terminal tab, run the web server:
bun run dev:webIn a second terminal tab, run the bot:
First boot/after changing a command's data:
bun run dev --registerNormal:
bun run devThat's it! You now have Nuit running on your bot!
Next Up
You can now start configuring the bot. See Configuration.