How to Redirect cPanel Ports (2083 & 2087) to DirectAdmin Port 2222
Migrating from cPanel to DirectAdmin can be confusing for end-users, especially when it comes to login ports.
- In cPanel, customers log in to their hosting account at
https://domain.com:2083and WHM athttps://domain.com:2087. - In DirectAdmin, the login panel runs on port 2222 by default.
This change often leads to support tickets from customers who still try to access :2083 or :2087. The good news is, you can easily redirect ports 2083 and 2087 to 2222, so old bookmarks and habits continue to work.
Why Redirect cPanel Ports to DirectAdmin?
- ✅ Seamless migration – Users don’t have to learn a new port right away.
- ✅ Lower support load – Reduce “I can’t log in” tickets after migration.
- ✅ Professional experience – Makes DirectAdmin feel like a drop-in replacement for cPanel.
Method 1: Redirect with iptables (Recommended)
If your Linux server uses iptables, add NAT rules to forward requests.
Redirect port 2083 to 2222
iptables -t nat -A PREROUTING -p tcp --dport 2083 -j REDIRECT --to-ports 2222
Redirect port 2087 to 2222
iptables -t nat -A PREROUTING -p tcp --dport 2087 -j REDIRECT --to-ports 2222
Save the Rules
These rules disappear after a reboot unless saved:
- On CentOS / AlmaLinux / RHEL:
service iptables save
# or
iptables-save > /etc/sysconfig/iptables
- On Ubuntu / Debian:
apt install iptables-persistent -y
iptables-save > /etc/iptables/rules.v4
Method 2: Redirect with firewalld (Alternative)
If your server runs firewalld, use this instead:
firewall-cmd --permanent --add-forward-port=port=2083:proto=tcp:toport=2222
firewall-cmd --permanent --add-forward-port=port=2087:proto=tcp:toport=2222
firewall-cmd --reload
Testing the Redirect
Once rules are applied:
https://yourdomain.com:2083→ loads DirectAdmin login.https://yourdomain.com:2087→ loads DirectAdmin login.https://yourdomain.com:2222→ continues to work normally.
Final Thoughts
When performing a cPanel to DirectAdmin migration, handling ports properly makes a huge difference for end-users. By forwarding ports 2083 and 2087 to 2222, you:
- Improve the customer experience.
- Prevent confusion and login errors.
- Smoothly transition away from cPanel without disruption.
This is a quick fix that takes only a few minutes but saves hours of support work later.
Leave a Reply