Contents
n8n is a Node.js program that has to keep running: schedules fire on their own, and webhooks must answer at any hour. On hosting without Docker, the dependable layout has two small parts: n8n itself running in the background on a private local port, and a tiny Node.js app that publishes it on your subdomain over HTTPS.
Browser or webhook → https://n8n.example.com → proxy app (Setup Node.js App)
→ n8n on 127.0.0.1:51678 (kept alive by cron)
Before you start
- A plan with SSH and Node.js 20.19 or later; n8n supports Node.js 20.19 up to 24.x, and Node.js 24 is the simplest choice.
- A subdomain such as
n8n.example.comon your hosting account, with its certificate issued (free SSL guide). - Room in your plan: n8n’s packages take a lot of disk space and files (inodes), and a running instance uses noticeably more memory than a typical website.
- Two free local port numbers, for example
51678and51679. Other accounts on a shared server use ports too, so avoid n8n’s defaults5678and5679.
1. Install n8n in its own folder
node -v # v24.x, or v20.19 and later
mkdir -p ~/n8n/data && cd ~/n8n
npm init -y
npm install n8n@2
./node_modules/.bin/n8n --version
The install downloads many packages and can take several minutes. If it ends with Killed, it hit the memory limit: close other processes and run it again.
2. Create the settings file
Generate an encryption key with openssl rand -hex 32, then create ~/n8n/.env with your own domain, username, ports and key:
N8N_USER_FOLDER=/home/myuser/n8n/data
N8N_ENCRYPTION_KEY=paste-the-generated-key-here
N8N_LISTEN_ADDRESS=127.0.0.1
N8N_PORT=51678
N8N_RUNNERS_BROKER_PORT=51679
N8N_HOST=n8n.example.com
N8N_PROTOCOL=https
WEBHOOK_URL=https://n8n.example.com/
N8N_EDITOR_BASE_URL=https://n8n.example.com/
N8N_PROXY_HOPS=1
N8N_PUSH_BACKEND=sse
GENERIC_TIMEZONE=Asia/Riyadh
EXECUTIONS_DATA_MAX_AGE=168
Protect it with chmod 600 ~/n8n/.env. The lines that matter most:
N8N_ENCRYPTION_KEYencrypts saved credentials. Copy it to your password manager now.N8N_USER_FOLDERkeeps the database (SQLite by default) and settings in~/n8n/data/.n8n, outsidepublic_html.WEBHOOK_URLis the public address webhook URLs are built from. Recent n8n releases name itN8N_WEBHOOK_URL;WEBHOOK_URLstill works as an alias.N8N_LISTEN_ADDRESS=127.0.0.1keeps n8n off the public network; only the proxy app talks to it.N8N_RUNNERS_BROKER_PORTmoves the internal task-runner port (used by the Code node) off its default.EXECUTIONS_DATA_MAX_AGE=168deletes execution history older than 168 hours (7 days) so the database doesn’t grow without limit.
3. Write the start script
Find your Node.js folder with dirname "$(command -v node)", then create ~/n8n/start.sh and replace NODE_DIR with that folder:
#!/bin/bash
# Starts n8n unless it is already running.
export PATH="NODE_DIR:$PATH"
cd "$HOME/n8n" || exit 1
exec 9>"$HOME/n8n/.lock"
flock -n 9 || exit 0 # already running: nothing to do
set -a; . "$HOME/n8n/.env"; set +a
exec ./node_modules/.bin/n8n start >> "$HOME/n8n/n8n.log" 2>&1
flock holds a lock for as long as n8n runs, so running the script again never starts a second copy. Make it executable, start it once and check its health endpoint:
chmod +x ~/n8n/start.sh
nohup ~/n8n/start.sh >/dev/null 2>&1 &
sleep 20; curl -s http://127.0.0.1:51678/healthz
{"status":"ok"} means n8n is up. Anything else: read tail -n 40 ~/n8n/n8n.log.
4. Keep it running with cron
Add a cron job that runs every 5 minutes, from Site tools → Cron in the Araby Panel or Advanced → Cron Jobs in cPanel (the cron generator explains the timing syntax):
*/5 * * * * /home/myuser/n8n/start.sh >/dev/null 2>&1
If n8n is running, the script exits at once; if it stopped, it’s back within 5 minutes.
5. Publish it on your subdomain
In cPanel open Software → Setup Node.js App → Create Application and fill in:
| Field | Value |
|---|---|
| Node.js version | 24 |
| Application mode | Production |
| Application root | n8n-proxy |
| Application URL | n8n.example.com |
| Application startup file | app.js |
Click Create. Create ~/n8n-proxy/package.json, then click Run NPM Install on the app’s page:
{ "name": "n8n-proxy", "private": true, "dependencies": { "http-proxy": "^1.18.1" } }
Now create ~/n8n-proxy/app.js:
const http = require('http');
const httpProxy = require('http-proxy');
const proxy = httpProxy.createProxyServer({ target: 'http://127.0.0.1:51678', ws: true });
proxy.on('proxyReq', (proxyReq) => proxyReq.setHeader('X-Forwarded-Proto', 'https'));
proxy.on('error', (err, req, res) => {
if (!res.writeHead) return res.destroy(); // a WebSocket connection
if (!res.headersSent) res.writeHead(502, { 'Content-Type': 'text/plain' });
res.end('n8n is not running. Check ~/n8n/n8n.log');
});
const server = http.createServer((req, res) => proxy.web(req, res));
server.on('upgrade', (req, socket, head) => proxy.ws(req, socket, head));
server.listen(process.env.PORT || 3000);
Click Restart. The web server hands every request for the subdomain to this app, and the app forwards it to n8n.
6. Create the owner account right away
Open https://n8n.example.com. The first visitor sets up the owner account, so do it immediately with a strong password, then turn on two-factor authentication in your n8n personal settings.
Update and back up
Export your work before every update; exported credentials stay encrypted with your key:
cd ~/n8n && mkdir -p backup && set -a && . ./.env && set +a
./node_modules/.bin/n8n export:workflow --all --output=backup/workflows.json
./node_modules/.bin/n8n export:credentials --all --output=backup/credentials.json
npm install n8n@2
pkill -u "$USER" -f "n8n start"; nohup ~/n8n/start.sh >/dev/null 2>&1 &
Stay on n8n 2.x on this kind of hosting. n8n 3.0 (in beta since October 2026, with a stable release planned for December 2026) no longer supports npm installs and requires Docker, which shared and AI/Developer plans don’t offer. That’s why the commands here install n8n@2. n8n says the 2.x line keeps getting security and critical fixes for 12 months after the 3.0 stable release. If you later need n8n 3, it needs a server where you can run Docker, such as a VPS.
Troubleshooting
- The page says
n8n is not running: the proxy works but n8n doesn’t. Read~/n8n/n8n.logand run~/n8n/start.shby hand. - An application error page instead of n8n: the proxy app didn’t start, usually because Run NPM Install wasn’t run. See Passenger app error.
EADDRINUSEin the log: another process uses that port. Pick other numbers in.envandapp.js.- Webhook URLs show
localhost:5678:WEBHOOK_URLwasn’t loaded. Restart n8n, then deactivate and reactivate the workflow (n8n webhook not working). - The editor keeps showing “Connection lost”: live updates aren’t getting through. Switch
N8N_PUSH_BACKENDbetweensseandwebsocketand restart n8n. - n8n stops after a while: look for
heap out of memoryorKilledin the log. Shorten execution history, split heavy workflows, or move to a larger plan.
Honest limits
- CPU, memory and process limits are per account and depend on the plan, so heavy workflows or large files can reach them.
- No Docker: n8n runs from npm in regular mode, and queue mode with separate workers is outside this setup.
- No incoming ports: everything reaches n8n through your domain on HTTPS.
On ArabyHost
n8n runs on the AI/Developer plans: SSH jailed in CageFS, Node.js 20 and 24, Node.js apps through Setup Node.js App (Phusion Passenger), and background processes kept alive with cron. The free SSL certificate is issued for your subdomain automatically, and daily JetBackup backups include the ~/n8n folder. There’s no Docker, root access or GPU, so AI nodes should call external model APIs rather than local models. If something stops, Araby AI in the panel reads the error logs and explains the cause. For choosing a plan size, see n8n hosting.
FAQ
Can I run n8n with Docker on shared hosting?
No. Shared and developer hosting don't run Docker, so n8n is installed with npm and runs as a regular Node.js process. The editor and workflows are the same; only the installation method differs.
What happens if I lose N8N_ENCRYPTION_KEY?
n8n can no longer decrypt the credentials saved in its database, so every connected account (Google, Telegram, API keys) must be entered again. Keep the key in a password manager next to your backups.
Why did my scheduled workflows stop running?
The n8n process stopped and nothing restarted it. The cron job in this guide checks every 5 minutes and starts n8n again; read `~/n8n/n8n.log` to find why it stopped, which is often a memory limit.
Can I install n8n 3 on shared or AI hosting?
Not with npm. n8n 3.0 requires Docker and no longer publishes an npm install, so on hosting without Docker install the 2.x line with `npm install n8n@2`. It keeps receiving security fixes for 12 months after the 3.0 stable release.