Lavalink Node Setup Guide: Connect Your Discord Music Bot
A complete step-by-step guide to setting up a Lavalink v4 audio node for your Discord music bot — from application.yml configuration to connecting with discord.js and Shoukaku.

What is Lavalink and Why Do You Need It?
Lavalink is a standalone audio server that handles audio downloading, encoding, and streaming for Discord bots. Instead of your bot process doing the heavy CPU work of decoding YouTube audio, Lavalink offloads this to a dedicated Java process. This means your bot stays lightweight and responsive, even when streaming music to dozens of voice channels simultaneously.
Prerequisites
Before setting up Lavalink, you need:
- A hosting server with at least 1 GB RAM (VisiHost Lavalink plans start at ₹10/mo)
- Java 17+ installed (Lavalink v4 requires it)
- A Discord bot using a Lavalink client library (Shoukaku, Lavaclient, or similar)
Step 1: Download Lavalink
Grab the latest Lavalink.jar from the official GitHub releases page. As of 2026, Lavalink v4 is the recommended version with improved plugin support and better memory management.
Step 2: Configure application.yml
This is the most critical step. Create an application.yml file in the same directory as your Lavalink.jar:
server:
port: 2333
address: 0.0.0.0
lavalink:
plugins:
- dependency: "dev.arbjerg.lavalink:youtube-plugin:1.11.3"
repository: "https://maven.lavalink.dev/releases"
server:
password: "your_secure_password_here"
sources:
youtube: true
bandcamp: true
soundcloud: true
twitch: true
vimeo: true
http: true
local: false
bufferDurationMs: 400
frameBufferDurationMs: 5000
opusEncodingQuality: 10
resamplingQuality: HIGH
trackStuckThresholdMs: 10000
useSeekGhosting: true
youtubePlaylistLoadLimit: 6
playerUpdateInterval: 5
youtubeSearchEnabled: true
soundcloudSearchEnabled: true
gc-warnings: true
logging:
level:
root: INFO
lavalink: INFO
Step 3: Launch Lavalink
Run the server with optimal JVM flags:
java -Xmx1G -Xms512M -jar Lavalink.jar
You should see Lavalink is ready to accept connections in the console output.
Step 4: Connect Your Bot
Here's a minimal discord.js + Shoukaku setup:
const { Client, GatewayIntentBits } = require('discord.js');
const { Shoukaku, Connectors } = require('shoukaku');
const nodes = [{
name: 'VisiHost Node',
url: 'localhost:2333',
auth: 'your_secure_password_here'
}];
const client = new Client({
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildVoiceStates]
});
const shoukaku = new Shoukaku(new Connectors.DiscordJS(client), nodes);
shoukaku.on('ready', (name) => console.log(`Node ${name} connected`));
Hosting Your Lavalink Node
Self-hosting on your PC means your music bot goes offline when you close your laptop. For 24/7 audio streaming, VisiHost's cheap Lavalink node hosting gives you enterprise AMD EPYC hardware with guaranteed uptime, low-latency network routing to Discord's voice servers, and pre-configured Java 17 environments — deploy in minutes, not hours.
Configuration Example
{
"server": "lavalink-node-setup-guide",
"status": "active"
}
Keep Your Discord Bot Online 24/7
No sleep scripts needed. High-performance hosting for Node.js and Python.
Explore more about VisiHost
Check out our other affordable hosting packages and guides.