How to expose each snap to its subdomain name on the same machine/os ?

My use case:

  • I have Ubuntu Core (on a intel NUC)
  • I have a running nextcloud snap exposed to cloud.mydomain.me (https)

I have moved home an many “things” are connected here, and I want to snap install home-assistant on it to manage them.

  • I now want to run expose home-assistant to home.mydomain.me (https)

Currently I just used my domain name registrar to redirect cloud.mydomain.me to my machine (using CNAME).

What’s next: I should redirect home.mydomain.me too to the same device.

I used to expose manually differents php websites on differents subdomains using apache configuration files for vhost but it was before I use containers or in this case, a confined system

With confined apps on snap, i have no idea where should i do this.
Is it something snapd allows to configure ?
Or somewhere else on Ubuntu Core ?
Do I need to install a snap that its job it to redirect this or that snap ?
Is lord systemd supposed to do that ? :smiley:

Thank in advance for your hints!


(I am not sure where to post it since it is probably part of the solution, so do not hesitate to move it to the best section)

Caddy can probably achieve what you’re looking for; I’m using it on my Ubuntu Core system to act as a reverse proxy to a variety of sites I host on the machine.

But currently, no this is not a functionality snapd directly exposes or makes available itself.

1 Like

Thank for the reply !

I thought caddy was not made for production, just for dev environment, or this status has changed ?

Do you mean caddy the software itself, or the snap?

Caddy itself seems quite production-ready, I would be surprised if the developers would say otherwise.

The snap is unofficial, but I have as a goal this year to make that not be the case; it certainly isn’t a finished project but it’s usable for many use-cases (at least mine, and I guess a thousand other people).

1 Like