Skip to content

Self-hosting voice

This guide sets you up with self-hosted voice bridging for your Fluxcord bot.

  • A working self-hosted bot from the Self-hosting guide
  • Both Fluxer and Discord has Developer Mode enabled (go to Settings > Advanced and enable “Developer Mode”)

The bot and the voice runner share a secret password so they can trust each other. You’ll generate it here and reuse it in the next section.

  1. Firstly, generate a random secret and copy the output.
    Terminal window
    openssl rand -hex 32
  2. Then, open your config.js:
    Terminal window
    nano config.js # or vi, gedit, kwrite, emacs...
  3. Set the secret to what you copied and enable voice:
    RunnerSecret: "paste-the-secret-here",
    VoiceBridgingEnabled: true,
    Keep the default RunnerWsPort unless you know you need to change it.
  4. After that, restart the bot.
    Terminal window
    docker compose up -d

The voice runner is a second container that sits next to your bot. It connects to the bot over a WebSocket using the secret from the previous step.

  1. Firstly, add the voice runner to your docker-compose.yml. If you already used the combined file from the Self-hosting guide, the voice service is already there and you can skip to step 3. Otherwise, open the file and add this under services:, next to your bot service:
    Terminal window
    nano docker-compose.yml
    voice:
    image: git.gay/fluxcord/voice:latest
    restart: unless-stopped
    environment:
    - CORE_WS_URL=${CORE_WS_URL:-ws://bot:8765}
    - RUNNER_SECRET=${RUNNER_SECRET:-}
    - RUNNER_REGION=${RUNNER_REGION:-}
    networks:
    - fluxcord-net
  2. Then, make sure the runner is pointed at your bot. CORE_WS_URL is where the runner reaches the bot. It defaults to ws://bot:8765, which matches the bot’s service name in the combined file. If your bot’s service is named differently, change bot to match.
  3. Create a .env file next to your docker-compose.yml with the same secret from the previous section:
    Terminal window
    nano .env
    RUNNER_SECRET=paste-the-secret-here
  4. Now, start everything.
    Terminal window
    docker compose up -d
  5. To check that it worked, look at the logs.
    Terminal window
    docker compose logs -f
    Look for Connected to core. If you see that, the runner is ready. If not, the two most common causes are a RUNNER_SECRET that doesn’t match the one in config.js, or a CORE_WS_URL that points at the wrong service name.

Bridging multiple voice channels in one server

Section titled “Bridging multiple voice channels in one server”

Discord only lets one bot user join one voice channel per server at a time. So to bridge two voice channels in the same server at the same time, you need an extra Discord application per extra channel.

  1. Firstly, make another bot by following the Making a bot (Discord) steps on the Self-hosting guide. You only need the token, no Message Content Intent needed. Invite it to your server with the View Channel, Connect, Send Messages, Use Voice Activity, and Speak permissions.
  2. Then, add its token to your config.js:
    DiscordVoiceTokens: [
    "VOICE_TOKEN_1",
    ],
  3. After that, restart the bot.
    Terminal window
    docker compose up -d