Self-hosting
This guide sets you up with a self-hosted Fluxcord bot.
Prerequisites
Section titled “Prerequisites”- A system with Docker and Docker Compose (install Docker Desktop on Windows/macOS, or Docker Engine on Linux).
- Both Fluxer and Discord has Developer Mode enabled (go to Settings > Advanced and enable “Developer Mode”)
Installing
Section titled “Installing”-
Firstly, make a folder for Fluxcord and enter it.
Terminal window mkdir fluxcordcd fluxcord -
Then, create a file called
docker-compose.ymland paste this into it.Terminal window nano docker-compose.ymlservices:bot:image: git.gay/fluxcord/core:latestrestart: on-failurevolumes:- ./data:/data- ./config.js:/app/config.jsexpose:- "8080"healthcheck:test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:8080/health').then(r=>{if(!r.ok)process.exit(1)}).catch(()=>process.exit(1))"]interval: 30stimeout: 5sstart_period: 60sretries: 3networks:- fluxcord-netnetworks:fluxcord-net:driver: bridgename: fluxcord-net./datais where the bot’s database and files live../config.jsis the config file we’ll edit later. -
Download the example config file as
config.js:Terminal window curl -o config.js https://git.gay/Fluxcord/core/raw/branch/main/config.example.jsOr, if you have wget:
Terminal window wget -O config.js https://git.gay/Fluxcord/core/raw/branch/main/config.example.js
Making a bot (Discord)
Section titled “Making a bot (Discord)”- Go to https://discord.com/developers/applications (log in if needed)
- Go to Applications, and create an application by clicking “New Application”.
- Name your bot, accept the terms, and click “Create”.
- Copy the Application ID. We’ll need that, then go to Bot, then click “Reset Token”. Verify your Multi-factor Authentication if needed.
- Copy the generated token, we’ll also need that.
- Scroll down and enable “Message Content Intent”.
Making a bot (Fluxer)
Section titled “Making a bot (Fluxer)”- Go to Settings > Applications, and create an application by clicking “Create Application”.
- Name your bot, and click “Create”.
- Copy the Application ID. We’ll need that in the next step.
- Click “Reset Token”. Verify your Multi-factor Authentication if needed.
- Copy the generated token, we’ll need that.
Making a community for temporary emojis (Fluxer)
Section titled “Making a community for temporary emojis (Fluxer)”This is so the bot can store temporary bridged emojis. If you want to use an existing community you can skip to step 3.
- Scroll all the way down the left sidebar, click the + button (Create or join a community), then click “Create Community”.
- Name it something, and click “Create Community”.
- Now, invite the Fluxer bot by using this link. Replace the
[APP_ID]to the Application ID we got on the previous step.If you’re pointing the bot at a self-hosted Fluxer instance, replacehttps://web.fluxer.app/oauth2/authorize?client_id=[APP_ID]&scope=bot&permissions=2260735261797440web.fluxer.appwith your instance’s address. - After that, right click the community and click “Copy Community ID”
Editing the config file
Section titled “Editing the config file”- Firstly, open the config file.
Terminal window nano config.js # or vi, gedit, kwrite, emacs... - Then, fill in the values you got from the previous steps.
DiscordBotToken: "...", // Discord bot tokenDiscordClientId: "...", // Discord Application IDFluxerBotToken: "...", // Fluxer bot tokenFluxerTempEmojiGuildId: "...", // temporary emoji community ID
- Add your Discord and Fluxer accounts on the Admin account IDs by
right clicking your user and click “Copy User ID”, then pasting it on
the
AdminAccountIdsfield.AdminAccountIds: ["YOUR_DISCORD_ID", "YOUR_FLUXER_ID"],
Using PostgreSQL (optional)
Section titled “Using PostgreSQL (optional)”Fluxcord uses SQLite by default, which is fine for almost everyone. To use PostgreSQL instead, set PostgresConnectionString:
PostgresConnectionString: "postgres://user:password@host:5432/fluxcord",DatabaseEncryptionToken only applies to SQLite and is ignored when Postgres is set. Migrations run automatically on start.
To move existing SQLite data into Postgres:
docker compose exec bot pnpm run migrate:to-postgresPointing at a self-hosted Fluxer instance
Section titled “Pointing at a self-hosted Fluxer instance”If your bot bridges to a self-hosted Fluxer instance instead of fluxer.app, do this when editing the config file:
- Firstly, open your
config.js:Terminal window nano config.js # or vi, gedit, kwrite, emacs... - Then, point the bot at your instance:
Make sure the Fluxer bot token, Application ID, and temporary emoji community all come from your instance as well.FluxerAPIBaseURL: "https://example.com/api",
- If you use voice bridging later, make sure the voice runner can reach your instance’s LiveKit URL. The runner gets the LiveKit address from your Fluxer server, so make sure that is accessible to the bot.
Running the bot
Section titled “Running the bot”- Run the bot.
The image is pulled automatically, and migrations run on first start.
Terminal window docker compose up -d - To see logs, just run
Terminal window docker compose logs -f
Updating Fluxcord
Section titled “Updating Fluxcord”docker compose pulldocker compose up -d --force-recreateThis downloads the newest image and restarts the bot.
To check whether new settings were added:
curl -o config.example.js https://git.gay/Fluxcord/core/raw/branch/main/config.example.jsOr, if you have wget:
wget -O config.example.js https://git.gay/Fluxcord/core/raw/branch/main/config.example.jsdiff config.example.js config.jsPorts and networking
Section titled “Ports and networking”You don’t need to open any ports. Fluxcord only makes outbound connections to Discord and Fluxer.
8080is the healthcheck endpoint (/health). It’s only reachable inside Docker; to view it from the host, add this to thebotservice:ports:- "8080:8080"8765(RunnerWsPort) is used between the bot and the voice runner. Keep it internal. Only publish it if the voice runner runs on a different server.
Inviting the bot
Section titled “Inviting the bot”The bot will output the invite links on the log/console. Those are the invite codes you use to invite the bot to your server.
After that, go to Getting Started and follow steps 2-4.
Voice bridging (optional)
Section titled “Voice bridging (optional)”If you want voice bridging, follow the Self-hosting voice guide after the bot is running.
To run the bot and the voice runner together from one file, use this docker-compose.yml instead:
services: bot: image: git.gay/fluxcord/core:latest restart: on-failure volumes: - ./data:/data - ./config.js:/app/config.js networks: - fluxcord-net
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
networks: fluxcord-net: driver: bridge name: fluxcord-netThe bot’s service is named bot here, so the voice runner reaches it at ws://bot:8765. Create a .env file next to it with the same secret you’ll put in config.js:
RUNNER_SECRET=your-long-random-secretThen enable voice in config.js and start everything (the Self-hosting voice guide covers the rest).