Prerequisites
Before blocking an IP, make sure you have:
- Admin access to HestiaCP
- The IP address you want to block
Method 1: Block IP via HestiaCP Web Interface
Step 1: Log in to HestiaCP
https://YOUR_SERVER_IP:8083
Step 2: Navigate to SERVER → Firewall
Step 3: Add Firewall Rule
Click + Add Firewall Rule.
- Action: DENY
- Protocol: ANY
- Port: Leave blank (all ports)
- IP Address: Enter the IP to block (e.g., 185.45.6.78)
- Comment: e.g., "Blocked attacker"
Step 4: Save
Click Add.
Method 2: Block IP via SSH (UFW)
Block specific IP:
ufw deny from 185.45.6.78
Block IP subnet:
ufw deny from 185.45.6.0/24
Block IP on specific port:
ufw deny from 185.45.6.78 to any port 22
Block Multiple IP Addresses
for ip in 185.45.6.78 185.45.6.79 185.45.6.80; do
ufw deny from $ip
done
View Blocked IPs
ufw status | grep DENY
Unblock IP
ufw delete deny from 185.45.6.78
✅ IP has been blocked successfully.