← All guides

Bots & voice · Server guide

How to host a Lavalink server for your Discord music bot: setup and config

What Lavalink is, why music bots use it, how to set up application.yml, the password and the YouTube plugin, and how to run a Lavalink node on GGHOST Cloud.

GGHOST Cloud team26 October 20266 min read

Lavalink
  • Starts at On request
  • Recommended RAM Sized for you
  • Ready in A few days
  • Control panel Pterodactyl

Music bots have a heavy job. Every song has to be fetched, decoded, re-encoded and streamed to Discord’s voice servers in real time, for every server listening at once. Doing that inside the bot process makes the bot slow and fragile. Lavalink moves that work to its own program, a separate audio node your bot talks to over the network. This guide explains what Lavalink is, how to configure it, and how to run it on a server so your music bot stays responsive.

Lavalink is a standalone audio sending node written in Java. Your bot stays in charge of commands, queues and Discord logic, and sends Lavalink simple instructions: load this track, play it in this guild, pause, skip, change the volume. Lavalink does the audio processing and streams the result to Discord.

That split has real benefits:

  • The bot stays light. Audio work no longer competes with command handling.
  • It works with any language. There are Lavalink client libraries for the common bot languages, including JavaScript and Python, so the same node works whether your bot is built on discord.js or discord.py.
  • It can be shared. One node can serve more than one bot, and a large bot can spread its players across several nodes.

Lavalink does nothing on its own. It only plays audio when a bot connected to it asks.

Why run it on a server?

Lavalink has to be reachable whenever your bot is, and it has to stream audio without hiccups. On a home connection, any drop or slow upload is heard straight away as stuttering in every voice channel the bot is in. A hosted node stays online, sits on a stable connection, and restarts on its own if the process exits.

What resources it needs

Lavalink is a Java program, so it needs a reasonable amount of memory just to start, and more as it handles more players. CPU use grows with the number of tracks playing at the same time, because each one is being processed and encoded live. Effects such as equalisers and filters add to that.

In practice, the number that matters is not how many servers your bot is in, but how many of them are listening to music at once. Watch CPU and memory in the panel during your busiest evening and size from there.

Java requirement

The Lavalink documentation states that it needs Java 17 or higher. If you are running it yourself, check your Java version before anything else; an older runtime is the most common reason it fails to start.

Configuring application.yml

Lavalink reads its settings from a file called application.yml in the directory it starts from. You can also set options with environment variables, such as LAVALINK_SERVER_PASSWORD, and those take priority over the file. The sections you will touch most:

server

The server block holds the address and port Lavalink listens on. On our panel the port is assigned per server and shown in the panel, and the port in application.yml has to match it. If they differ, your bot will not be able to connect.

lavalink.server.password

This is the password every client must send to connect. The example config in the Lavalink docs uses youshallnotpass; change it to something long and random. Anyone who has your address, port and password can use your node, so treat the password like a bot token: keep it in your bot’s environment variables, not in its code.

lavalink.server.sources

This switches the built-in audio sources on or off, such as SoundCloud, Bandcamp, Twitch and direct HTTP links. The built-in YouTube source is deprecated and no longer receives updates, so the docs set youtube: false.

lavalink.plugins

Plugins add sources and features. For YouTube, the Lavalink team maintains the youtube-source plugin, which you add as a dependency under lavalink.plugins while keeping the built-in YouTube source disabled. Lavalink downloads plugins into its plugins folder when it starts.

YAML cares about indentation. If Lavalink refuses to start after a config change, the cause is very often a single misaligned line. Paste the file into a YAML checker before you restart.

Connecting your bot

In your bot’s Lavalink client, add a node with three things: the server’s address, its port, and the password. All three are on the panel (the address and port at the top, the password in your config). Keep the password in an environment variable on the bot’s side. Start Lavalink first, then the bot, and look for a successful connection in both logs.

Keeping it running and reading logs

  • Auto-restart. If Lavalink exits, the panel starts it again, and well-written clients reconnect on their own.
  • Read the startup log. Lavalink prints which plugins it loaded and whether it is ready. Plugin download failures and config errors show up here first.
  • Watch for track errors. When a source changes on its side, tracks start failing to load. The log tells you which source and why, which is usually a sign to update that plugin.

Updating

Lavalink and its plugins are updated separately, and sources such as YouTube change often enough that plugin updates matter. When you update:

  1. Take a backup of application.yml and the plugins folder.
  2. Read the release notes for Lavalink and for each plugin, especially across a major version.
  3. Change the plugin version in application.yml, or replace the Lavalink jar, then restart and check the log.

Make sure your bot’s client library supports the Lavalink major version you are running; clients and servers have to speak the same protocol.

Backups

The important file is small: application.yml. Losing it means rebuilding your config and password from memory. On GGHOST Cloud, backups run on a schedule you set and restore from the panel without a ticket.

Lavalink is set up on request, so we can size the node for how much music your bot plays.

  1. Tell us what you need. Ask us on Discord (or open a ticket) with roughly how many tracks play at once at your busiest and which plugins you use.
  2. Get a quote. We size it, quote a monthly price, and set it up on our Pterodactyl panel, usually within a few days.
  3. Edit application.yml in the file manager or over SFTP: set your password, add your plugins, and keep the port matching the one shown in the panel.
  4. Start it, then point your bot at it using the address, port and password.

You get the full panel at panel.gghost.cloud: live console and logs, file manager, SFTP, startup variables, scheduled tasks and sub-users, with auto-restart if the process exits. Every node is behind DDoS protection from our network providers. Live regions today are Singapore and Europe (France–Germany border), with the United States (East, Central and West), the United Kingdom, India, Japan and Australia on demand; putting Lavalink in the same region as your bot keeps the two close. There is no setup fee and no contract, billing is at app.gghost.cloud, and support comes from the people who run the servers, on Discord or at hello@gghost.cloud.

The short version

Lavalink is the audio engine your music bot hands the heavy work to. Run it on Java 17 or newer, set a strong password in application.yml, disable the built-in YouTube source in favour of the youtube-source plugin, keep the port matching the panel, and size the node for how many tracks play at once rather than how many servers your bot is in.

How it works at GGHOST Cloud

From request to running server.

  1. 01 Ask on Discord Tell us the Lavalink build, mods and player count you need.
  2. 02 We size it We recommend the RAM and region, and quote a monthly price.
  3. 03 We set it up Installed on our Pterodactyl panel, usually within a few days.
  4. 04 Invite your players Console, file manager, SFTP and backups, all in one panel.

Included on every server

The platform behind your Lavalink server.

Full Pterodactyl panel

Console, file manager, SFTP, scheduled tasks, sub-users and database access. Not a cut-down skin over it.

Backups on a schedule

Set the cadence you want and restore to a point in time from the panel, without opening a ticket.

DDoS protection included

Every node sits behind DDoS protection from our network providers, on every plan — not an upsell on the checkout page.

Switch version or build anytime

Change the server build, game version or startup flags from the panel and restart. No reinstall, no ticket.

Move region once per cycle

If your players move, the server can follow. We handle the world and config transfer.

No player-slot billing

You pay for memory. Slots are a config value you set, not a line item we charge for.

Lavalink server FAQ

Questions players ask us.

My bot connects to Lavalink but YouTube tracks will not load. Why?

Lavalink's built-in YouTube source is deprecated and no longer updated. Turn it off in application.yml and add the youtube-source plugin under lavalink.plugins instead, then restart and check the log for errors from the plugin.

Can several bots share one Lavalink node?

Yes. Any client that knows the address, port and password can connect, so one node can serve more than one bot. Size it for the total number of tracks playing at once across all of them.

Want a Lavalink server?

Tell us what you need on Discord and we will size it and set it up on our Pterodactyl panel.