Discord Bot

How do I run Lavalink for music?

Music bots need an audio backend, and Lavalink is the go-to choice. You can run Lavalink right alongside your bot on the same server. This article walks through setting it up and points you to a smoother option for heavier music bots.

Lavalink is a Java service that your bot talks to over a local port. Here's the setup:

  1. Add a port in the Ports tab for Lavalink to listen on.
  2. Upload Lavalink.jar and its application.yml to the Files tab, and run it. Lavalink needs Java and extra RAM, so a larger plan helps.
  3. Point your bot's Lavalink config at that host / port and password so the two can connect.

Once both are running, your bot sends audio requests to Lavalink, which handles the streaming.

Tip: For heavier music bots, a dedicated setup runs smoother — open a ticket and we'll recommend a plan sized for the extra load.

Frequently asked questions

Why does Lavalink need so much RAM? It runs on the Java Virtual Machine and buffers audio, which is memory-hungry. Pair it with a bot on the same plan and you'll want plenty of headroom.

Where do I set the Lavalink password and port? In Lavalink's application.yml, and then mirror the same host, port, and password in your bot's config so they match.