Skip to main content

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.

Docker Compose is the quickest way to get SudoBot running in a contained environment. The included docker-compose.yml starts three services: SudoBot itself, a PostgreSQL database, and Adminer for database administration.

Services

ServiceImagePortDescription
sudobotBuilt from local Dockerfile4000The bot process
postgrespostgres:16-alpineInternalPostgreSQL database
admineradminer8080Web-based DB admin UI

Setup

1

Clone the repository

git clone https://github.com/onesoft-sudo/sudobot
cd sudobot
2

Create the Docker environment file

Copy the example env file and fill in your values:
cp .env.docker.example .env.docker
Edit .env.docker with your Discord credentials and other settings. The key variables are:
.env.docker
TOKEN=your-discord-bot-token
CLIENT_ID=your-discord-client-id
CLIENT_SECRET=your-discord-client-secret
HOME_GUILD_ID=your-home-guild-id
JWT_SECRET=your-random-jwt-secret
SUDO_PREFIX=/app/storage
The DB_URL is automatically set by the Docker entrypoint to connect to the postgres service. You don’t need to set it manually in the Docker environment file.
3

Create required directories and files

The Compose file mounts several local directories into the container. Create them:
mkdir -p config logs storage tmp
touch .migration_status
cp -r config/ ./config
4

Build and start the stack

docker compose up -d
On first run, SudoBot automatically detects that migrations haven’t run (via .migration_status) and runs them before starting the bot.

Volume mounts

The sudobot service mounts the following local paths:
Local pathContainer pathPurpose
./config/app/configGuild and system config files
./logs/app/logsLog files
./storage/app/storagePersistent bot data
./tmp/app/tmpTemporary files
./.migration_status/app/.migration_statusMigration state tracking
./.env.docker/app/.envEnvironment variables

Managing the stack

# View logs
docker compose logs -f sudobot

# Stop all services
docker compose down

# Rebuild after code changes
docker compose build sudobot
docker compose up -d sudobot

# Access Adminer (database UI)
# Open http://localhost:8080 in your browser
# Server: postgres, Username: postgres, Password: root, Database: sudobot

Database migrations

Database migrations run automatically on first startup when .migration_status is empty. To re-run migrations manually:
# Clear migration status and restart
echo "" > .migration_status
docker compose restart sudobot
Re-running migrations on an existing database applies only new migrations. It is safe to do on upgrades, but always back up your database before updating SudoBot.

Build docs developers (and LLMs) love