Skip to content

How to configure your Lavalink server on Linux, Windows and Replit

License

Notifications You must be signed in to change notification settings

LucasB25/lavalink-server

Repository files navigation

Contributors Forks Stargazers Issues Support Server MIT License Run on Repl.it

Lavalink Server

Support Server · Report Bug & Request Feature

📦 Where can I host Lavalink?

Windows
  1. Setup the server:

    # Run Windows PowerShell as Administrator
    cd "C:\"
    bitsadmin /transfer myDownloadJob /download /priority normal https://raw.githubusercontent.com/LucasB25/lavalink-server/main/LavalinkWindows/ServerSetup.ps1 C:\ServerSetup.ps1
    & .\ServerSetup.ps1
  2. ⚠️ Restart Windows ⚠️

  3. Run ServerSetup.ps1 again:

    # Run Windows PowerShell as Administrator
    cd "C:\"
    & .\ServerSetup.ps1
  4. Setup Lavalink:

    # Run Windows PowerShell as Administrator
    cd "C:\"
    bitsadmin /transfer myDownloadJob /download /priority normal https://raw.githubusercontent.com/LucasB25/lavalink-server/main/LavalinkWindows/LavalinkSetup.ps1 C:\LavalinkSetup.ps1
    & .\LavalinkSetup.ps1
  5. Configure application.yml:

    # Edit C:\LavalinkServer\application.yml
    # Email of your Google account
    email: "[email protected]"
    # Password of your Google account
    password: "your-password"
    
    # If you want to use other sources like Spotify, AppleMusic, Deezer, YandexMusic & FloweryTTS, enable and configure them!
  6. Start Lavalink 24/7:

    cd "C:\LavalinkServer"
    pm2 start --name Lavalink --max-memory-restart 4G java -- -jar Lavalink.jar
Linux
  1. Install required packages:

    sudo apt-get install -y sudo wget
  2. Switch to root and navigate to home directory:

    sudo su
    cd ~
  3. Setup the server:

    wget -O LavalinkSetup.sh https://raw.githubusercontent.com/LucasB25/lavalink-server/main/SetupLinux/LavalinkSetup.sh
    chmod +rwx LavalinkSetup.sh
    ./LavalinkSetup.sh
  4. Configure application.yml:

    sudo nano /opt/lavalink/application.yml
    # Email of your Google account
    email: "[email protected]"
    # Password of your Google account
    password: "your-password"

    Go (Source Configuration)

  5. Restart Lavalink:

    sudo systemctl daemon-reload
    sudo systemctl restart lavalink

Systemd Service Commands

  • Reload Systemd daemon:

    sudo systemctl daemon-reload
  • Enable a service at boot:

    sudo systemctl enable lavalink
  • Start a service:

    sudo systemctl start lavalink
  • View service logs:

    sudo journalctl -u lavalink
  • Check service status:

    sudo systemctl status lavalink
  • Stop a service:

    sudo systemctl stop lavalink
  • Restart a service:

    sudo systemctl restart lavalink
Replit

Run on Replit

Connecting

  • Lavalink's port will always be 443 on Replit.

  • Configure application.yml:

    server: # REST and WS server
      port: 443
      address: 0.0.0.0
    
    # Email of your Google account
    email: "[email protected]"
    # Password of your Google account
    password: "your-password"
    
    # If you want to use other sources like Spotify, AppleMusic, Deezer, YandexMusic & FloweryTTS, enable and configure them!
  • Default password: youshallnotpass.

  • Example Configuration:

    {
      "host": "lavalink.LucasB25.repl.co",
      "password": "youshallnotpass",
      "port": 443,
      "identifier": "lavalink v4",     
      "secure": true
    }

Important Notes

  • To keep the server running 24/7, use a service like UptimeRobot to send HTTP requests to your app every 5 minutes. For example, if your app is named lavalink-repl and your Replit username is ahmasa, make an HTTP request to https://lavalink-repl.ahmasa.repl.co.
  • Ensure your connection to the node is secure, e.g., use https/wss.
  • Don’t forget to set your password in the application.yml file.
Source Configuration

☕ Donate

Do you like this project? Support it by donating! ko-fi

👥 Contributors

Thanks to these wonderful people: