This guide walks you through setting up a self-hosted SudoBot instance from source. You will clone the repository, build the project with BlazeBuild, configure your environment and config files, run database migrations, and start the bot. The process takes about 10–20 minutes depending on your system speed.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/onesoft-sudo/sudobot/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before you begin, have the following ready:- Discord API application — Go to the Discord Developer Portal to create an application and obtain your bot token, client ID, and client secret.
- PostgreSQL database — A local PostgreSQL server or a hosted service such as Supabase. SudoBot will connect to it via a connection URL.
- Node.js v21+ or Bun v1.1.12+ — Either runtime works. If neither is installed, BlazeBuild will install one automatically during the build.
- Git — Optional, but recommended for cloning the repository.
Installation steps
Clone the repository
Clone the SudoBot GitHub repository to your local machine:If you prefer SVN:If you don’t have Git or SVN installed, download the latest release archive from the GitHub releases page and extract it.
Build the project
SudoBot uses BlazeBuild, an included build tool that automatically installs any missing SDKs or tools before compiling.
- Node.js
- Bun
Run the BlazeBuild wrapper to compile the TypeScript source into the The build requires at least 8 GB of RAM and 2 CPU cores for reasonable build times. If the process fails with heap allocation errors, download a prebuilt release instead from the GitHub releases page.
build/ directory:Prebuilt releases are tested on Node.js v23 and v22 but also work with v21 and v20. Only Linux and macOS native binaries are distributed, but this does not prevent you from running the bot on Windows.
Configure environment variables
Create a For a full list of supported environment variables, see the EnvironmentVariableSchema source file.
.env file in the project root. This file holds your secret credentials and must never be committed to version control.Configure the bot
SudoBot reads its settings from two JSON files:To see all available options, refer to the schema files:
config.json— guild-level settings (prefix, roles, feature toggles)system.json— global system-level settings (admin IDs, global flags)
config/ directory of the repository as starting points. Edit them to match your server, then copy the entire config/ directory to your SUDO_PREFIX directory:Run database migrations
With your
DB_URL set in .env, run the following command to create the required tables in your PostgreSQL database:Start the bot
Launch SudoBot with BlazeBuild:Your bot should come online in your Discord server. If you encounter any issues, join the Discord server and ask for help.
- Bun (default)
- Node.js
Registering application commands
SudoBot uses Discord’s Application Commands API for slash commands and context menus. After the bot starts for the first time, register the commands:Setting up emojis
SudoBot uses custom emojis for formatting certain messages. The bot searches for these in the guild specified byHOME_GUILD_ID. Without them, some bot messages may appear broken or unformatted.
Download the emoji pack from the OSN download server and upload the images to your home guild. Some additional emojis are available on emoji.gg.
Windows compatibility
BlazeBuild on Windows is still experimental. Use the following commands instead:Build the project (Node.js only)
Skip this step if you are using Bun.After building, copy
src/main/resources into build/out/main/resources.Run database migrations
Create a migration script manually. For Bun, create Then run it:For Node.js, create Then run it:
migrate.ts:migrate.js:Getting help
If you get stuck at any point:- Open an issue on GitHub
- Ask in the Discord server
- Email rakinar2@onesoftnet.eu.org
