Skip to main content

Install n8n

Requirements

Install Node.js 18 or above.

Create user nad group

groupadd --system n8n
sudo useradd --system --gid n8n --create-home  --home-dir /opt/n8n --shell /usr/sbin/nologin n8n

Install

Install n8n globally with npm:

npm install n8n -g

Start automatically

Configure a systemd service to start automatically at boot.

nano /etc/systemd/system/n8n.service
/etc/systemd/system/n8n.service
[Unit]
Description=n8n servce
After=network.target network-online.target
Requires=network-online.target

[Service]
User=n8n
Group=n8n
#WorkingDirectory=
Type=exec
Restart=always
RestartSec=1
ExecStart=/usr/bin/n8n start

[Install]
WantedBy=multi-user.target