---
title: "Deploy Lavalink | (Just Updated) Discord Music Node Whose YouTube Actually Plays"
description: "Discord audio node with a working YouTube source and a real password."
category: "Bots"
url: https://railway.com/deploy/lavalink-or-just-updated-discord-music-n
---

# Deploy Lavalink | (Just Updated) Discord Music Node Whose YouTube Actually Plays

Discord audio node with a working YouTube source and a real password.

**[Deploy Lavalink | (Just Updated) Discord Music Node Whose YouTube Actually Plays on Railway](https://railway.com/template/lavalink-or-just-updated-discord-music-n)**

- **Creator:** SuperSlowSloth
- **Category:** Bots

## Template content

### lavalink

- **Image:** ghcr.io/bon5co/lavalink-railway:4.2.2
- **Health check:** /metrics
- **Public domain:** Yes

## Documentation

# Deploy and Host Lavalink on Railway

Lavalink is a standalone audio-sending node for Discord bots: your bot asks it to load and
play a track, and it does all the fetching, decoding and opus encoding, so the bot process
never blocks on audio. This template runs Lavalink 4.2.2 as a single service with a
working YouTube source, a password that is generated for you, and a heap sized to whatever
plan you deploy it on.

## About Hosting Lavalink

Lavalink is a JVM service that holds a WebSocket connection to your bot and a UDP voice
connection to Discord for every playing guild, so it wants steady CPU and RAM rather than
disk. It keeps no state on disk — sessions and players live in memory — which is why this
template ships no volume and no database.

Three things usually go wrong when it is hosted from a generic template, and this one fixes
all three before you see it:

- **The password.** Lavalink accepts an empty `lavalink.server.password`, and an empty
  password is not "auth off" in a way you would notice: a request with no `Authorization`
  header gets `401`, but a request whose `Authorization` header is empty gets `200` — the
  node is open, and anybody who finds the URL can stream audio on your bill. Here the
  password is generated at deploy time, and the container refuses to start if it is blank.
- **YouTube.** The built-in YouTube source is deprecated and the plugin has to be current;
  on the version most templates pin, every YouTube lookup returns
  `"Something went wrong while looking up the track."` This image bakes youtube-plugin
  1.18.2 in, with an explicit client list, and no jar is downloaded at boot.
- **Memory.** A hardcoded `-Xmx768m` applies whether you run 1 GB or 32 GB. The entrypoint
  reads the container's cgroup limit and gives the JVM 70% of it.

## Common Use Cases

- Discord music bots, including sharded bots served by one node
- 24/7 radio, playlist or lofi-stream playback
- Multiple bots sharing a single audio node
- Audio filtering (equalizer, timescale, karaoke, rotation) offloaded from the bot process

## Dependencies for Lavalink Hosting

- A Discord bot that speaks the Lavalink v4 protocol (Lavalink4NET, lavalink-client,
  Lavalink.py, Riffy, Shoukaku, …)

### Deployment Dependencies

- Lavalink: https://lavalink.dev
- Lavalink source: https://github.com/lavalink-devs/Lavalink
- youtube-source plugin: https://github.com/lavalink-devs/youtube-source
- Template image source: https://github.com/bon5co/lavalink-railway

## Why Deploy Lavalink on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your
infrastructure so you don't have to deal with configuration, while allowing you to
vertically and horizontally scale it.

By deploying Lavalink on Railway, you are one step closer to supporting a complete
full-stack application with minimal burden. Host your servers, databases, AI agents, and
more on Railway.

## After deploying

1. Copy `LAVALINK_SERVER_PASSWORD` from the service's Variables tab.
2. Point your bot at the public domain: host = your `*.up.railway.app` domain, port `443`,
   secure/TLS **on**, password = the value above.
3. Check it: `curl -H "Authorization: " https:///v4/info`.

Sources, filters, buffer sizes and YouTube clients are baked into the image, so the deploy
form asks for nothing. Any of them can still be overridden with the usual
`LAVALINK_SERVER_*` environment variables.


## Similar templates

- [Telegram JavaScript Bot](https://railway.com/deploy/5lRkWa) — A template for Telegram bot in JavaScript using grammY
- [Cobalt Tools [Updated Aug ’26]](https://railway.com/deploy/cobalt) — Cobalt Tools [Aug ’26] (Media Downloader, Converter & Automation) Self Host
- [Telegram Gateway](https://railway.com/deploy/railway-telegram-gateway) — Multi-bot Telegram webhook gateway with real-time WebSocket event streaming

Open this page in a browser: https://railway.com/deploy/lavalink-or-just-updated-discord-music-n
