Skip to main content
The Config Server is an advanced feature designed for large deployments managing multiple Lavalink instances. For single-server deployments, use the application.yml file instead.
The Lavalink Config Server allows you to manage the configuration of multiple Lavalink servers from a centralized location, supporting both Git repositories and local filesystems as configuration backends.

Features

Centralized Management

Manage all Lavalink configurations from one location

Git Integration

Store configurations in Git for version control

Profile Support

Different configurations for different environments

Hot Reloading

Update configurations without restarting servers

Architecture

The Config Server acts as a centralized configuration provider:
┌─────────────────┐
│  Git Repository │
│       or        │  ──┐
│  Local Files    │    │
└─────────────────┘    │

              ┌─────────────────┐
              │  Config Server  │
              │   (Port 8888)   │
              └─────────────────┘

        ┬──────────────┼──────────────┬
        │              │              │
        ▼              ▼              ▼
  ┌──────────┐  ┌──────────┐  ┌──────────┐
  │ Lavalink │  │ Lavalink │  │ Lavalink │
  │ Server 1 │  │ Server 2 │  │ Server 3 │
  └──────────┘  └──────────┘  └──────────┘
Configure your Lavalink servers to pull configuration from the Config Server.

Using application.yml

application.yml
spring:
  config:
    import: configserver:http://localhost:8888
  cloud:
    config:
      enabled: true
      name: lavalink
      profile: default
      label: main
      fail-fast: true
      username: admin
      password: youshallnotpass
spring.config.import
string
required
URL of the Config Server in the format configserver:http://host:port.
spring.cloud.config.enabled
boolean
default:"true"
Enable Spring Cloud Config client.
spring.cloud.config.name
string
default:"lavalink"
Application name used to locate configuration files.
spring.cloud.config.profile
string
default:"default"
Configuration profile (e.g., “production”, “staging”, “development”).
spring.cloud.config.label
string
default:"main"
Git branch or label to use.
spring.cloud.config.fail-fast
boolean
default:"true"
Whether to fail startup if the Config Server is unavailable.
spring.cloud.config.username
string
Username for Config Server basic authentication.
spring.cloud.config.password
string
Password for Config Server basic authentication.

Using Environment Variables

SPRING_CONFIG_IMPORT=configserver:http://localhost:8888
SPRING_CLOUD_CONFIG_ENABLED=true
SPRING_CLOUD_CONFIG_NAME=lavalink
SPRING_CLOUD_CONFIG_PROFILE=production
SPRING_CLOUD_CONFIG_LABEL=main
SPRING_CLOUD_CONFIG_FAIL_FAST=true
SPRING_CLOUD_CONFIG_USERNAME=admin
SPRING_CLOUD_CONFIG_PASSWORD=youshallnotpass

Config Server Setup

Docker Deployment

The recommended way to run the Config Server is using Docker.
docker-compose.yml
services:
  lavalink-config-server:
    image: ghcr.io/lavalink-devs/lavalink-config-server:master
    container_name: lavalink-config-server
    restart: unless-stopped
    environment:
      # Set environment variables here
      SPRING_SECURITY_USER_NAME: admin
      SPRING_SECURITY_USER_PASSWORD: youshallnotpass
      SPRING_PROFILES_ACTIVE: native
    volumes:
      # Mount application.yml if not using environment variables
      - ./application.yml:/opt/Lavalink-Config-Server/application.yml
      # Mount config files directory for native backend
      - ./config:/opt/Lavalink-Config-Server/config
    networks:
      - lavalink
    expose:
      - 8888
    ports:
      # Only expose if accessing from outside Docker network
      - "8888:8888"
      # For localhost only:
      # - "127.0.0.1:8888:8888"

networks:
  lavalink:
    name: lavalink

Config Server Configuration

Store configurations in a Git repository:
application.yml
spring:
  security:
    enabled: true
    user:
      name: admin
      password: "youshallnotpass"
  profiles:
    active: git
  cloud:
    config:
      server:
        accept-empty: false
        git:
          uri: "https://github.com/lavalink-devs/Lavalink-Example-Configs"
          search-paths: "{application}"
          skipSslValidation: false
          timeout: 5
          cloneOnStart: true
          force-pull: false
          deleteUntrackedBranches: false
          refreshRate: 0
          # For private repositories:
          # username: trolley
          # password: ghp_token_here
          defaultLabel: main

server:
  port: 8888
  address: 0.0.0.0

logging:
  level:
    root: INFO
    org.springframework.cloud.config: DEBUG
spring.cloud.config.server.git.uri
string
required
Git repository URL. Supports placeholders: {application}, {profile}, {label}.
spring.cloud.config.server.git.search-paths
string
default:""
Subdirectories to search for config files. Use {application} to organize by app name.
spring.cloud.config.server.git.cloneOnStart
boolean
default:"false"
Clone repository on startup instead of on first request.
spring.cloud.config.server.git.defaultLabel
string
default:"main"
Default Git branch to use.

Environment Variables for Config Server

# Security
SPRING_SECURITY_ENABLED=true
SPRING_SECURITY_USER_NAME=admin
SPRING_SECURITY_USER_PASSWORD=youshallnotpass

# Profile
SPRING_PROFILES_ACTIVE=git

# Git Configuration
SPRING_CLOUD_CONFIG_SERVER_ACCEPT_EMPTY=false
SPRING_CLOUD_CONFIG_SERVER_GIT_URI=https://github.com/lavalink-devs/Lavalink-Example-Configs
SPRING_CLOUD_CONFIG_SERVER_GIT_SEARCH_PATHS={application}
SPRING_CLOUD_CONFIG_SERVER_GIT_SKIP_SSL_VALIDATION=false
SPRING_CLOUD_CONFIG_SERVER_GIT_TIMEOUT=5
SPRING_CLOUD_CONFIG_SERVER_GIT_CLONE_ON_START=true
SPRING_CLOUD_CONFIG_SERVER_GIT_FORCE_PULL=false
SPRING_CLOUD_CONFIG_SERVER_GIT_DELETE_UNTRACKED_BRANCHES=false
SPRING_CLOUD_CONFIG_SERVER_GIT_REFRESH_RATE=0
SPRING_CLOUD_CONFIG_SERVER_GIT_DEFAULT_LABEL=main

# For private repositories
# SPRING_CLOUD_CONFIG_SERVER_GIT_USERNAME=trolley
# SPRING_CLOUD_CONFIG_SERVER_GIT_PASSWORD=ghp_token_here

# Server
SERVER_PORT=8888
SERVER_ADDRESS=0.0.0.0

# Logging
LOGGING_LEVEL_ROOT=INFO
LOGGING_LEVEL_ORG_SPRINGFRAMEWORK_CLOUD_CONFIG=DEBUG

Configuration Repository Structure

Organize your configuration files following this structure:
.
└── Lavalink/
    ├── application.yml              # Default configuration
    ├── application-production.yml   # Production profile
    ├── application-staging.yml      # Staging profile
    └── application-development.yml  # Development profile

Profile Override Behavior

Configurations are merged in this order:
  1. application.yml (base configuration)
  2. application-{profile}.yml (profile-specific overrides)
Example:
lavalink:
  server:
    password: "default-password"
    sources:
      youtube: false
      bandcamp: true
      soundcloud: true
    bufferDurationMs: 400
Result for production profile:
lavalink:
  server:
    password: "production-secure-password"  # Overridden
    sources:
      youtube: false        # Inherited from base
      bandcamp: true        # Inherited from base
      soundcloud: true      # Inherited from base
    bufferDurationMs: 800   # Overridden

Example Config Repository

See the Lavalink Example Configs repository for a complete example setup.

Complete Deployment Example

docker-compose.yml
version: '3.8'

services:
  # Config Server
  config-server:
    image: ghcr.io/lavalink-devs/lavalink-config-server:master
    container_name: lavalink-config-server
    restart: unless-stopped
    environment:
      SPRING_SECURITY_USER_NAME: admin
      SPRING_SECURITY_USER_PASSWORD: youshallnotpass
      SPRING_PROFILES_ACTIVE: git
      SPRING_CLOUD_CONFIG_SERVER_GIT_URI: https://github.com/your-org/lavalink-configs
      SPRING_CLOUD_CONFIG_SERVER_GIT_DEFAULT_LABEL: main
      SPRING_CLOUD_CONFIG_SERVER_GIT_CLONE_ON_START: true
    networks:
      - lavalink
    expose:
      - 8888
  
  # Lavalink Server 1 - Production
  lavalink-1:
    image: ghcr.io/lavalink-devs/lavalink:latest
    container_name: lavalink-production-1
    restart: unless-stopped
    depends_on:
      - config-server
    environment:
      SPRING_CONFIG_IMPORT: configserver:http://config-server:8888
      SPRING_CLOUD_CONFIG_NAME: lavalink
      SPRING_CLOUD_CONFIG_PROFILE: production
      SPRING_CLOUD_CONFIG_USERNAME: admin
      SPRING_CLOUD_CONFIG_PASSWORD: youshallnotpass
    networks:
      - lavalink
    ports:
      - "2333:2333"
  
  # Lavalink Server 2 - Staging
  lavalink-2:
    image: ghcr.io/lavalink-devs/lavalink:latest
    container_name: lavalink-staging-1
    restart: unless-stopped
    depends_on:
      - config-server
    environment:
      SPRING_CONFIG_IMPORT: configserver:http://config-server:8888
      SPRING_CLOUD_CONFIG_NAME: lavalink
      SPRING_CLOUD_CONFIG_PROFILE: staging
      SPRING_CLOUD_CONFIG_USERNAME: admin
      SPRING_CLOUD_CONFIG_PASSWORD: youshallnotpass
    networks:
      - lavalink
    ports:
      - "2334:2333"

networks:
  lavalink:
    name: lavalink

Security Best Practices

  • Always enable authentication on the Config Server
  • Use strong, unique passwords
  • Consider using OAuth2 for production deployments
  • Rotate credentials regularly
  • Run Config Server on an internal network
  • Use TLS/SSL for all connections
  • Restrict access using firewall rules
  • Don’t expose the Config Server to the public internet
  • Use private repositories for production configs
  • Enable branch protection on main branches
  • Use Personal Access Tokens instead of passwords
  • Audit access to configuration repositories

Troubleshooting

Verify:
  1. Configuration files exist in the repository
  2. File names match: application.yml or application-{profile}.yml
  3. Files are in the correct directory (check search-paths)
  4. Git repository has been cloned (check logs)
  5. Branch/label specified exists
Check:
  1. Refresh rate settings
  2. Git repository has latest changes
  3. Lavalink server needs restart for some changes
  4. Cache settings on the Config Server
  5. Profile name is correct

application.yml Reference

Complete configuration options

Environment Variables

Alternative configuration method

Config Server GitHub

Config Server source code and documentation

Example Configs

Example configuration repository

Build docs developers (and LLMs) love