Can't connect to Bitmagnet web UI

Since I can’t get Flaresolverr or Byparr to work, I’m trying to install Bitmagnet, since I’m given to understand it can connect to Sonarr and make it work for protected indexers.

Has anyone gotten this to work? I keep getting a bunch of errors in the Bitmagnet log about it having trouble connecting to the Postgres container. It’s just this giant block over and over:

2025-07-17 00:27:47.264598+00:00e[33mWARNe[0m	tmdb/requester_lazy.go:40	you are using the default TMDB api key; TMDB requests will be limited to 1 per second; to remove this warning please configure a personal TMDB api key
2025-07-17 00:27:48.266250+00:00e[33mWARNe[0m	postgres/postgres.go:92	failed to ping database, retrying...	{"error": "failed to connect to `user=postgres database=bitmagnet`:\n\t127.0.0.1:5432 (localhost): dial error: dial tcp 127.0.0.1:5432: connect: connection refused\n\t[::1]:5432 (localhost): dial error: dial tcp [::1]:5432: connect: connection refused\n\t127.0.0.1:5432 (localhost): dial error: dial tcp 127.0.0.1:5432: connect: connection refused\n\t[::1]:5432 (localhost): dial error: dial tcp [::1]:5432: connect: connection refused"}
//above log repeats 9 more times with new timestamps
2025-07-17 00:27:57.292100+00:00e[31mERRORe[0m	worker/worker.go:196	error starting worker	{"key": "http_server", "error": "timed out waiting for ping: failed to connect to `user=postgres database=bitmagnet`:\n\t127.0.0.1:5432 (localhost): dial error: dial tcp 127.0.0.1:5432: connect: connection refused\n\t[::1]:5432 (localhost): dial error: dial tcp [::1]:5432: connect: connection refused\n\t127.0.0.1:5432 (localhost): dial error: dial tcp 127.0.0.1:5432: connect: connection refused\n\t[::1]:5432 (localhost): dial error: dial tcp [::1]:5432: connect: connection refused"}
2025-07-17 00:27:57.292309+00:00github.com/bitmagnet-io/bitmagnet/internal/boilerplate/worker.(*registry).Start
2025-07-17 00:27:57.292350+00:00/src/internal/boilerplate/worker/worker.go:196
2025-07-17 00:27:57.292379+00:00github.com/bitmagnet-io/bitmagnet/internal/boilerplate/app/cmd/worker.New.func1
2025-07-17 00:27:57.292435+00:00/src/internal/boilerplate/app/cmd/worker/command.go:42
2025-07-17 00:27:57.292464+00:00github.com/urfave/cli/v2.(*Command).Run
2025-07-17 00:27:57.292488+00:00/go/pkg/mod/github.com/urfave/cli/v2@v2.27.5/command.go:276
2025-07-17 00:27:57.292510+00:00github.com/urfave/cli/v2.(*Command).Run
2025-07-17 00:27:57.292562+00:00/go/pkg/mod/github.com/urfave/cli/v2@v2.27.5/command.go:269
2025-07-17 00:27:57.292587+00:00github.com/urfave/cli/v2.(*Command).Run
2025-07-17 00:27:57.292610+00:00/go/pkg/mod/github.com/urfave/cli/v2@v2.27.5/command.go:269
2025-07-17 00:27:57.292632+00:00github.com/urfave/cli/v2.(*App).RunContext
2025-07-17 00:27:57.292672+00:00/go/pkg/mod/github.com/urfave/cli/v2@v2.27.5/app.go:333
2025-07-17 00:27:57.292696+00:00github.com/bitmagnet-io/bitmagnet/internal/boilerplate/cli.New.func4.1
2025-07-17 00:27:57.292718+00:00/src/internal/boilerplate/cli/cli.go:58
2025-07-17 00:27:57.294381+00:00panic: timed out waiting for ping: failed to connect to `user=postgres database=bitmagnet`:
2025-07-17 00:27:57.294579+00:00127.0.0.1:5432 (localhost): dial error: dial tcp 127.0.0.1:5432: connect: connection refused
2025-07-17 00:27:57.294609+00:00[::1]:5432 (localhost): dial error: dial tcp [::1]:5432: connect: connection refused
2025-07-17 00:27:57.294632+00:00127.0.0.1:5432 (localhost): dial error: dial tcp 127.0.0.1:5432: connect: connection refused
2025-07-17 00:27:57.294670+00:00[::1]:5432 (localhost): dial error: dial tcp [::1]:5432: connect: connection refused
2025-07-17 00:27:57.294690+00:002025-07-17T00:27:57.294690180Z
2025-07-17 00:27:57.294709+00:00goroutine 50 [running]:
2025-07-17 00:27:57.294728+00:00github.com/bitmagnet-io/bitmagnet/internal/boilerplate/cli.New.func4.1()
2025-07-17 00:27:57.294760+00:00/src/internal/boilerplate/cli/cli.go:59 +0xde
2025-07-17 00:27:57.294778+00:00created by github.com/bitmagnet-io/bitmagnet/internal/boilerplate/cli.New.func4 in goroutine 49
2025-07-17 00:27:57.294800+00:00/src/internal/boilerplate/cli/cli.go:52 +0xc5

Here’s my docker compose file. Sorry this is turning into a wall of text, haha.

networks:
  bitmagnet:
    driver: bridge
    ipam:
      config:
        - gateway: 192.168.56.1
          subnet: 192.168.56.0/24
      driver: default
services:
  bitmagnet:
    command:
      - worker
      - run
      - '--all'
    container_name: bitmagnet
    depends_on:
      gluetun:
        condition: service_healthy
      postgres:
        condition: service_healthy
    environment:
      - PUID=568
      - GUID=568
    image: ghcr.io/bitmagnet-io/bitmagnet:latest
    network_mode: service:gluetun
    restart: unless-stopped
    volumes:
      - /mnt/Main/configs/custom/bitmagnet/appdata:/root/.config/bitmagnet
  gluetun:
    cap_add:
      - NET_ADMIN
    container_name: bitmagnet-gluetun
    devices:
      - /dev/net/tun:/dev/net/tun
    environment:
      [redacted]
    extra_hosts:
      - postgres:192.168.56.11
    image: qmcgaw/gluetun:latest
    networks:
      bitmagnet:
        ipv4_address: 192.168.56.10
    ports:
      - '3333:3333'
      - 3334:3334/tcp
      - 3334:3334/udp
    restart: always
  postgres:
    container_name: bitmagnet-postgres
    environment:
      - POSTGRES_PASSWORD=postgres
      - POSTGRES_DB=bitmagnet
      - PGUSER=postgres
      - PUID=568
      - GUID=568
    healthcheck:
      interval: 10s
      start_period: 20s
      test:
        - CMD-SHELL
        - pg_isready
    image: postgres:16-alpine
    networks:
      bitmagnet:
        ipv4_address: 192.168.56.11
    ports:
      - '5432:5432'
    restart: unless-stopped
    shm_size: 1g
    volumes:
      - /mnt/Main/configs/custom/bitmagnet/pgdata:/var/lib/postgresql/data

The IP addresses were changed from 192.168.55.x to 192.168.56.x to avoid conflicting with my qBittorrent’s Gluetun container. Here’s the version on GitHub, for reference.

I looked around a little bit more and found that I should try pinging the postgres service from the bitmagnet shell, and this is what I got:

/ # curl postgres:5432
curl: (52) Empty reply from server

Whenever I tried running that command, the postgres log would add this entry:

2025-07-17 22:09:53.679430+00:002025-07-17 22:09:53.679 UTC [1101] LOG: invalid length of startup packet

Asked around on Discord and the answer is that you need to have these environment variables for the Bitmagnet service.

  - POSTGRES_HOST=postgres
  - POSTGRES_PASSWORD=postgres

Not sure why these aren’t part of the stock compose file, but whatever.