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.
Find your public address
From the computer you use to administer the server.
curl -s https://ifconfig.meAdd 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 tcpRemove 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 NUMBERTest
Your address works, another does not. Try from a phone on mobile data.
sudo ufw status verbose | grep 8443Plan 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.