sudo ss -tulnp # everything listening, with the owning process
sudo iptables -S INPUT # (or: sudo nft list ruleset / sudo ufw status verbose)
systemctl list-unit-files --state=enabled
From another machine: nmap -p- <your public IP> (your own server only) shows what the internet really sees. For every open port ask: do I need it, is it patched, does it need authentication, should it be limited to certain addresses or to a VPN? Disable what you do not use (sudo systemctl disable --now <service>; mask to prevent it from starting). Remember the provider's firewall as a separate layer, and that Docker publishes ports itself.