Lavalink
Step-by-step guide to host a Lavalink audio server on Discloud.
🎵 What is Lavalink?
Lavalink is a standalone audio streaming server used by Discord music bots to play audio from sources like YouTube, SoundCloud, Bandcamp, Twitch, and more. Instead of handling audio directly inside the bot, Lavalink offloads all the heavy audio processing to a dedicated server.
Lavalink runs as a Java application and exposes a WebSocket API that your bot connects to.
✅ Requirements
🚀 Step-by-Step Setup
⬇️ Download Lavalink.jar
Download the latest stable release of Lavalink from the official GitHub repository:
👉 https://github.com/lavalink-devs/Lavalink/releases
Download the file named Lavalink.jar from the Assets section of the latest release.
📝 Create application.yml
Create a file named application.yml in the same folder as Lavalink.jar. This is the main configuration file for Lavalink.
⚙️ Create discloud.config
Create a discloud.config file in the same folder:
NAME=MyLavalink
TYPE=site
MAIN=Lavalink.jar
RAM=512
VERSION=17.x.x
ID=my-lavalink-subdomainTYPE=site- Required because Lavalink listens on a network port.MAIN=Lavalink.jar- Must match the exact filename of the JAR.VERSION=17.x.x- Lavalink 4.x requires Java 17. Use17.x.xorlatest.ID- Your registered subdomain (without.discloud.appor.discloud.dev).
📦 Create the ZIP file
Your folder should contain exactly these three files:
lavalink-upload/
├─ Lavalink.jar
├─ application.yml
└─ discloud.configCompress these files into a .zip archive. Make sure the files are at the root of the ZIP, do not compress a folder.
🚀 Upload to Discloud
How To Host🤖 Configure your bot
Connect your Discord bot to Lavalink using your subdomain. Since Discloud uses HTTPS/WSS with a reverse proxy, you must connect on port 443 with secure: true.
{
"host": "my-lavalink-subdomain.discloud.app",
"port": 443,
"secure": true,
"password": "youshallnotpass"
}Replace my-lavalink-subdomain with your actual subdomain and youshallnotpass with the password you set in application.yml.
🔗 Connecting a YouTube Account (OAuth2)
By default, Lavalink may display a login prompt in the logs asking you to authorize a YouTube account. This is required to avoid YouTube throttling and playback errors.
📋 Start Lavalink and check the logs
After uploading and starting your Lavalink instance, check the application logs. Look for a message similar to:
🔑 Authorize the YouTube account
Open the URL from the logs in your browser (e.g., https://www.youtube.com/device?user_code=XXXX-XXXX).
Sign in with the Google / YouTube account you want Lavalink to use. A personal account works fine, a dedicated account is recommended.
✅ Confirm authorization
After granting access, return to your Lavalink logs. You should see a message confirming the authorization was successful:
Lavalink will save the token and reuse it automatically on future restarts. You do not need to repeat this process unless you revoke the access or change the account.
Last updated