this post was submitted on 15 Nov 2025
224 points (98.3% liked)

Selfhosted

53129 readers
703 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
 

Hi! I wanted to share a project I've been working on that lets you set up a huge variety of applications really quickly and painlessly. For example, instead of setting up and configuring a large docker compose for a complicated application like Immich, this playbook lets you simply write:

immich_enabled: true

And it will orchestrate all the containers, networks, directories, etc for you with reasonable defaults. All of which can be overwritten, for example to enable extra features like hardware acceleration:

immich_hardware_acceleration: "-cuda"

Or to automatically get a letsencrypt cert and expose the application on a subdomain to the outside world:

immich_available_externally: true

Included in the playbook is a ton of complicated applications, like Paperless, Meelo, TTRSS, Dawarich, as well as common self-hosted apps like Jellyfin, Home Assistant, Syncthing, Navidrome, Grafana, and a whole lot more (totaling 116 right now!).

It also comes with scripts and tests to help add your own applications (ansible roles) and ensure they work properly

I've been using this project myself for awhile, including to assist with moving from one homelab computer to another (point the playbook to the new address, run it to install everything, and restore a backup from the previous computer for data), and I hope it can help someone else build up their homelab without sinking too much time into setting things up

Here's the repository: https://github.com/Dylancyclone/ansible-homelab-orchestration

And the documentation (that I'm really proud of :D): https://dylancyclone.github.io/ansible-homelab-orchestration/

top 15 comments
sorted by: hot top controversial new old
[–] avidamoeba@lemmy.ca 4 points 6 days ago* (last edited 6 days ago)

As someone who's done cloud infrastructure professionally, this is the right way to make a project for setting up self-hosted applications. Not writing a bunch of bash scripts and putting them behind some web UI. We have well established infrastructure/config-as-code systems that are the gold standard which runs most clouds out there. Ansible is one of them. That's the right tool for this job and a ton of professionals understand it and therefore can easily contribute improvements for the ones who don't to use. I'm unfortunatrly invested in SaltStack but I wouldn't feel worried to deploy a (well reviewed) project built on Ansible. Then slap a web UI on it if you like but that should be another project that hooks uses this one.

[–] irmadlad@lemmy.world 13 points 1 week ago (2 children)

I need to learn Ansible. Seems like an easy way to orchestrate server 'stuff'

[–] Dylancyclone@programming.dev 12 points 1 week ago

This project was basically how I learned Ansible haha. It is incredibly powerful and this really only scratches the surface

[–] mhzawadi@lemmy.horwood.cloud 3 points 1 week ago

For large server estates it makes things a breeze to manage, that and semaphore.

[–] picnicolas@slrpnk.net 8 points 1 week ago (1 children)

I used a similar project called Ansible NAS a while back and it’s been working beautifully. I had a problem and had to reinstall the OS on my NAS at some point and this made it a breeze. That project requires Ubuntu and I prefer Debian so I may try this out next time.

[–] Dylancyclone@programming.dev 10 points 1 week ago (2 children)

This is definitely inspired by ansible-nas! I'd also used it for awhile, and made my own fork to add/fix things since the project has gone a little dormant. I started making so many changes though that I started fresh and it turned it into a whole project of it's own. You can see a list of differences here: https://dylancyclone.github.io/ansible-homelab-orchestration/guides/introduction/

Or copy-pasted:

  • Does not require root to run
  • Runs containers with minimum privileges (no root unless absolutely necessary)
  • Allow any application to have it's name, image name and version overridden (in case of version pinning or running forks)
  • Does not modify existing system settings/configuration
  • Separates DNS access from external access (for example, access portainer.example.com on local network without exposing it to the internet)
  • Notifies the user of breaking changes in an application's ansible role before updating them
  • Everything is optional, doesn't install anything except what's configured by the user
  • Cleans up networks and containers more gracefully after disabling applications, and ensure nothing is left dangling
  • Supports more OSs than just Ubuntu
  • Includes suite of tests to ensure clean code and functionality
    • All created containers and networks are removed when stopping applications
    • Ensures all applications have consistent variable names and settings
    • Ensures all applications properly implement DNS and external access settings
    • Ensures no port conflicts between applications
    • etc
[–] moonpiedumplings@programming.dev 1 points 5 days ago (1 children)

Does it require docker installed and being in the docker group, with the docker daemon running?

Just an FYI, having the ability to create containers and do other docker is equivalent to root: https://docs.docker.com/engine/security/#docker-daemon-attack-surface

It's not really accurate to say that your playbooks don't require root to run when they basically do.

[–] Dylancyclone@programming.dev 1 points 5 days ago

That is very true, I suppose a more accurate way to say it would be the playbook does not need to run as the root user, and can instead use the permissions of a regular user. This lets all the volume mounts be owned by your user, instead of root. I think it's still an important distinction to make though, since by not running the playbook as root, the playbook can't directly change any of your server's settings, and only has the access the user you're SSHing as has.

Yes, this playbook is intended to orchestrate an already set up environment. I know Ansible can easily install and set up docker (using something like the awesome https://github.com/geerlingguy/ansible-role-docker), but I decided against it (at least for now) for two main reasons: Firstly to avoid becoming the root user, and secondly to avoid the Ansible role installing a second version of Docker, causing things to break. I ran into that myself while testing this playbook, where I had set up a Ubuntu VM, told the installer to install Docker during setup not knowing it would install it through snap, then the Ansible playbook would install docker again through conventional means causing a lot of strange problems. So instead I opted to let the user install docker however they'd like and not have any gotchas like "Remember to add --skip-tags="docker" if you installed Docker during OS installation on Ubuntu" or uninstalling their version of docker for them

[–] picnicolas@slrpnk.net 6 points 1 week ago

Awesome improvements! Really nice work. I’ll definitely be switching at some point when I have a reason to mess with it. Thanks for all the extra work you’ve done to improve the fork and gift the project to the commons.

[–] terranux@mastodon.ie 8 points 1 week ago

@Dylancyclone looks fantastic, great work!

[–] JadedBlueEyes@programming.dev 7 points 1 week ago
[–] AgaveInMyAss@lemmy.world 4 points 1 week ago (2 children)

This is probably my lack of Ansible experience here but how are multiple servers setup? Can I specify a different server per application?

[–] exu@feditown.com 9 points 1 week ago

You can use host_vars to set different variables per host. You'd still run the same playbook against both hosts, but each has different services activated.

  1. Make the folder host_vars in the repo root
  2. Make subfolders for every host with their hostname
  3. Enable services you want by writing the variables into a yaml file for your host (any file name as long as it ends with .yml
  4. Write an Ansible inventory for your hosts
  5. Run the playbook with your inventory

Slightly fancier would be using group_vars instead, you can add a host to multiple groups. Then deploying the same services on a new hosts would simply be adding it to the group

[–] mumblerfish@lemmy.world 7 points 1 week ago

TL;DR: yes

Just from a quick view of the repo, the simplest way to do it would be to look at the playbook.yml and copy all roles you want for a host into a new playbook, say myhost.yaml. Copy not only the roles but all the other keywords as well. Then you go to the inventory and add your hosts where you to execute the playbook against. Then you change the hosts key value in the playbook you made from all to the hosts you added to the inventory.

That is, add your hosts to the inventory, create playbooks for for them and run. That is the easiest. Read up on how to do groups and organizing your inventory to improve it from there.

[–] thelocalhostinger@lemmy.world 3 points 1 week ago

Great job, thanks for sharing.