Try ERPNext Buy Support Partners Foundation Foundation Members

Port change command

I am successfully running erpnext through the virtual box image, but due to the change of my isp there is some conflict in the port 8080 with that of the ISP.

Due to which i want to change my port from 8080 to 9000.
What commands do i have to run.
Please do let me know the actual commands

@Syed_Omer_Abbas

bench --site site_name serve --port port_number

If you are running setup on gunicorn then use

bench set-nginx-port site_name port_number

Thanks,
Makarand

2 Likes

Thanks, but after running the command it says that

OSError; [Errno 2] No such file or directory: ./sites

use these commands from /frappe-bench directory instead of /sites

Thanks a lot for bearing with me
For name i used localhost but it say no such site.
How do i get to know the site_name

check you /sites directory for site_name

My /sites directory is as follows;

apps.txt
celerybeat.pid
erpnext.erpnext-vm
test.schedule
asset
language.txt

which would be the site_name
I have tried it with localhost but the command displayed error
then i tried it with erpnext.erpnext-vm, no error showed up but it is currently working under port 8080

check this two directory if one of the directories have the site_config.json file then the directory name is your site_name. If not then create new site using

bench new-site site_name

Thanks a lot for your prompt replies.

site_config.json was in > erpnext.erpnext-vm but even after running the command the app is running on port 8080 through > localhost:8080

use bench --site erpnext.erpnext-vm serve --port port_number

error: no such option: --port

@Syed_Omer_Abbas Please read this

run following commands

bench set-nginx-port erpnext.erpnext-vm 9000
bench setup nginx
sudo service nginx reload 

So, your erpnext.erpnext-vm site will be run on 9000 port.
if you are running on virtual box, then please check port forwarding in virtual box.

1 Like

This works, but creates a weird problem, whereby one can’t login. It just gives Socket I/O errors in console

This doesn’t seem to work. Has anyone tried this recently? The site still launches on default ports.