[How To] Change Default Admin Login Port(8083) of VestaCP?
VestaCP is a lightweight server management web panel that comes with a lot of features. Now a day, vestaCP has become more popular because of its powerful and easy to use interface. As its popularity is growing, its security issues are attracting hackers.
Recently a number of websites run using VestaCP were hacked by hackers through the default admin login port (8083) loophole. That’s why some VPS hosting providers have blocked the default login port 8083.
So, if you are running your website using VestaCP, then you should be aware of this security concern. You should immediately block the vestaCP’s default admin login port 8083.
Therefore the question is how to block default login port 8083 of VestaCP? Well, the process is not too hard. You have to follow some steps. I am going to discuss these simple processes below.
# Steps to Change Default Admin Login Port(8083) of VestaCP:
In general, you can change the default VestaCP admin login port 8083 in two ways. The first way is through the VestaCP admin panel and the second one is through the command-line interface. Whatever the process you prefer, you can choose.
Precess 1: to Change Default Admin Login Port(8083) of VestaCP
Roadmap to change your port:
- Add a new Port.
- Change Nginx listen port.
- Restart VestaCP service.
- Remove the old 8083 port.
# STEP 1: Add New Port: First of all, login to your VestaCP admin panel through https://yourhost.tld:8083
or https://xx.xx.xx.xx:8083
. Then from the top menu click on the “firewall
” button. Next click on + green ADD RULE
button.

# STEP 2: Then: select “ACCEPT
“

# STEP 3: Next, set Protocol
to TCP
.
# STEP 4: After that, enter a port that you want to set out.
Note: Make sure that the port you are selecting is not used by any other services on your server. You may look at the list of working ports registered by IANA here. In my case, I am using port number 8099
.
STEP 5: Now, set the IP address 0.0.0.0/0
in the IP address (CIDR format is supported)
field.
# STEP 6: You may leave blank to Comment (optional)
field.

# STEP 7: Finally, click on the Add
button to save the configuration.
# STEP 8: The next thing to set your port in the nginx.conf
file located at/usr/local/vesta/nginx/conf/
directory to listen to requests using your port. To do so, open your favorite SSH client and then log in to your server using your username and password. After that edit the nginx.conf
file using the command line given below.
sudo nano /usr/local/vesta/nginx/conf/nginx.conf

# STEP 9: Now find the block containing #vhost server {
block. And change the default port 8083 to your new one. In my case, I have replaced the default port by 8099.

# STEP 10: Then press ctrl+x
then y
and hit Enter
key to save it.
# STEP 11: The final step is to restart your vesta service. To do so use the following command.
sudo service vesta restart
The final step is to delete the default VestaCP port, 8083.
# STEP 12: Now go to https://yourhost:8099
or https//:xx.xx.xx.xx:8099
to login to your admin panel.
STEP 13: Click on the firewall button from the vestaCP menu and scroll down the page. Find the Rule
that uses the port 8083. You may remove this rule by clicking the delete button. Or, set it to DROP
by editing it.
That’s it. Now you have successfully change the default VestaCP admin login port by your new one.
Process 2: Change Default Admin Login Port(8083) Directly by a Single Command
This process is quite easy. you need to execute only one command to do the whole job. The command is –
sed -i 's/8083;/8099;/' /usr/local/vesta/nginx/conf/nginx.conf && v-add-firewall-rule ACCEPT 0.0.0.0/0 8099 TCP && sed -i -e '/8083/ s/ACCEPT/DROP/' /usr/local/vesta/data/firewall/rules.conf && v-update-firewall && service vesta restart
Copy the above code and make sure to replace the port 8099 by your preferred one. Paste and execute the command. Your default port 8083 will be changed successfully.

You are done. Enjoy your VestaCP service.
Video Tutorial: Change Default Admin Login Port(8083)
A video tutorial is made. Click Here to Watch Video
well-modulated
Thanks.. Have you tried this??
I love your single line command. Really easy to use.
Can you write an article about how to set certificates for admin interface?
I guess for many people it is not so obvious and Vesta forum is really messy.