Перейти к содержимому

Docker

On Docker or Podman, Squad runs as one container, started from a small compose file or one docker run line, and loads its settings from an env file.

rexctl is optional. The compose.yaml and fluxer.env that each release publishes are a supported way to run Squad without it, and this page needs only Docker. An instance on the older layout with one container per service gets here once with rexctl migrate --to compose, or with rexctl detach after a move to one container. Moving from the older install has the steps.

To keep every setting in compose.yaml, turn off parts you don’t use, run your own PostgreSQL next to Squad or restart one part at a time, see Compose without rexctl.

You need a 64-bit Linux machine with 2 CPU cores, 2 GB of memory at least, 4 GB for a busy instance, and Docker 24 or later with Compose. People open Squad at a domain that points at the machine, or at its IP address. Installing takes about 5 minutes.

Для Squad скачайте исходники и конфигурацию сборки. Команда получения готового пакета для этой платформы отсутствует.

Set FLUXER_DOMAIN in fluxer.env, then run docker compose up -d and docker compose exec fluxer fluxerd setup-token. On a machine with IPv6, leave out the AAAA record for now, or put a reverse proxy in front.

  • One container from the image squad-local:build. Docker calls it after the folder, such as fluxer-fluxer-1 in a folder called fluxer, and docker compose commands in that folder find it as fluxer.
  • One Docker volume called fluxer-data, which has the database, uploads, search index, certificates, passwords and keys.
  • Ports 80 and 443 on TCP, 443 on UDP, 7881 on TCP and 7882 on UDP, published on every one of the machine’s addresses.
  • Two files in a folder you choose, compose.yaml and fluxer.env, both yours to edit. compose.yaml runs the release it came with and sets FLUXER_INSTALL_METHOD to compose, so the admin panel shows the compose upgrade command.

Squad runs as user ID 65532 inside the container.

Check the requirements.

You need Docker Engine 24 or later and the Compose plugin. If the machine doesn’t have them yet, install them, and on a VPS open the ports in your provider’s firewall. Squad needs ports 80 and 443 open from the internet to get its certificate. If another web server already uses ports 80 and 443, put Squad behind it as you go.

To use the machine’s IP address in place of a domain, skip the DNS steps and set FLUXER_DOMAIN in step 2 to the address, such as 203.0.113.10. Without a domain of your own, a free name such as 203-0-113-10.sslip.io works like a domain and keeps passkeys working. A public address gets a Let’s Encrypt certificate. On a private address, browsers show a certificate warning until each device trusts Squad’s own authority. Passkeys don’t work on an IP address, whatever certificate it has. For an IPv6 address, also turn on IPv6 on the Docker network first.

With a domain, point it at the machine before the first start. At your DNS provider, add an A record for the name you want, such as chat, with the machine’s public IPv4 address.

Then check that it resolves.

Окно терминала
dig +short chat.example.com

The answer is the machine’s address. If it isn’t, wait a few minutes. Leave out the AAAA record unless a reverse proxy or Docker’s IPv6 network keeps IPv6 visitors’ addresses.

  1. Make a folder for Squad and download the two files from the latest release.

    Для Squad скачайте исходники и конфигурацию сборки. Команда получения готового пакета для этой платформы отсутствует.

    ls in that folder now lists compose.yaml and fluxer.env.

  2. Open fluxer.env in an editor and set FLUXER_DOMAIN to your domain, such as chat.example.com, without https://.

    fluxer.env
    FLUXER_DOMAIN=chat.example.com

    Write values without quotes. A password with a $ in it goes in a file. Squad refuses to start with the example domain chat.example.com.

  3. Start Squad.

    Окно терминала
    docker compose up -d

    The first start takes a minute or two while Squad creates its database, passwords and keys. docker compose ps should then show healthy in its status column. The certificate can take another minute or two.

  4. Print the setup token.

    Окно терминала
    docker compose exec fluxer fluxerd setup-token

    Open https://chat.example.com with your domain. The setup wizard opens and asks for the token. Paste it and create the first admin account. With a domain, a certificate warning means Squad hasn’t got its certificate yet, so wait a minute and reload. On a private IP address the warning stays until the device trusts Squad’s own authority. docker compose logs fluxer | grep -iE 'acme|certificate' shows what Let’s Encrypt reported. Let’s Encrypt gives out at most 5 certificates a week for the same domain, and every reinstall with a new volume uses one of them.

    The wizard asks whether people sign in with a username or an email address, and this can’t change later. Without an email account set up, pick usernames. People then keep a recovery kit in place of password reset emails. Under “Who can create an account?” the wizard starts on “Only people you invite”.

  5. Invite people with an invite link.

The same container runs from one docker run line, with only fluxer.env in the folder.

Для Squad скачайте исходники и конфигурацию сборки. Команда получения готового пакета для этой платформы отсутствует.

The first start takes a minute or two.

Once docker ps shows healthy in the status of fluxer, print the setup token.

Окно терминала
docker exec fluxer fluxerd setup-token

The container is called fluxer, and docker logs fluxer shows its log.

Keep --stop-timeout 130, because Docker’s default of 10 seconds stops PostgreSQL before it has shut down. The compose file and this line use the same volume, and you can switch between them without losing data.

A folder that rexctl migrate --to compose or rexctl detach wrote works the same as the one above, with a few differences.

  • compose.yaml starts with a name: line, which keeps the compose project and the volume the same when you rename the folder. It can also have other ports, extra hosts or Podman lines than the release file.
  • To upgrade, keep this file and change only its image: line. Don’t download the release’s compose.yaml over it.
  • custom.compose.yml from the older layout no longer applies. Make network changes, such as other ports, in compose.yaml.
  • rexctl’s backups from before the move stay in the backups folder. Squad keeps newer ones in its volume, under /var/lib/fluxer/backups, and those go when the volume goes. Copy them out first.
Окно терминала
docker compose cp fluxer:/var/lib/fluxer/backups ./fluxer-backups

A custom certificate, CA or GeoIP database that rexctl copied into the volume stays there, under /var/lib/fluxer/host. rexctl no longer copies it from the instance folder. To replace one, copy the new file over it, give it to the user Squad runs as and restart Squad.

Окно терминала
docker compose cp fullchain.pem fluxer:/var/lib/fluxer/host/certs/fullchain.pem
docker compose exec -u 0 fluxer chown 65532:65532 /var/lib/fluxer/host/certs/fullchain.pem
docker compose restart

The CA files go in /var/lib/fluxer/host/ca and the GeoIP database in /var/lib/fluxer/host/geoip, with the same file name as before.

To have rexctl run Squad again, run rexctl adopt in the folder. It works with the release files too.

Окно терминала
rexctl adopt --dry-run
rexctl adopt

rexctl backs Squad up, stops it, starts the same release in its own container on the same volume and checks it. If that doesn’t work, it starts Squad again with docker compose. compose.yaml and fluxer.env move to .rexctl/adopted, and rexctl detach hands Squad back. rexctl refuses lines in compose.yaml that no rexctl setting gives, such as data in a folder, and lists each one.

When something else handles HTTPS, such as nginx, Caddy, Traefik or Cloudflare Tunnel, Squad serves plain HTTP on port 8080.

Set this in fluxer.env, or FLUXER_EDGE_MODE=tunnel behind a tunnel.

fluxer.env
FLUXER_EDGE_MODE=proxy

Publish port 8080 on 127.0.0.1 in place of ports 80 and 443. The ports list becomes this.

compose.yaml
services:
fluxer:
ports:
- "127.0.0.1:8080:8080"
- "7881:7881"
- "7882:7882/udp"

With docker run, the port flags become these.

Окно терминала
-p 127.0.0.1:8080:8080 -p 7881:7881 -p 7882:7882/udp

Keep the port on 127.0.0.1 unless your proxy runs on another machine. Squad trusts the visitor address that anything on a private network sends it, so anything that can connect to port 8080 could pretend to be any visitor.

Set up your proxy with one of the proxy configs.

Calls use TCP port 7881 and UDP port 7882 on the machine, also behind a proxy or tunnel. Open both in any firewall in front of the machine.

When FLUXER_DOMAIN is an IP address, calls use that address. With a domain, Squad finds its public address over STUN. On a home network, or when STUN finds the wrong address, set it yourself. Use your public IPv4 address, the one a site such as ifconfig.me shows, not the 192.168 address of the machine on your own network.

fluxer.env
FLUXER_LIVEKIT_NODE_IP=203.0.113.10

To run without voice, set FLUXER_LIVEKIT_ENABLED=false and leave out the two voice ports. To run calls on other machines instead, add voice servers.

On Docker’s default network, a visitor who connects over IPv6 shows up inside the container with the network’s own address. Rate limits and bans then treat every IPv6 visitor as one person. IPv4 visitors keep their own address.

The simplest choice is to leave out the AAAA record, so everyone connects over IPv4. To serve IPv6 visitors as well, put a reverse proxy on the machine in front of Squad in proxy mode, as above. The proxy sees the real address and passes it on.

IPv6 on the Docker network also keeps addresses.

Podman runs the same image with the same files. In podman run, --sysctl net.ipv4.ip_unprivileged_port_start=0 allows Squad to listen on ports 80 and 443.

--network pasta keeps each visitor’s address for rate limits and bans, which Podman 5 also does by default without the flag. When you run Podman as root, leave this flag out, because pasta runs only in rootless mode.

Для Squad скачайте исходники и конфигурацию сборки. Команда получения готового пакета для этой платформы отсутствует.

Rootless Podman can publish ports 80 and 443 only when the machine’s own net.ipv4.ip_unprivileged_port_start is 80 or lower. Set it with sudo sysctl -w net.ipv4.ip_unprivileged_port_start=80. To keep it after a reboot, put the same line in a new file in /etc/sysctl.d/ as well.

In proxy mode, Squad uses no port below 1024 and needs neither sysctl setting.

With podman compose and the release files, put the sysctl line in a compose.override.yaml next to compose.yaml. Compose reads it with compose.yaml, and upgrades still change only the image line of compose.yaml.

compose.override.yaml
services:
fluxer:
sysctls:
net.ipv4.ip_unprivileged_port_start: 0

Upgrade with podman compose pull && podman compose up -d. The Updates page in the admin panel shows the same command.

Podman has no daemon, so after a reboot podman-restart.service starts the containers that run with --restart always. As root, turn it on for the whole machine.

Окно терминала
sudo systemctl enable podman-restart

With rootless Podman, turn it on for your account, with lingering for boot.

Окно терминала
systemctl --user enable podman-restart
sudo loginctl enable-linger $USER

The Podman guide runs Squad from a Quadlet file as a systemd service instead.

These show the status, the logs, one part’s logs, a backup and how to stop Squad.

Окно терминала
docker compose exec fluxer fluxerd ps
docker compose logs fluxer
docker compose exec fluxer fluxerd logs api
docker compose exec -T fluxer fluxerd backup --out - > fluxer-backup.tar.zst
docker compose stop

Upgrade with one command that changes only the image line of the compose file. You can also restore a backup, restart one part, invite people or move to a new machine.

When nobody can sign in as an admin, make a reset link for an account or create a new admin. Each command prints a link that sets a password, and the link works once for an hour. On an email instance that sends email, users reset-link refuses, and the admin resets their password by email from the sign-in page.

Окно терминала
docker compose exec fluxer fluxerd users reset-link alex
docker compose exec fluxer fluxerd users create alex --admin

On an instance with email sign-in, add --email alex@example.com to users create.

To keep the instance for later, take a backup first with the fluxerd backup line under Day to day, and copy fluxer-backup.tar.zst out of the Squad folder. Keep it somewhere safe, because it has every password and key.

Для Squad скачайте исходники и конфигурацию сборки. Команда получения готового пакета для этой платформы отсутствует.

The last line removes every Squad image on the machine, older releases included.

Then delete the folder with fluxer.env.