Cpanel Server Behind NAT (Amazon AWS)

When hosting Cpanel server behind NAT like Amazon AWS, Google Cloud etc.. where you have internal IP and external IP, you need to enable NAT so cpanel will map external IP to internal IP.

First make sure external IP is not added to your server. Now run

On AWS, this generate a file like

Here 172.31.39.115 = internal IP. 18.218.172.134 = external IP.

Now login to WHM, go to Home > IP Functions > IP Migration Wizard

Change your sites IP address with INTERNAL IP address.

Show IP Address Usage will show your external IP address

Home > Server Configuration > Basic WebHost ManagerĀ® Setup > Basic Config > The IPv4 address (only one address) to use to set up shared IPv4 virtual hosts. will show your external IP address.

See Cpanel Server, Amazon Ec2 Fixing Cpanel IP after restore from snapshot