N8n which Node.js version?
This guide answers n8n which Node.js version to use and gives a direct, simple setup route. Use Node.js 18 LTS for current n8n releases. Below are commands and steps for a Node.js install and a Docker setup so you can start automating quickly.
n8n which Node.js version – What You Need
- Basic command line skills.
- macOS, Linux, or Windows with WSL for local Node.js.
- Optional: Docker installed for container deployment.
How to Install Node.js 18 with nvm
Install Node.js 18 using nvm. This keeps versions isolated and easy to update. The steps below show the exact commands to run.
1. Install or update nvm (follow nvm docs for your OS).
2. Install Node.js 18 LTS:
nvm install 18
3. Use Node.js 18:
nvm use 18
4. Verify Node.js version:
node -v # should show v18.x.x
After Node 18 is active, install n8n locally for testing:
npm install -g n8n
# Or run without global install:
# npx n8n
How to Run n8n with Docker
Docker is an easy way to run n8n with a consistent Node environment. The official image bundles the correct runtime.
docker run -it --rm \
-p 5678:5678 \
-v ~/.n8n:/home/node/.n8n \
n8nio/n8n:latest
This command starts n8n on port 5678 and stores data in your home directory. Use a named volume or PostgreSQL for production data persistence.
Step-by-step Startup Logic
1. Choose runtime: local Node.js 18 or Docker container.
2. If local, install Node 18 and install or run n8n.
3. If Docker, pull or run the official image.
4. Configure persistence and environment variables for production.
5. Start the service and open http://localhost:5678
Update
Keep Node.js and n8n updated. To update Node when using nvm, run:
nvm install 18 --reinstall-packages-from=18
nvm use 18
node -v
To update the Docker image, pull the latest and restart the container:
docker pull n8nio/n8n:latest
# Stop and recreate your container with the new image
Security
Do not expose n8n to the public internet without authentication and HTTPS. Use a reverse proxy and TLS in front of n8n for production.
- Use a managed database (Postgres) for production persistence.
- Run n8n behind a firewall or VPN when possible.
- Keep Node.js and dependencies up to date to receive security fixes.
Done
You now know n8n which Node.js version to use and how to set it up. Start with Node.js 18 LTS locally or use the official Docker image to run n8n quickly and safely.