Self-hostingReference
Architecture
A self-hosted instance is one supervisor, fluxerd, and its processes. The container image, the systemd service and the Helm chart run the same release.
What runs
Section titled "What runs"These are the parts in the current release. fluxerd ps lists them on your instance, and fluxerd logs <part> shows one part's output.
fluxerdstarts, watches and restarts every other part, and runs the edge (Caddy) and the message queue (NATS) inside itself.postgresis PostgreSQL with all of Fluxer's data, version 17 in the container image, and on the systemd route the newest PostgreSQL 14 or later on the machine at install. SetFLUXER_POSTGRES_URLto use your own PostgreSQL 14 or later instead.apiis the HTTP API and the worker.gatewaykeeps the WebSocket connections that apps hold open for live updates.media-proxyresizes and serves images, video and other media.rustis eight services in one process, such as users, messages, link previews, push, the admin panel and the web app files. An older instance runs each service as its own part, such asusersorunfurl, untilrexctl migrate --migrate=rustmoves all eight services into the onerustprocess.meilisearchis message and member search. To turn search off, setFLUXER_SEARCH_ENGINEtonone.livekitis the voice and video server.FLUXER_LIVEKIT_ENABLED=falseturns it off.valkeykeeps the cache and rate limits on older installs. A new instance keeps them in PostgreSQL, andvalkeydoesn't run there. It also doesn't run whenFLUXER_KV_URLpoints at your own Valkey.seaweedfsandseaweedfs-filerstore uploads on older installs. A new instance keeps uploads in its data folder withFLUXER_STORAGE_BACKEND=filesystem, and SeaweedFS doesn't run there. It also doesn't run whenFLUXER_S3_ENDPOINTpoints at your own S3-compatible storage.
In the container image, tini runs first and starts fluxerd. Every part listens only on 127.0.0.1 inside, except the edge and the voice server.
Ports inside the instance
Section titled "Ports inside the instance"These ports are fixed and bound to 127.0.0.1.
A service already on one of them stops that part of Fluxer from starting.
| Port | Part |
|---|---|
| 14222 | Message queue (NATS) |
| 15432 | PostgreSQL |
| 17700 | Search (Meilisearch) |
| 17880 | Voice server API (LiveKit) |
| 18080 | API |
| 18081 | Gateway |
| 18082 | Media proxy |
| 18083, 18084 and 18085 | Admin panel, web app files and push |
| 18090 to 18094 | Snowflakes, users, messages, GIFs and link previews |
| 16379 | Valkey, only on installs that still use it |
| 18333 and 19333 to 19335 | SeaweedFS, only on installs that still use it |
FLUXER_LOOPBACK_ADDRESS=127.0.0.2 moves them all to another loopback address, and rexctl gives each extra instance on a machine its own. Commands such as fluxerd ctl and fluxerd users talk to the fluxerd that runs with their data folder, over sockets in its runtime folder, which is /run/fluxer, or /run/fluxerd/fluxer with the rexctl unit.
Where data is kept
Section titled "Where data is kept"The database, uploads, search index, certificates, passwords and keys are all in /var/lib/fluxer, and so are the backups.
- With Docker, that is the volume
fluxer-data. - On Kubernetes, it is the PersistentVolumeClaim
data-fluxer-0, ordata-<release>-fluxer-0for a release name withoutfluxer. - Under systemd, settings are in
/etc/fluxer/fluxer.envand releases in/opt/fluxer/releases/<version>, and/opt/fluxer/currentis the running one. - When rexctl manages Fluxer, it keeps its record of the install in
.rexctl/state.jsonin the instance folder, which is/opt/fluxeras root and~/fluxerfor any other account. Never edit that file by hand.
The data folder has secrets.env with Fluxer's passwords and keys, modes.env with choices made on the first start, and VERSION with the release that last ran on the data.
Backups include all of them.
Bundled or proxy mode
Section titled "Bundled or proxy mode"FLUXER_EDGE_MODE decides how traffic gets in.
bundled, the default, listens on ports 80 and 443 and gets its own certificate. Pick it when nothing else on the machine uses those ports.proxyserves plain HTTP on 8080 and trustsX-Forwarded-Forfrom private addresses. Pick it when you already run nginx, Caddy, Traefik or a load balancer, and point that proxy at Fluxer with one of the configs there.tunnelis likeproxy, for Cloudflare Tunnel on a machine with no public address.
Keeping data elsewhere
Section titled "Keeping data elsewhere"By default every file is on the one volume.
Two parts can move out, and Fluxer's backups then leave them out.
- The database can go to your own PostgreSQL 14 or later, such as a CloudNativePG cluster, with
FLUXER_POSTGRES_URL. Back it up with your database's own tools. - Uploads can go to an S3-compatible store with the file storage settings. Back them up with your store's versioning or replication.
The search index, message queue, certificates, passwords and keys always stay on Fluxer's volume and in Fluxer's backups.
Availability
Section titled "Availability"An instance is one process tree in one container, pod or service, and it can't run as two copies. Fluxer locks its data folder so that a second copy can't start on it, and the gateway keeps live connections in memory. The Helm chart runs one replica and has no PodDisruptionBudget, because one on a single pod would only block node drains.
- An upgrade takes Fluxer offline while it backs up the database, stops and starts the new release, usually for a few minutes. The apps reconnect by themselves.
- A restart or node drain takes Fluxer offline while it stops, for up to 130 seconds, and then it starts again on the same or another node.
- After a lost disk, or a lost zonal volume on Kubernetes, Fluxer stays down until you restore a backup onto a new volume.
You lose at most what was posted since the last backup, or since the last VolumeSnapshot on Kubernetes. There is no point-in-time recovery for the bundled database.
With your own PostgreSQL that has replicas and point-in-time recovery, such as a CloudNativePG cluster, the database gets those, while the search index, certificates and keys stay on Fluxer's volume and come from Fluxer's backups.
Connections Fluxer makes
Section titled "Connections Fluxer makes"These are the outgoing connections in the current release. Inside the instance, the parts connect to each other only on 127.0.0.1.
On by default
Section titled "On by default"- The edge connects to Let's Encrypt (
acme-v02.api.letsencrypt.org) on TCP 443 in bundled mode to get and renew the certificate. Proxy and tunnel mode don't. - The voice server connects to
stun.l.google.comandstun1.l.google.comon UDP 19302 while voice is on, to find the machine's public address. To use your own STUN server, pointFLUXER_LIVEKIT_STUN_PRIMARYandFLUXER_LIVEKIT_STUN_SECONDARYat it. - Link previews and the media proxy connect to the pages and media people link to, on TCP 80 and 443. List hosts to skip in
FLUXER_API_UNFURL_IGNORED_HOSTS. Every part looks up host addresses through the machine's DNS resolver on port 53.
Only when you set them up
Section titled "Only when you set them up"These use TCP 443 unless it says otherwise.
fluxerdasksfluxer.devfor/releases.jsononce a day to see whether a newer release is out, but only when you turn the check on withFLUXER_UPDATE_CHECK=true. The request has nothing about your instance.- The push service connects to the push relay,
push.fluxer.com, after an admin accepts its notice in the setup wizard or the admin panel. - The push service connects to
fcm.googleapis.com,oauth2.googleapis.comand Apple's APNs hosts if you setFLUXER_PUSH_FCM_ENABLEDorFLUXER_PUSH_APNS_ENABLEDwith your own app credentials. - The API, worker and Rust services connect to your own PostgreSQL, usually on TCP port 5432, when you set
FLUXER_POSTGRES_URL. - The API and worker connect to your SMTP server for email, usually on TCP port 587.
- The API connects to your OpenID Connect provider when you set up single sign-on.
- With uploads in S3, the API, worker and media proxy connect to that store.
- The GIF service connects to Klipy's API for GIF search when you set a Klipy API key.
- Link previews connect to the YouTube Data API (
www.googleapis.com) when you set a YouTube API key for YouTube links. - When you turn on
FLUXER_, the API connects toBREACHED_ PASSWORD_ CHECK_ ENABLED api.pwnedpasswords.comto refuse passwords from known breaches. - The worker connects to URLhaus, PhishTank and MalwareBazaar to check posted links and uploads against block lists when you turn on
FLUXER_BLOCKLIST_FEEDS_ENABLED.
Getting Fluxer is a separate step from running it.
Docker pulls the image from ghcr.io, the systemd and rexctl installs download from github.com and fluxer.dev, and Helm pulls the chart from ghcr.io.
The push relay
Section titled "The push relay"The official Fluxer apps for iOS and Android get notifications through Apple and Google, and only we can send to them there. When an admin accepts the push relay notice, which says what the relay keeps and where it runs, your instance sends each notification for those apps to the push relay at push.fluxer.com, which passes it to Apple or Google. Leave the relay off and the official mobile apps get no notifications from your instance, while browsers and the desktop app still get notifications from it.
Each device with the app makes its own key pair and keeps the private key. Your instance encrypts each notification to that key with standard Web Push encryption and pads it to a fixed size before it sends it to the relay. Only your instance and the device the notification is for can read what it says. Fluxer, Apple and Google pass it on without being able to read it, because none of them has the private key that the device holds.
All three can still see that a notification was sent, when it was sent and the device it's for. The relay also sees your instance's network address, its VAPID key and contact email, and whether the notification is a message, a call or a cleared notification. Apple and Google see the app, the priority and the expiry time, but not which instance sent it. If the iOS app can't decrypt a notification in time, it shows "New message" instead.
Behind a proxy or on a locked-down network
Section titled "Behind a proxy or on a locked-down network"Set HTTP_PROXY, HTTPS_PROXY and NO_PROXY as settings. Fluxer adds localhost and 127.0.0.1 to NO_PROXY by itself. Link previews, the media proxy, the push service, the GIF service and the edge use the proxy. The API and worker, the gateway and the voice server don't, and neither does STUN, which is UDP.
The edge gets its certificate through HTTPS_PROXY, but Let's Encrypt still has to connect to the machine on ports 80 and 443 from the internet to check your domain.
If those ports can't be opened to the internet, use proxy or tunnel mode.
Where everything has to go through a proxy, set FLUXER_LIVEKIT_NODE_IP and point both STUN settings at a STUN server on your network, and allow the API and worker to connect directly to your SMTP server, SSO provider and S3 store, and to api.pwnedpasswords.com, URLhaus, PhishTank and MalwareBazaar when you turn those checks on. With no internet access at all, Fluxer runs, but link previews, images from other sites, GIF search and notifications to the official mobile apps don't work.
When your network inspects TLS or your SSO provider or mail server uses a certificate from your own authority, give Fluxer that CA certificate. The API and worker load it from FLUXER_NODE_EXTRA_CA_CERTS, and the other parts from SSL_CERT_FILE.
Both take a path inside the container, and the file has the usual public authorities and yours, as the system bundle /etc/ does.
docker run ... -v /etc/ssl/certs/ca-certificates.crt:/etc/fluxer/ca.pem:ro \ -e FLUXER_NODE_EXTRA_CA_CERTS=/etc/fluxer/ca.pem -e SSL_CERT_FILE=/etc/fluxer/ca.pem ...Mount the host's bundle after you add your authority to it, or a file of your own.
Add your authority to the system bundle with update-ca-certificates, then restart Fluxer. Fluxer uses that bundle by default.
extraVolumes: - name: ca configMap: name: corporate-caextraVolumeMounts: - name: ca mountPath: /etc/fluxer/ca readOnly: trueextraEnv: - name: FLUXER_NODE_EXTRA_CA_CERTS value: /etc/fluxer/ca/ca.pem - name: SSL_CERT_FILE value: /etc/fluxer/ca/ca.pem Health checks
Section titled "Health checks"fluxerd healthpasses when every part is ready, and the image's own health check and the chart's readiness probe use it.fluxerd health --livepasses whenfluxerdresponds, ready or not, and the chart's startup and liveness probes use it.GET /_healthover HTTP returnsOKfrom Fluxer's edge in every mode once it is up.
Point an uptime monitor at /_health from outside the machine.