Back
Discord Bots

Set up Lavalink for music bots

Run Lavalink as its own server on Victus and connect your music bot to it: configure application.yml, use the Network tab address/port, and wire up a v4 client like lavalink-client, Shoukaku or Wavelink.

lavalinkmusicaudiovoicejavashoukakuwavelink

Lavalink is a standalone Java audio server that does the heavy lifting for music bots — it fetches, decodes and streams audio to Discord voice so your bot process stays light. On Victus you run Lavalink as its own server (a Java egg) and point your bot at it over the network, using the host and port shown on the Lavalink server's Network tab. Victus supports Java bot/Lavalink hosting specifically for this.

Step 1 — Create the Lavalink server

  1. 1Order a Java-capable bot plan (Lavalink needs RAM of its own — 1GB+ is a sensible minimum) and open it in the panel.
  2. 2Put the Lavalink v4 jar in the server root via the Files tab (or use a Lavalink egg that downloads it for you).
  3. 3In the Startup tab, make sure it launches with java -jar Lavalink.jar on a Java 17+ image (Lavalink v4 requires Java 17 or newer).

Step 2 — Configure application.yml

yaml
server:
  address: 0.0.0.0
  port: 2333            # use the port from your server's Network tab
lavalink:
  server:
    password: "change-this-to-a-strong-password"
    sources:
      youtube: false    # v4 needs the youtube-source plugin instead
  plugins:
    - dependency: "dev.lavalink.youtube:youtube-plugin:1.18.2"
      repository: "https://maven.lavalink.dev/releases"

YouTube needs the youtube-source plugin in v4

Lavalink v4 removed built-in YouTube. Add the youtube-source plugin (shown above) or YouTube tracks will not load. Keep the plugin version current, since YouTube changes break old versions periodically. Bind to 0.0.0.0 and use the exact port from the Network tab.

Step 3 — Connect your bot

javascript
// Node.js example (Shoukaku / lavalink-client style config)
const nodes = [{
  name: 'main',
  url: 'YOUR_LAVALINK_HOST:2333',            // from the Network tab
  auth: 'change-this-to-a-strong-password', // must match application.yml
  secure: false,
}];
python
# Python example (Wavelink 3.x)
import wavelink
node = wavelink.Node(
    uri="http://YOUR_LAVALINK_HOST:2333",         # from the Network tab
    password="change-this-to-a-strong-password",  # must match application.yml
)

Version match and common connection failures

Use a v4-compatible client: lavalink-client, Shoukaku 4+ or Lavaclient for Node; Wavelink 3+ or Lavalink.py 5+ for Python — an old v3 client silently fails against a v4 node. A 401/authentication error means the password does not match; "connection refused" means Lavalink is not started yet or you used the wrong port. Start Lavalink and wait for "Lavalink is ready to accept connections" before starting the bot.