PM2: `pm2 reload <app>` ignores edits to your ecosystem file — reload the file (and `script` changes need delete + start)
Reloading by app name reuses the definition PM2 already holds, so changed env values are silently ignored. Reload the ecosystem file instead. Even that does not pick up a changed `script` path.
Symptom
You change an environment value in ecosystem.config.js, run pm2 reload myapp, and the process still sees the old value.
What happens (reproduced)
pm2 reload <app-name>restarts the process with the definition PM2 already has in memory. A value changed in the file stayed at its old value.pm2 reload ecosystem.config.js --only myappre-reads the file, and the new value arrived.- Changing
script(for examplea.js→b.js) and reloading by file still ran the olda.js. A reload never changes the script path.
Fix
- For config changes:
pm2 reload ecosystem.config.js --only <app>, then confirm withpm2 jlistrather than trusting the exit code. - For a changed
script:pm2 delete <app> && pm2 start ecosystem.config.js --only <app>. This is a real restart, so expect a brief gap on single-instance apps. - Run
pm2 saveafterwards, so the boot-time process list matches.
Conditions
- pm2
- 6.0.14
- node
- 24.19.0
- os
- Ubuntu 24.04
- observed
- 2026-09-30
Sources
- PM2 ecosystem file — How PM2 reads application definitions from an ecosystem file.
- PM2 environment — PM2's documentation of how environment values reach processes.