VestaCP – Change listening port admin interface

This will be a quick guide on how to change the listening port in VestaCP.

In my test environment I’ve installed VestaCP on a VPS with Debian so this guide will show you how to change the port in that environment. I haven’t checked if it differs from running VestaCP on another distribution.

Note: If you have the firewall enabled (iptables) remember to add the new port to your rules BEFORE restarting the service.

Adding new port to firewall rules

I have enabled the firewall so I need to make sure that my admin interface will not be blocked after changing the port and restarting the nginX service.

First we need to login to the admin interface at https.//<your_server_ip>:8083.

Find the Firewall option in the top menu (marked in yellow) and click it.

vestacp-menu

 

Cick the Add Rule button vestacp-addrulebtn

In my example I will set the new port to 9000 and it should accept connections from everywhere (IP: 0.0.0.0/0).

The /0 at the end is crucial, that is the part that tells the firewall to allow connections from anywhere. If you leave out the /0 it will only allow connections from 0.0.0.0 which is not from where you are connecting. You can read more about CIDR here.

fw-rule

Click the Add button and you will see that successful result shown at the top.

fw-rule-added

All done, now onto changing the port and restart the service.

Changing the port

Now we need to login to the command line of the server, either via console or ssh.

When logged in, make a backup of the config file and then open the original configuration file with your favourite editor (mine is nano)

about a page down in the configuration file you should find this section

change the port number on the row that starts with listen and it should now look like this:

Like I wrote above, in this example I will change it to port 9000, you are free to change it to any port number (unless it is already taken by another service) that you like.

Exit and save the configuration file.

restart the service by running this command:

and you should now be able to access your admin web interface on the new port https.//<your_server_ip>:9000

 

All done!

I can not guarantuee that an update of the Control Panel will keep this settings, I have a hard time believing that the configuration file should change because of an update but if you can not connect after an update, revisit this page and redo your changes.

6 comments for “VestaCP – Change listening port admin interface

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.