Skip to content
STAGE33R

Guides · Hardening · 5 steps · reviewed

CloudPanel: how to restrict port 8443 to your own IP address (UFW)

CloudPanel serves its admin interface on port 8443. Open to everyone, it is a login page exposed to the whole internet. Limiting it to your own address removes that risk in a minute.

  1. Find your public address

    From the computer you use to administer the server.

    curl -s https://ifconfig.me
  2. Add the allow rule first

    Add the specific rule before removing the open one, so you cannot lose access.

    sudo ufw allow from YOUR_IP to any port 8443 proto tcp
  3. Remove the rule that opens it to everyone

    List the numbered rules and delete the broad one for 8443.

    sudo ufw status numbered
    sudo ufw delete NUMBER
  4. Test

    Your address works, another does not. Try from a phone on mobile data.

    sudo ufw status verbose | grep 8443
  5. Plan for an address that changes

    Home connections change. Either keep a fixed address (a VPN or a small jump server) or, when you are locked out, use the provider's web console to add the new address.

Common mistakes

  • Deleting the rule for 8443 before adding the specific one.
  • Forgetting that the rule applies to IPv6 as well: check both lists.
  • Restricting SSH and 8443 to an address that changes and having no console access.

How to undo it

sudo ufw allow 8443/tcp reopens it to everyone. The provider console is your recovery path if both rules were removed.

Sources

Commands are for Debian and Ubuntu unless noted. Test on a copy first and keep a backup: you are responsible for changes on your own systems.