I have managed, over the past ten days or so, to get ERPNext up and running on Ubuntu 20.04. I now have an odd (to me) situation that I can’t seem to get my head around.
I thought ERPNext required Nginx but at the moment I don’t appear to have Nginx running yet ERPNext seems to be functioning without issue.
Running sudo lsof -i -P -n | grep LISTEN
shows I have various processes running:
sshd
MariaDB
redis-server
python
node
apache
etc.
running but no Nginx. I discovered this after dropping a couple of different PHP applications in my var/www/html directory as I was preparing to set them up to run alongside ERPNext. I was assuming I would need to work on config files for Nginx but when, on a whim, I tried to access the PHP apps, they loaded into the browser, I was surprised to say the least.
I quickly checked to see how they could possibly be served and found that Apache was running…which is odd as I don’t remember installing it on my fresh instance of 20.04…maybe it was there by default…?
Then I checked to see what ports were being used by what services and low and behold…no Nginx.
Is this even possible?
Note - I am running on a local IP at the moment with no domain yet specified.
Short answer: ERPNext does not strictly require Nginx. However. You must (somehow) create a means of routing traffic to/from your ERPNext server.
Longer explanation:
By default, ERPNext runs a web service on localhost port 8000.
If you are logged into the ERPNext server, you can connect to http://localhost:8000, and it will work. Sometimes I install a text-based browser (like Lynx) , just to do this.
If you are on the same LAN, you can connect to ERPNext using the machine’s IP address.
Assume my laptop is 192.168.0.10, and my ERPNext server is 192.168.0.11.
Thank you very much for the thorough explanation. You have very clearly confirmed my guesses. I noted that ERPNext was/is running on my local network and accessible via the internal IP. I am able to access it even after turning Apache and Nginx off…which initially had me very confused.
I’m comfortable with Apache as a web server and reverse proxy so I may go that route but I’m very intrigued by Nginx and keen to learn how to use it…although the config files are racking my brain at the moment. I’ll keep experimenting with the goal of successful enlightenment.
Understanding Nginx configuration files can be extremely challenging (at least, it has been for me).
Helpful Tip: To support debugging, Nginx uses a completely separate binary executable. Its name is ‘nginx-debug’. You will need to run that executable (instead of the normal one) to open up the debugging logs fully.