How to update n8n via CLI when a new version is released?

I am a newbie in n8n.

Suppose I have installed n8n v 0.70.0 via CLI on my Debian:

npm install n8n -g

After a while a new version 0.71.0 is released.

The questions are:

  1. How to update n8n to the 0.71.0 release via CLI?
  2. Will not it destroy my created workflows?
1 Like

Welcome to the community @James-Frost!

To your questions:

Updating to the latest version is possible with:

npm update -g  n8n

It will not destroy your existing workflows as they are saved separately in your user-folder under .n8n.

4 Likes

Thanks a lot for answer, @jan!

Can you explain in simple words why several releases have different names and number of versions?

Does the command npm update -g n8n updates n8n instance to only n8n@‘digits’ release or to n8n-workflows@‘digits’ releases too?

Current release is [email protected].
I installed it.
Suppose you create new release: [email protected]
I update n8n via command npm update -g n8n
What will happen?

The version of n8n will set to 0.34.0?

n8n consists of multiple modules (like n8n-nodes-base, n8n-workflow, …) but you do not have to care about those. For you only the n8n module is important which contains all the other ones.

Thanks a lot for explanation, @jan!

Hey I tried doing this and didn’t work for me, I’m running n8n on CLI and I have been looking for a way of upgrading version for an hour, but I can’t seem to find nothing apart from this comment.

Thanks @jan :slight_smile:

Hm, sorry to hear! Would love to help you but sadly is the issue then totally unrelated to n8n and has rather to do with npm and some issues it seems to be having. If possible I would always advise running n8n with docker.

Sorry if it’s a dumb question but is there a way of doing it on Windows? The tutorial on n8n’s documentation is meant for Ubuntu.

People which want to run it on Windows are normally just playing around a bit to test n8n. The server setup guide in the docs is for a “proper” installation on a webserver with own subdomain and SSL certificate. That would not work for this case anyway (as the machine needs a static IP address). So for those cases the basic docker instructions on how to start n8n with a tunnel that can be found here should be enough:

You just have to install docker first:

I hope that helps. If not simply reach out again.

I have 0.87.2 running on ubuntu. The current version should be 0.89.2.
If I run:
sudo npm update -g n8n localtunnel
I get no error but my version is still 0.87.2

What am I doing wrong?

Is more npm which constantly causes problems. For that reason (and many others) do I always strongly recommend docker. Anyway in this case it is best if you uninstall n8n and then reinstall it again.

Btw. no need to install localtunnel separately.

1 Like

update in the forked repo

  1. update from host source
    goto your forked repo in GitHub, click Fetch Upstream > Fetch and Merge
  2. update in local
    goto your local code base folder, then
git pull
lerna bootstrap --hoist
npm run build
  1. restart your dev
    npm run start