---
title: "Set up your Lavalink server and connect your music bot"
url: https://help.endercloud.in/docs/connect-your-music-bot-to-lavalink
category: "Bot Hosting"
type: Guide
tags: ["bots", "discord", "lavalink"]
keywords: "lavalink host port password, lavalink v4 node, application.yml, lavalink password startup, lavalink connection refused, lavalink 401 unauthorized, secure false, youtube plugin lavalink, lavasrc, shoukaku, riffy, wavelink, lavalink.py, music bot not playing, lavalink setup, lavalink server, lavalink hosting, lavalink v4, lavalink password, lavalink config, connect bot to lavalink, lavalink not connecting, music bot setup, music bot hosting, lavlink"
difficulty: intermediate
time: "15 minutes"
updated: 2026-11-14
source: Endercloud Knowledge Base (official)
---

# Set up your Lavalink server and connect your music bot

> The LavaLink V4 plan gives you your own Lavalink server that you configure yourself: set the password in Startup, adjust application.yml, then add host, port and password to your bot.

A music bot doesn't play audio by itself: it sends that work to a **Lavalink** server. The **LavaLink V4** plan gives you your own server running Lavalink v4 on the Game Panel. **You set it up and manage it yourself**: choose a password, adjust its settings, then point your bot at it.

> **Note:**
> This is not a managed service. Our team keeps the server and hardware running, but the Lavalink configuration (password, sources, plugins) is yours to set.

## Step 1: Set your Lavalink password

1.  Open your LavaLink server in the [Game Panel](https://panel.endercloud.in) (from billing: **Services** → your LavaLink service → **Auto Login to Panel**).
    
2.  Go to the **Startup** tab and set the password variable to a long, random password.
    
3.  Restart the server with **Restart** so the new password is used.
    

## Step 2: Adjust application.yml (optional)

All other Lavalink settings live in `application.yml`. Open it from the **Files** tab and edit it with the built-in editor. Common changes:

-   **Sources:** turn sources such as SoundCloud, Bandcamp or Twitch on or off under `lavalink.server.sources`.
    
-   **Plugins:** add plugins under `lavalink.plugins`. In Lavalink v4, YouTube playback comes from the official **youtube-source plugin**, and Spotify/Apple Music support comes from plugins such as **LavaSrc**. Follow each plugin's own README for the exact lines to add.
    
-   **Don't change the port.** The server must listen on the port the panel assigned to it (shown in the header and on the **Network** tab).
    

Save the file and **Restart**. Watch the **Console**: Lavalink prints its startup messages and any plugin errors there.

> **Warning:**
> Before editing `application.yml`, make a copy or a [backup](/docs/how-to-create-and-restore-backups). A single wrong indent in a YAML file stops Lavalink from starting.

## Step 3: Find your connection details

-   **Host and port:** the address in the panel header and on the **Dashboard**, for example `astra.endercloud.in:6972`. Before the colon is the host, after it the port.
    
-   **Password:** the one you set in **Startup**.
    
-   **Secure / SSL:** `false`.
    

## Step 4: Add the node to your bot

Every Lavalink client library asks for the same details, though the names differ slightly. A typical Node.js node entry:

```
{
  host: "astra.endercloud.in",
  port: 6972,
  password: process.env.LAVALINK_PASSWORD,
  secure: false
}
```

With Python and Wavelink 3 the details go into a URI:

```
node = wavelink.Node(uri="http://astra.endercloud.in:6972", password=os.getenv("LAVALINK_PASSWORD"))
await wavelink.Pool.connect(nodes=[node], client=bot)
```

Use your own host and port and keep the password in a `.env` file. See [Keep your bot token safe](/docs/keep-your-bot-token-safe-with-environment-variables). Your bot itself runs on a separate bot plan: see [Node.js bot](/docs/host-a-nodejs-discord-bot) or [Python bot](/docs/host-a-python-discord-bot).

> **Warning:**
> **Your library must support Lavalink v4.** Lavalink v4 removed the old v3 API, so old libraries and old music-bot templates fail to connect or play. Update to a version whose documentation mentions Lavalink v4.

## Troubleshooting

| Problem | Likely cause |
| --- | --- |
| 401 / Unauthorized | The password in your bot doesn't match the one in **Startup**, or you didn't restart after changing it. |
| Connection refused or timed out | Lavalink is offline or crashed (check the **Console**), or the host/port is wrong. |
| Lavalink won't start after editing | A YAML mistake in `application.yml` (usually indentation). Restore your copy or backup. |
| SSL or TLS error | `secure` is `true` in your bot. Set it to `false`. |
| Bot connects but never plays | Your client library only supports Lavalink v3, or the source you search (for example YouTube) has no working plugin configured. |
| Out of memory / random restarts | Too many players for 1 GB of RAM. Upgrade with **Upgrade Plan**. |

## Frequently asked questions

**Q: Will Endercloud set up Lavalink or its plugins for me?**

No. The plan gives you the server; configuring Lavalink is up to you. We can help with hosting-side problems such as the server not starting because of resources or ports.

**Q: Can several bots use the same Lavalink server?**

Yes. Any bot with the host, port and password can connect. With 1 GB of RAM, very busy bots may need a bigger plan.

**Q: YouTube stopped working on my Lavalink**

YouTube playback depends on the youtube-source plugin, which needs updates when YouTube changes. Update the plugin version in `application.yml` to the latest release and restart.
