>For one thing, they often make it against the ToS to host 'a server' (generally).
Beyond this, it can also be impossible due to lack of a static IP or control over the router (5G internet service with CGNAT). A VPS with WireGuard and remote port forwarding allows access for things like SSH.
Many DNS providers allow you to curl a particular URL to set the IP address for your domain. Set your server to curl it periodically, and it solves the lack of a static IP.