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.
Running Lavalink alongside your bot
Lavalink is a Java service that your bot talks to over a local port. Here's the setup:
- Add a port in the Ports tab for Lavalink to listen on.
- Upload
Lavalink.jarand itsapplication.ymlto the Files tab, and run it. Lavalink needs Java and extra RAM, so a larger plan helps. - 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.