Updating n8n with PM2

Some of you are running n8n as a service using the PM2 tool as per Run n8n as a Service with PM2. When a new version of n8n is released, it is important to properly manage the n8n service with PM2 prior to upgrading.

The upgrade process follows these steps:

  1. Stop the n8n service with PM2
  2. Upgrade n8n
  3. Restart the n8n service
  4. Check that n8n has upgraded

Most of these tasks are completed via the CLI.

As an example, this is how my upgrade process looked:

pm2 stop n8n
npm install -g n8n@latest
pm2 restart n8n

Once the service restarts, you can go back into the n8n webUI and click on the ? and then About n8n:
image

This should show that you now have the latest version of n8n installed and running (which is 0.78.0 as of the writing of this post. You results may be different.):
image

Troubleshooting

If you do not get these results, here are a few tips to finding the problem.

n8n Version is Still Old Version

Issue

After following the process, the version of n8n shown in the webUI is still the old version

Possible Solutions

  1. Make sure that the PM2 service has restarted the n8n service. If in doubt, reboot the server.
  2. Confirm that there were no errors during the n8n upgrade process
  3. Clear your web browser cache

WebUI Not Working

Issue

When you go back into the webUI, it is unavailable

Possible Solutions

  1. Wait for a few minutes as it can sometimes take a bit for the webUI to come back online after a restart, depending on how much power your host server has
  2. Make sure that the pm2 service has restarted n8n properly by issuing a PM2 list command. Your n8n service should come up as online. If not attempt to restart it again. If that fails, try to reboot the server.
3 Likes