That's why you use a mini PC running on your home network and only access it via Tailscale / Headscale. There are still risks, but way way less than running services fully exposed to the Internet on a VPS somewhere.