Lavalink-Client
  • 😁Lavalink Client
  • Basics
    • How it works
    • Get Started
    • Example Discord Bot
  • Documentation
    • LavalinkManager
      • Manager Options
        • ManagerQueueOptions
          • QueueStoreManager
          • QueueChangesWatcher
        • ManagerPlayerOptions
          • RequestTransformer
          • AutoplayFunction
        • BotClientOptions
      • ManagerUtils
    • NodeManager
      • Types
        • LavalinkNode
        • LavalinkNodeOptions
    • Player
      • PlayerOptions
      • PlayerDestroyReasons
      • PlayerTypes
        • RepeatMode
        • PlayerJson
    • Other Types
      • EQBand
      • FilterData
        • KaraokeFilter
      • Track
        • TrackInfo
        • PluginInfo
      • UnresolvedTrack
      • UnresolvedQuery
      • LavalinkTrack
        • Base64
        • LavalinkTrackInfo
      • Payloads
        • GuildShardPayload
        • PlayerEvent
        • TrackStartEvent
        • TrackEndEvent
        • TrackStuckEvent
        • TrackExceptionEvent
        • WebSocketClosedEvent
      • SearchPlatform
        • LavalinkSearchPlatform
        • ClientSearchPlatform
      • SourceNames
        • LavalinkSourceNames
        • LavaSrc SourceNames (lavalink-plugin)
    • Other Utils and Classes
      • DefaultQueueStore
      • MiniMap
  • Requirements
  • Host a Lavalink-Server
    • application.yml Configuration
      • With Spotify, Deezer, Apple Music, etc.
    • Host via pm2
    • Host via systemd
    • Host via screen
  • ⚪Github
  • 📖Lavalink-Support Server
Powered by GitBook
On this page
  • What about the logs?
  • General Pm2 Usage Tutorial
  1. Host a Lavalink-Server

Host via pm2

PreviousWith Spotify, Deezer, Apple Music, etc.NextHost via systemd

Last updated 1 year ago

  1. Install

    • npm install -g pm2 / yarn add --global pm2

  2. Go into the root directory of Lavalink.jar, and execute the following

pm2 start --name "Lavalink Server" --max-memory-restart 4G java -- -jar Lavalink.jar

now on pm2 list you can see the server (as well it's process ID)

with pm2 stop <ID> you can stop it

with pm2 start <ID> you can start it

on 4 Gigabyte of memory usage, lavalink automatically stops and restart itsself

with pm2 delete <ID> you can stop + delete the lavalink server process (not the directory)

What about the logs?

Pm2 has packages, to auto-rotate and auto-flush the logs to save storage!

pm2 flush # to flush all current logs
pm2 install pm2-logrotate # pm2 install a plugin
pm2 set pm2-logrotate:max_size 10M # config it for 10mb of logs
pm2 set pm2-logrotate:compress true # compress the logs
pm2 set pm2-logrotate:rotateInterval '0 */1 * * *' # rotate logs every hr (cron-job)

I made that Pm2 + Tutorial Cheatsheet, if you ever need it!

pm2
General Pm2 Usage Tutorial
Linux