Skip to main content
Lavalink is a standalone Java audio server that your bot delegates all audio decoding and streaming work to. Rather than processing audio inside the Python process, the bot sends playback instructions over HTTP to Lavalink, which handles the heavy lifting independently. Docker is the recommended way to run Lavalink — you get a fully reproducible environment without installing Java, managing versions, or touching system dependencies on your host machine.
If you choose to run Lavalink without Docker, it requires Java 17 or higher. The containerised approach below avoids this requirement entirely.
Local FFmpeg is not required. Lavalink handles all audio decoding and processing internally inside its own container.

docker-compose.yml

The project ships with a ready-made docker-compose.yml that pulls the official Lavalink 4.x image and wires up everything the bot expects.
docker-compose.yml
Key values to note:

application.yml

The volume mount injects application.yml into the container at /opt/Lavalink/application.yml. This file controls Lavalink’s server port, authentication password, enabled audio sources, and logging output.
application.yml
Notable configuration choices:
  • YouTube plugin (dev.lavalink.youtube:youtube-plugin:1.18.1) — the official plugin replaces the built-in YouTube source; allowSearch, allowDirectVideoIds, and allowDirectPlaylistIds are all enabled.
  • SoundCloud (soundcloud: true, scSearch: true) — enables SoundCloud playback and search.
  • HTTP source (http: true) — allows Lavalink to stream direct audio URLs such as .mp3 files.
  • bufferDurationMs: 400 — sets the audio buffer to 400 ms for smooth playback.
  • Logging — Lavalink writes INFO-level logs to ./logs/lavalink.log inside the container.
1

Verify Docker is running

Open a terminal and confirm the Docker daemon is active:
If Docker is not running, start Docker Desktop (macOS/Windows) or run sudo systemctl start docker (Linux).
2

Start Lavalink in the background

From the project root (the directory containing docker-compose.yml), run:
The -d flag runs the container detached so it continues in the background after you close the terminal.
3

Verify Lavalink is running

Open http://localhost:2333 in a browser or use curl:
Lavalink returns a short HTML or JSON response when it is online. Any response on port 2333 confirms it is healthy.
4

Inspect the logs (optional)

To follow Lavalink’s output in real time:
Add -f to stream logs continuously:
To stop and remove the container:
This tears down the container but preserves your application.yml and the logs/ directory on the host.

Common Issues

Another process is bound to port 2333. Find and stop it, or change the host-side port in docker-compose.yml:
If you change the port, update bot.py’s on_ready handler to match the new URI (http://127.0.0.1:2334).
docker compose up will exit immediately with a connection error if the Docker daemon is not active. Start Docker and retry.
Run docker compose logs lavalink to read the startup output. A malformed application.yml (incorrect indentation, wrong password format) is the most common cause of an instant exit.

Bot Setup

Configure the Discord application that will connect to this Lavalink node.

Environment Variables

Check the .env values used by the bot when it starts up.

Quickstart

Follow the end-to-end path from setup to first playback.

Configuration

Review the full audio and permission settings used by the bot stack.