this post was submitted on 02 Aug 2025
101 points (99.0% liked)

Selfhosted

50029 readers
510 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

I don't usually post, but thought I'd share.

I rebuilt my homelab with OpenTofu. Now my entire setup, from containers to networking, lives in a Git repo.

The best part is that new services get published automatically. I just set a flag in the code, and it builds the Caddy proxy or Cloudflare tunnel for me. No more manual config editing.

Here's my quick write-up on it: https://yuris.dev/blog/homelab-opentofu

And the code is all public if you want to see how it works: https://github.com/yurisasc/homelab

Hope this is interesting to someone. Happy to answer any questions if you have them. Curious to hear if anyone else has gone down this particular rabbit hole with IaC for their Docker stack.

top 4 comments
sorted by: hot top controversial new old
[–] Mondez@lemdro.id 12 points 9 hours ago

I personally manage my services using ansible, I only set up the actual infrastructure, the virtual machines that run the services, with terraform/opentofu. Docker is one of those in the middle tech between infrastructure and software distribution and it makes more sense to me to treat a service as a role in ansible do I can deploy it (docker, podman package install or whatever), sort it's networking and handle it's configuration all in one place. I'm not saying the way you do it is wrong, but this is just a step down the automation rabbit hole.

It doesn't appear your setup provisions the actual hosts for docker so I guess you are provisioning manually for that layer? That is another area you might want to leverage opentofu for?

Also congrats on actually documenting it in a consumable way for others to learn from.

[–] truxnell@quokk.au 4 points 7 hours ago

I've been doing IaC for years on my homelab. Once I outgrew rockets impose and a single NUC, I ended up going full regard on kubernetes forna few years, before getting sick of the complexity and upkeep and moving to a nix stack for my NAS and nuc

Tip;: if you haven't already look at using renovate bit to run on your repo and update your container tags, it's great to manage updating your containers in a controller fashion

Current nix
https://github.com/truxnell/nix-config

Deprecated k8s
https://github.com/truxnell/home-cluster

[–] cappa@feddit.org 3 points 9 hours ago

nice inspiration. bookmarked

[–] LodeMike@lemmy.today 2 points 9 hours ago