Skip to content

Systemd Service

If you're using a Systemd-based Linux distribution you may want to install Lavalink as a background service. You will need to create a lavalink.service file inside /usr/lib/systemd/system. Create the file with the following template (replacing the values inside the <> brackets):

# Describe the service
Description=Lavalink Service

# Configure service order

# The user which will run Lavalink

# The group which will run Lavalink

# Where the program should start

# The command to start Lavalink
ExecStart=java -Xmx4G -jar </home/usr/lavalink>/Lavalink.jar

# Restart the service if it crashes

# Delay each restart by 5s

# Start this service as part of normal system start-up

To initiate the service, run

$ sudo systemctl daemon-reload
$ sudo systemctl enable lavalink
$ sudo systemctl start lavalink

In addition to the usual log files, you can also view the log with

$ sudo journalctl -u lavalink