A minimal, high-quality Discord music streaming bot built for real-time, self-hosted control with near zero bloat.
View the Source »
セルフホスト (Self Hosted) Music Bot is a modern Java-based Discord bot built for high-quality music streaming using yt-dlp, ffmpeg, JDA 6, and DAVE for Discord voice channels using E2EE (mandatory since March 1, 2026)
- No tracking
- No third-party music APIs
- Self-hosted and easy to repair when YouTube inevitably changes something
- DAVE-capable E2EE Discord voice support
- Open the Discord Developer Portal: https://discord.com/developers/applications
- Create or select an application.
- Go to Bot.
- Add a bot if one does not already exist.
- Enable Message Content Intent under Privileged Gateway Intents.
- Copy or reset the bot token.
- Put the token in
config.json.
Invite the bot:
- Go to OAuth2 -> URL Generator.
- Select the
botscope. - Select these bot permissions:
- View Channels
- Send Messages
- Read Message History
- Connect
- Speak
- Use Voice Activity
- Open the generated URL and invite the bot to your server.
Create config.json in the directory where the bot runs.
Linux and Docker:
{
"token": "YOUR_DISCORD_BOT_TOKEN",
"prefix": ".",
"ffmpegPath": "ffmpeg",
"ytDlpPath": "tools/yt-dlp",
"ytQuality": "bestaudio[ext=webm]/bestaudio/bestaudio[ext=m4a]"
}Windows:
{
"token": "YOUR_DISCORD_BOT_TOKEN",
"prefix": ".",
"ffmpegPath": "ffmpeg",
"ytDlpPath": "tools\\yt-dlp.exe",
"ytQuality": "bestaudio[ext=webm]/bestaudio/bestaudio[ext=m4a]"
}Keep config.json private. A leaked Discord token should be rotated immediately in the Discord Developer Portal.
.play <url or search> stream or queue audio
.p <url or search> alias for play
.skip skip the current track
.seek <time> seek to seconds, MM:SS, or HH:MM:SS
.clear clear the queue
.stop stop playback
.leave disconnect the bot
Docker is the recommended Linux deployment, especially for Linux Mint 21 and Ubuntu 22.04 hosts. Those systems have older host libraries, while the container uses Ubuntu Noble userspace with the newer glibc/libstdc++ needed by JDAVE.
Install Docker using the official Docker instructions for your distro.
Clone the repo:
cd /opt
sudo git clone https://github.com/JakeTurner616/Serufuhosuto-music-bot.git serufuhosuto-music-bot
sudo chown -R "$USER:$USER" /opt/serufuhosuto-music-bot
cd /opt/serufuhosuto-music-botCreate config.json using the Linux/Docker example above.
Build and run in the foreground:
docker compose build
docker compose upIf your system uses the older Compose command:
docker-compose build
docker-compose up -dIf Docker requires root on your machine, prefix those commands with sudo. To allow your user to run Docker without sudo:
sudo usermod -aG docker "$USER"Then log out and back in.
Verify inside the container:
docker compose run --rm --entrypoint /bin/bash serufuhosuto -lc 'python3 --version && tools/yt-dlp --version && ffmpeg -version | head -n 1'Run in the background:
docker compose up -d
docker compose logs -fUpdating the deployed container:
cd /opt/serufuhosuto-music-bot
git pull
docker compose build
docker compose up -d
docker compose logs -fStopping the container:
docker compose downBare-metal deployment is a second option for hosts with a new enough userspace, or for advanced use-cases.
Required:
- Java 25 JDK for build and runtime
- Maven
- FFmpeg
- curl
- Local or system yt-dlp
- glibc 2.38 or newer
- libstdc++ exporting
GLIBCXX_3.4.32or newer
Ubuntu 24.04+ and Debian 13+ are good targets. Ubuntu 22.04 and Linux Mint 21 are not good bare-metal targets for JDAVE 0.1.8 because their glibc/libstdc++ versions are too old.
Check the host:
ldd --version
strings /lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX_3.4.32
uname -mInstall dependencies:
sudo apt update
sudo apt install -y git maven ffmpeg curl wget gpg
sudo install -d -m 0755 /etc/apt/keyrings
wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | sudo gpg --dearmor --yes -o /etc/apt/keyrings/adoptium.gpg
echo "deb [signed-by=/etc/apt/keyrings/adoptium.gpg] https://packages.adoptium.net/artifactory/deb $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") main" | sudo tee /etc/apt/sources.list.d/adoptium.list
sudo apt update
sudo apt install -y temurin-25-jdk
java --version
javac --version
mvn -vClone and build:
cd /opt
sudo git clone https://github.com/JakeTurner616/Serufuhosuto-music-bot.git serufuhosuto-music-bot
sudo chown -R "$USER:$USER" /opt/serufuhosuto-music-bot
cd /opt/serufuhosuto-music-bot
mkdir -p tools
curl -L -o tools/yt-dlp https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp
chmod +x tools/yt-dlp
mvn -q clean packageRun manually:
mkdir -p tmp
java -Djava.io.tmpdir=/opt/serufuhosuto-music-bot/tmp -jar target/Serufuhosuto-music-bot-1.6.jarThe java.io.tmpdir override keeps JDAVE's extracted native library in a project-local executable directory.
If JDAVE fails to load on Linux, inspect the extracted native library:
find tmp -name 'dave*.so' -print
file tmp/jdave*/dave*.so
ldd tmp/jdave*/dave*.soIf ldd reports missing GLIBC_2.38 or GLIBCXX_3.4.32, use Docker or move to a newer OS. Do not upgrade glibc in place on an older distro.
Use this only after the manual bare-metal run works.
Create /etc/systemd/system/serufuhosuto.service:
[Unit]
Description=Serufuhosuto Music Bot
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
WorkingDirectory=/opt/serufuhosuto-music-bot
ExecStartPre=/usr/bin/mkdir -p /opt/serufuhosuto-music-bot/tmp
ExecStart=/usr/bin/java -Djava.io.tmpdir=/opt/serufuhosuto-music-bot/tmp -jar target/Serufuhosuto-music-bot-1.6.jar
Restart=always
RestartSec=10
User=YOUR_USER
[Install]
WantedBy=multi-user.targetEnable and start:
sudo systemctl daemon-reload
sudo systemctl enable serufuhosuto
sudo systemctl start serufuhosuto
journalctl -u serufuhosuto -fInstall Java 25, Maven, FFmpeg, and yt-dlp:
New-Item -ItemType Directory -Force tools
curl.exe -L -o tools\yt-dlp.exe https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe
.\tools\yt-dlp.exe --version
mvn -q clean package
java -jar target\Serufuhosuto-music-bot-1.6.jargit clone https://github.com/JakeTurner616/Serufuhosuto-music-bot.git
cd Serufuhosuto-music-bot
mvn -q clean packageThe runnable shaded jar is:
target/Serufuhosuto-music-bot-1.6.jar
Distributed under the GNU GPL v3.0 License. See LICENSE for details.