Using Netbird's Reverse Proxy to proxy towards Stalwart on same server

Describe the problem

I recently set up a Stalwart E-Mail server on my Netcup VPS. This required me to open several ports for e-mail, such as port 25, and ports 80 and 443 for HTTPs.

I also wanted to use the same VPS for Netbird. Today, I installed Netbird with option 0 for the built-in Traefik reverse proxy. Shortly before I set Netbird up, I changed Stalwart’s HTTPS port from 443 to 4443 so Netbird can occupy 443. I thought I could use Netbird’s reverse proxy to easily link my mail domain to my Stalwart instance. I think TLS forwarding will do the trick so Stalwart can generate certificates on its own. Unfortunately, though, I only saw options to choose peers and networks as targets, not localhost or local docker networks. I spent several hours trying to figure out how to achieve my goal, without success.

Are you using NetBird Cloud?

No. This server is self-hosted.

NetBird version:

Management: v0.76.3

Dashboard: v2.90.9

Is any other VPN software installed?

No

Additional context

This is my docker compose file for Stalwart:

services:
stalwart:
image: stalwartlabs/stalwart:v0.16
container_name: stalwart
restart: unless-stopped
ports:
- “25:25”
- “465:465”
- “587:587”
- “993:993”
- “4190:4190”
- “4443:443”
- “8080:8080”
volumes:
- stalwart-etc:/etc/stalwart
- stalwart-data:/var/lib/stalwart

volumes:
stalwart-etc:
stalwart-data:

Have you tried these troubleshooting steps?

  • Reviewed client troubleshooting (if applicable) (This is not a client)
  • Checked for newer NetBird versions
  • Searched for similar issues on GitHub (including closed ones)
  • Restarted the NetBird client (This is not a client)
  • Disabled other VPN software (There is no other VPN software)
  • Checked firewall settings (This is not my problem)

Did you ever get this to work? I was thinking about installing the NetBird client on the same host as the netbird-server…