6

Hi there, I want to check out Habitat, I have a real need for it right now. But it appears to do two things I want to handle on my own - use Let's Encrypt for SSL certs and use Caddy.

On my VPS, I already have Caddy running and I want my instance to set up the SSL certs for the front-end. So, can I remove the Docker setup use of Caddy or just tell Habitat not to enable that part of its setup?

To be clear, I am thinking I could set up Habitat to run like this:

  • Front-end: https://mysubdomain.mydomain.com/
  • My existing Caddy sees the request come in that way, redirects to the internal docker-based service.
  • Habitat gets the request forwarded to it, on some other internal only port like 3000
  • Habitat returns the normal page for the route.

Does that seem do-able? Thanks!

top 4 comments
sorted by: hot top new old
[-] femtek@lemmy.blahaj.zone 2 points 1 week ago* (last edited 1 week ago)
[-] perishthethought@piefed.social 2 points 1 week ago

Sorry, I think I'm being dense but don't see how that helps me.

The suggestion was to change the SERVER_NAME to use http instead of https in the compose file, right? The project's readme now says, "This can be resolved by temporarily setting the SERVER_NAME variable to http://${DOMAIN}:80 in docker-compose.yml. Once a certificate has been attained, it should be fine to change the variable back to https://${DOMAIN} to secure your traffic" which I really don't understand. Does "temporarily" mean just run it once, then stop it and change the setting back to use https right away? Or a Day later?

Also, in the docker compose yaml, for the habitat-app container, it suggests to include these lines:

 ports:
      - 80:80
      - 443:443

I am not really clear on what I should put in there, to make my scenario work. And, I don't want the site to respond on http / port 80 long term, so can I just remove the 80:80 line entirely or is that not supported?

Thanks for any further help. Can't wait to get this running, try it out.

[-] carlnewton@feddit.uk 1 points 5 days ago

Hello, I'm sorry -- I missed this! I'm new to hosting a lemmy community -- and everything else that comes with maintaining an open source project that's in use to be honest!

From what you've described, it sounds like you can just remove the ports so long as your caddy container is in the same network as the habitat instance. As your caddy container is handling ssl, you could just pass traffic locally via http I think.

[-] femtek@lemmy.blahaj.zone 2 points 1 week ago* (last edited 1 week ago)

Their readme says temporary and they still bundle caddy in their main docker image, so unless they change it, you would keep it that way and then use your own proxy. Also change 80:80 to :80 since your proxy is probably already using that.

All of my apps run on http until the proxy manager takes over.

this post was submitted on 06 Mar 2026
6 points (100.0% liked)

Habitat

51 readers
1 users here now

Habitat is a free and open-source social platform for local communities.

Locals can create posts linked to a specific location on a map, making it easy for others to find and join the conversation about their local area.

founded 1 week ago
MODERATORS