Skip to main content

Lavalink Setup

 Lavalink - the newer, better way to do music




Lavalink is a standalone program, written in Java. It's a lightweight solution for playing music from sources such as YouTube or Soundcloud. Unlike raw voice solutions, such as VoiceNext, Lavalink can handle hundreds of concurrent streams, and supports sharding.

Configuring Java

In order to run Lavalink, you must have Java 13 or greater installed. Certain Java versions may not be functional with Lavalink, so it is best to check the requirements before downloading. The latest releases can be found here.

Make sure the location of the newest JRE's bin folder is added to your system variable's path. This will make the java command run from the latest runtime. You can verify that you have the right version by entering java -version in your command prompt or terminal.

Downloading Lavalink

Next, head over to the releases tab on the Lavalink GitHub page and download the Jar file from the latest version. Alternatively, stable builds with the latest changes can be found on their CI Server.

The program will not be ready to run yet, as you will need to create a configuration file first. To do so, create a new YAML file called application.yml, and use the example file.

YAML is whitespace-sensitive. Make sure you are using a text editor which properly handles this.

There are a few values to keep in mind.

host is the IP of the Lavalink host. This will be 0.0.0.0 by default, but it should be changed as it is a security risk. For this guide, set this to 127.0.0.1 as we will be running Lavalink locally.


port is the allowed port for the Lavalink connection. 2333 is the default port, and is what will be used for this guide.


password is the password that you will need to specify when connecting. This can be anything as long as it is a valid YAML string. Keep it as youshallnotpass for this guide.


When you are finished configuring this, save the file in the same directory as your Lavalink executable.

Keep note of your port, address, and password values, as you will need them later for connecting.

 

Starting Lavalink

Open your command prompt or terminal and navigate to the directory containing Lavalink. Once there, type java -jar Lavalink.jar. You should start seeing log output from Lavalink.

If everything is configured properly, you should see this appear somewhere in the log output without any errors.

If it does, congratulations.