

Back in 2016 or so you could get a RaspberryPi 3 for $35. Add a $5 power supply, $5 SD card and $10 case (or 3d print your own) and you’ve got a nice little piece of hardware for running a tiny project at home for ~$50. More than enough for hosting some simple web services, backup software or something like Home Assistant.
Plus it was popular (which makes it even more popular). It’s always been very easy to find guides written specifically for the hardware, despite it’s limitations.
I think the value proposition has been dropping steadily though. They cost more, are hard to find and there are now a lot more competing SBCs on the market. RaspberryPi still has name recognition though, for now.
Ansible vault. All my config files and scripts are deployed with Ansible. Usually they are pushing those into a file or environment variable but if you scope permissions narrowly and don’t run services/containers as root you should be somewhat safe. If someone has filesystem access you’re already in big trouble.
Instead I’d focus on keeping your attack surface as small as possible. Keep services behind a VPN or segment public facing services to a separate VLAN or docker network.