Installation
djsnake is meant to be self-hosted. The recommended setup is Docker Compose, which runs the bot together with a PO token provider sidecar that keeps YouTube downloads working.
1. Create the Discord bot
Section titled “1. Create the Discord bot”- In the Discord Developer Portal, create an application and add a bot.
- Under Bot, enable the Message Content Intent. It is the only privileged intent needed; without it the bot ignores your commands.
- Copy the bot token. You will put it in
.envasDISCORD_TOKEN. Never share or commit it. - Invite the bot to your server with the
botandapplications.commandsscopes (the latter makes the/commands appear) and these permissions: View Channels, Send Messages, Read Message History, Add Reactions, Connect, Speak.
2. Docker Compose quick start
Section titled “2. Docker Compose quick start”Using the prebuilt image (recommended):
git clone https://github.com/selfhostr/djsnake.gitcd DJ_Snakecp .env.example .env # set DISCORD_TOKENdocker compose pull && docker compose up -ddocker compose logs -f dj-snakeThe prebuilt image is ghcr.io/theroxat/dj_snake:latest (amd64 and arm64). To pin a version, set DJ_SNAKE_TAG in .env, for example DJ_SNAKE_TAG=1.0.0.
Then join a voice channel and send:
!play https://www.youtube.com/watch?v=...The bot joins, posts the clip page link and starts playing.
Building from source
Section titled “Building from source”To run your local changes, build the image from your checkout instead of pulling it:
docker compose up -d --buildThe compose file keeps a build: . entry for exactly this, and tags the result with the same image name.
What Compose starts
Section titled “What Compose starts”- dj-snake: the bot and the clip web server. It reads your
.env, mounts./datafor persistent data (themes, logos, listening stats), and publishes the web port onWEB_BIND(default127.0.0.1). - pot-provider: a bgutil Proof-of-Origin token provider. It is not exposed on the host; only the bot reaches it over the Compose network. See Keeping YouTube working.
Running without Docker
Section titled “Running without Docker”You need Python 3.10 or newer, ffmpeg and deno on your PATH, and a reachable PO token provider (for example the pot-provider container with its port published). Point POT_BASE_URL at it, or expect intermittent “Sign in to confirm you’re not a bot” errors, because the default http://pot-provider:4416 only resolves inside Compose.
python3 -m venv venv && source venv/bin/activatepip install -r requirements.txtcp .env.example .env # set DISCORD_TOKEN and POT_BASE_URLpython3 bot.pyOn Python 3.13 and newer, audioop-lts is also needed for voice (it is listed in requirements.txt).
Making the clip page reachable
Section titled “Making the clip page reachable”By default the clip page is only reachable from the machine running the bot. See Exposing the page to put it behind a reverse proxy or a tunnel.
Updating
Section titled “Updating”cd DJ_Snakegit pulldocker compose pull && docker compose up -dSee the changelog for what changed between versions.