Skip to content

Instantly share code, notes, and snippets.

@Sclafus
Last active June 23, 2025 08:50
Show Gist options
  • Save Sclafus/9823cc863ad4d007d0ccfef048fa4942 to your computer and use it in GitHub Desktop.
Save Sclafus/9823cc863ad4d007d0ccfef048fa4942 to your computer and use it in GitHub Desktop.
Install n8n on raspberry pi (natively)
#!/bin/bash
# updating repositories
sudo apt update
# installing build tools and python
sudo apt install build-essential python
# installing nodejs
curl -fsSL https://deb.nodesource.com/setup_18.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/n8n.service
# reloading, enabling on boot and starting n8n
sudo systemctl daemon-reload
sudo systemctl enable n8n
sudo systemctl start n8n
@Sclafus
Copy link
Author

Sclafus commented Jun 23, 2025

Hey @MarioKart7z, it should actually be in /etc/system/systemd since n8n is installed outside of apt package manager.
I updated the script to use node 18 and updated the location of the systemd unit. Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment