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

5 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.

2 Likes

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.

I have built two apps erpnext and abcd on the same site . I just want to send the data from abcd app to erpnext using POST methods . Both the apps are running on the same port 8000 and I want them to run on different ports . Get methods are working but post methods are not working.

From what i understand you can only run sites on different ports and not specific app.
Here is the Architecture of Frappe & ERPNext

https://support.erpnext.com/docs/user/en/architecture

1 Like

worked like charm thank you

I have tried running the app on port 8080 but it is being used by postgresql. I have tried changing the port using the method in the image attached.image_2021-04-26_152907
Please help me.

This command is just for debugging the site with a temporary port.
Do you have erpnext.erpnext-vm as the site ?

Share output of
ls site/
This is the command to change port number.

bench set-nginx-port {{site-name}} 8081
bench setup nginx
sudo service nginx reload 

Good Luck.