-
-
Save Sclafus/9823cc863ad4d007d0ccfef048fa4942 to your computer and use it in GitHub Desktop.
#!/bin/bash | |
# updating system | |
sudo apt update | |
sudo apt upgrade -y | |
# installing build tools and python | |
sudo apt install build-essential python | |
# installing nodejs | |
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - | |
sudo apt install nodejs | |
# install n8n globally | |
npm install n8n -g | |
# adding systemd entry | |
sudo echo "[Unit] | |
Description=n8n - Easily automate tasks across different services. | |
After=network.target | |
[Service] | |
Type=simple | |
User=pi | |
ExecStart=/usr/bin/n8n start --tunnel | |
Restart=on-failure | |
[Install] | |
WantedBy=multi-user.target" > /etc/systemd/system/multi-user.target.wants/n8n.service | |
# reloading, enabling on boot and starting n8n | |
sudo systemctl daemon-reload | |
sudo systemctl enable n8n | |
sudo systemctl start n8n |
Just followed your script. When tried sudo npm install n8n -g
it gives me:
added 994 packages, and audited 995 packages in 6m
92 packages are looking for funding
run `npm fund` for details
5 high severity vulnerabilities
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
Should i worry?
Hi @vico93 π
I don't think you should worry about it. You may want to ask to the n8n team directly, since high severity vulnerabilities may affect the project overall. For personal use, you'll be fine.
Hi @vico93 π
I don't think you should worry about it. You may want to ask to the n8n team directly, since high severity vulnerabilities may affect the project overall. For personal use, you'll be fine.
Thanks a lot for the feedback
@Sclafus
Hi, I'm having these errors at the end of the script:
Failed to enable unit: Unit file n8n.service does not exist.
Failed to start n8n.service: Unit n8n.service not found.
@Sclafus
on line 8 it would be: build-essential without the S
and on line 15 the command did not work, running sudo npm install -g [email protected]
and thanks for the work.
Hello @caldeusrp π
Failed to enable unit: Unit file n8n.service does not exist.
Failed to start n8n.service: Unit n8n.service not found.
The echo
command from line 17 to 29 may have failed, are you running it with sudo
? Looks like a permission error to redirect the output to /usr/...
on line 8 it would be: build-essential without the S
You are right indeed, I will correct it, thanks.
on line 15 the command did not work, running sudo npm install -g [email protected]
That's pretty odd, have you tried running it without sudo
?
Step-by-step
wget https://gist.githubusercontent.com/Sclafus/9823cc863ad4d007d0ccfef048fa4942/raw/e66f8664967c8d9035cf12f19a2c36d4fb550dc6/n8n-install-pi.sh
to download the script (watch out for line breaks in the url!)chmod +x n8n-install-pi.sh
to grant execution permissions./n8n-install-pi.sh
to execute the scriptIf you want to execute n8n with another user, you just need to change line 24.
You may also want to disable tunneling if it's not needed in your workflows: to do that, delete
--tunnel
in line 25.