Routing traffic using virtual machines

Hi,

I am new to traefik and I am hoping there will be no hate if I understand how it works completely wrong way. Basically I have homelab server with FreeBSD installed on Dell R430 machine. On this machine I use bhyve where I have created 4 virtual machines. I bought domain and configured it with cloudflare proxy. I have some services running across all virtual machines ie. TeamSpeak, some steam games dedicated servers etc. My idea was that I will install traefik on FreeBSD and use proxy/reverse proxy to access services from outside my local network.
for example:
Internet -> router with firewall ports exposed 443 + 80 <-> FreeBSD server with Traefik and tcp services <-> to access VM on local addresses
so when I access nextcloud.myprivatedomain.com it will access my VM 192.168.0.3:443 where I am hosting nextcloud on linux
when I access plex.myprivatedomain.com it will access my VM 192.168.0.4:443 where I am hosting on linux plex server
when I connect using teamspeak client ts3.myprivatedomain.com I will be able to access my teamspeak server on for example windows server VM.

All issues started where I tried to install traefik using pkg install traefik or making from ports on FreeBSD and unfortunatelly FreeBSD doesn't support docker so there is no possible for dashboard via website and I am not even sure if port install is working at all. Then I decided to install on Ubuntu VM where is my nextcloud and forward all ports to IP 192.168.0.3 and have my proxy and reverse proxy there. I managed to install using docker compose file. I can see dashboard obviously with some errors in config but that is not a big deal.
My question is - can I access my virtual machines using proxy and reverse proxy the way I have described above or traefik is only to be used with docker containers installed on the same machine?

Thanks in advance for your replies,
Seb

In general, if you don’t use Traefik automatic Configuration Discovery over "providers" like Docker, you can just setup a router (with "rule: Host()") and a service (with "loadbalancer.server.url") manually in a dynamic config file, which is loaded in static config with providers.file. (Doc)

Just make sure that Traefik can reach your target services inside the VMs via IP.

And it seems Traefik can be installed directly on FreeBSD, no container or VM needed (link).

Thank you for your reply. This is how I installed traefik but unfortunately it's not showing dashboard without docker container. I have process up and running on FreeBSD but I am not able to access to dashboard. I looked every possible tutorial and guide on google, youtube etc. If you know anybody who managed to get it to work please provide me a link to tutorial and I will follow it step by step. Next thing is my providers file is not being loaded. I declared in lantraefik.yml all machines and in dashboard there is nothing and links do not work.

The doc has a configuration example:

# Dynamic Configuration
http:
  routers:
    dashboard:
      rule: Host(`traefik.example.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))
      service: api@internal
      middlewares:
        - auth
  middlewares:
    auth:
      basicAuth:
        users:
          - "test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/"
          - "test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0"