How to change the cPanel port – No longer possible!

Some users asked us if it’s possible to change the default 2082/2083 cPanel port on their servers. If you are searching the internet you will see many web pages/articles that recommend you to:

  1. Log into your server via SSH as root
  2. Edit the file /var/cpanel/cpanel.config in your preferred text editor.
  3. Search the line
    port=2082
    and replace 2082 with the desired port.
  4. Restart the cPanel service with service cpanel restart

Notice that this method doesn’t work anymore. As of writing this article – June 2017 – there is no way to change the default cPanel (and WHM) ports!

Trying to manually add the line port=xxxx line in /var/cpanel/cpanel.config will result in warnings in cPanel log file /usr/local/cpanel/logs/error_log:

[2017-06-26 15:56:20 -0400] warn [restartsrv_cpsrvd] One or more key settings for "webcp.plothost.com" were either not found in cPanel & WHM’s server configuration file (/var/cpanel/cpanel.config), or were present but did not pass validation.
[2017-06-26 15:56:20 -0400] warn [restartsrv_cpsrvd] The following settings are obsolete and have been removed from the server configuration file:
[2017-06-26 15:56:20 -0400] warn [restartsrv_cpsrvd]     port
[2017-06-26 15:56:20 -0400] warn [restartsrv_cpsrvd] Read the cpanel.config file documentation (https://go.cpanel.net/cpconfig) for important information about this file.
Share this post: