Discord music bot with web control panel: YouTube streaming, queue management, slash commands.
2.2K
A feature-rich Discord music bot with a built-in web control panel. Stream
audio from YouTube and manage the queue in real time — from Discord slash commands
or a browser. yt-dlp and ffmpeg are bundled in the image, so the only external
dependency is a Discord application.
Image:
kasperhonore/discord-music:latest· Source: https://github.com/KasperHonore/SquareMusica
ffmpeg, and yt-dlp (downloaded at build time)/app/data (mount a volume to persist it)The container is configured entirely through environment variables. Create a .env
file (see the variables below), then:
docker run -d \
--name discord-music-bot \
-p 3000:3000 \
-v discord-music-bot-data:/app/data \
--env-file .env \
--restart unless-stopped \
kasperhonore/discord-music:latest
Discord slash commands must be registered once before they appear in your server:
docker run --rm --env-file .env kasperhonore/discord-music:latest npm run register
services:
music-bot:
image: kasperhonore/discord-music:latest
container_name: discord-music-bot
restart: unless-stopped
ports:
- '3000:3000'
volumes:
- discord-music-bot-data:/app/data
# - ./cookies.txt:/app/cookies.txt:ro # optional, for age-restricted videos
env_file:
- .env
healthcheck:
test: ['CMD', 'wget', '-q', '--spider', 'http://localhost:3000/api/health']
interval: 30s
timeout: 10s
retries: 3
volumes:
discord-music-bot-data:
Then register commands once with: docker compose run --rm music-bot npm run register.
| Variable | Description |
|---|---|
DISCORD_TOKEN | Bot token from the Discord Developer Portal |
APP_ID | Discord application ID |
GUILD_ID | Your Discord server ID (restricts web UI to its members) |
DISCORD_CLIENT_SECRET | OAuth client secret (for web login) |
JWT_SECRET | Random 32+ char string for signing sessions |
OAUTH_REDIRECT_URI | OAuth callback, e.g. https://music.example.com/api/auth/callback |
WEB_URL | Public frontend URL — used for CORS and post-login redirect |
| Variable | Default | Description |
|---|---|---|
PORT | 3000 | Port the server listens on |
TRUST_PROXY | unset | Set to 1 behind a reverse proxy so rate limiting sees the real client IP (hop count, not a boolean) |
LOG_LEVEL | info | error | warn | info | debug |
YT_DLP_COOKIES | unset | Path to a cookies file (mount it) for age-restricted/rate-limited videos, e.g. /app/cookies.txt |
SPOTIFY_CLIENT_ID / SPOTIFY_CLIENT_SECRET | unset | Enable Spotify link resolution |
yt-dlp and ffmpeg paths are auto-detected inside the image — no configuration needed.
3000 — REST API, web control panel, and Socket.io/app/data — SQLite database (mount to persist across restarts)GET /api/health/play · /pause · /resume · /skip · /stop · /queue · /nowplaying ·
/remove · /shuffle · /clear · /loop · /join · /leave · /webui
yt-dlp; for age-restricted content, supply a cookies file via
YT_DLP_COOKIES.MIT
Content type
Image
Digest
sha256:1419e3774…
Size
394.6 MB
Last updated
20 days ago
docker pull kasperhonore/discord-music