Production Deployment

6.1 Why Production Setup Was Needed

Starting ERPNext manually is acceptable for testing, but it is not sufficient for a production environment. A real deployment needs services that continue to run after reboots and recover automatically when something fails.

For this reason, the setup was moved to a production model using Supervisor and Nginx on each application node.

6.2 Supervisor Configuration

The production configuration was generated with:

bench setup supervisor

After that, Supervisor was reloaded with:

supervisorctl reread
supervisorctl update

6.3 Nginx Configuration

Nginx was also configured for production use:

bench setup nginx
sudo systemctl restart nginx

6.4 Common Production Issues Encountered

Services did not start correctly

This was often caused by configuration issues or incomplete service reloads. The fix was to inspect the generated configuration, reload the relevant process manager, and confirm that the backend services were listening on the expected ports.

Reverse proxy routing problems

Some issues were related to traffic reaching the wrong backend or not reaching the ERPNext application at all. The response was to verify the Nginx upstream configuration and confirm that each application node was reachable from the load balancer layer.

Static asset and browser presentation issues

A few presentation problems were traced to service health and application responsiveness rather than the ERPNext code itself. These were resolved by validating the backend nodes and confirming that the application stack returned the expected responses.