Automation & Self-Hosting
How to Deploy n8n for Free Online Without Docker (Hostless + Supabase)
Most free n8n hosting tutorials sleep after 15 minutes or crash on port 6543 migrations. Here is how to run an always-on, non-Docker n8n 2.37+ stack on Hostless and Supabase PostgreSQL for $0/month.
Free n8n Hosting Options Compared
If you want to self-host n8n on the web for free, webhook uptime and database durability matter more than raw specs. Free container platforms that spin down when idle miss Telegram, Stripe, and form webhooks before the server wakes up.
| Hosting Stack | Credit Card | Sleeps When Idle? | Docker Required? | Webhook Reliability |
|---|---|---|---|---|
| Hostless + Supabase (This Guide) | No | No (Always-On) | No (Node.js 24) | High (0.5 vCPU / 1 GiB RAM) |
| Render Free + Supabase | No | Yes (after 15 min) | Optional / Yes | Low (cold-start timeouts) |
| Hugging Face Spaces | No | After inactivity | Yes (Dockerfile) | Medium (port 7860 quirks) |
| Railway Trial | Usage metered | No | Yes | Stops when trial credit ends |

Three Mistakes That Break n8n + Supabase Deployments
connect ENETUNREACHon Supabase Direct Connections: Free-tier direct endpoints (db.<ref>.supabase.co) resolve to IPv6 only. Most free cloud runners operate over IPv4 and drop the connection immediately.- Using Port
6543(Transaction Pooler) for n8n: Transaction pooling breaks session-level prepared statements required by n8n database migrations. Use Shared Session Pooler on port5432—it routes over IPv4 while preserving session behavior. - Installing Community Nodes from the UI on Ephemeral Disks: Ephemeral containers reset local storage on every redeploy, and running
npm installinside a 1 GiB runtime risks Out-Of-Memory crashes. Installing them during build vianpm ciand seeding them on startup prevents both issues.

Step 1: Provision a Least-Privilege Supabase Schema & Session Pooler
Avoid giving n8n your global postgres superuser credentials. Create a dedicated schema and a minimal-privilege role in the Supabase SQL Editor:
CREATE SCHEMA IF NOT EXISTS n8n;
CREATE ROLE n8n_app WITH LOGIN PASSWORD 'REPLACE_WITH_STRONG_PASSWORD';
GRANT USAGE, CREATE ON SCHEMA n8n TO n8n_app;
ALTER DEFAULT PRIVILEGES IN SCHEMA n8n GRANT ALL ON TABLES TO n8n_app;
ALTER DEFAULT PRIVILEGES IN SCHEMA n8n GRANT ALL ON SEQUENCES TO n8n_app;n8n schema excluded from Supabase's public Data API and do notenable Row Level Security (RLS) on n8n's internal tables—n8n runs migrations directly as the schema owner.Open Connect → Session pooler in Supabase and copy the host (aws-0-<region>.pooler.supabase.com), port 5432, and the pooler username formatted as n8n_app.<YOUR_PROJECT_REF>.
Step 2: Set Up the Non-Docker GitHub Repository
Create a private GitHub repository containing .nvmrc (set to 24), package.json, hostless.yaml, and a scripts/ directory. Pinning exact dependency versions ensures reproducible builds with npm ci:
{
"name": "hostless-n8n",
"version": "1.0.0",
"private": true,
"description": "A minimal, non-Docker n8n deployment for Hostless and Supabase Postgres",
"engines": {
"node": ">=24 <25"
},
"scripts": {
"start": "node scripts/start-n8n.mjs",
"check": "node scripts/check-config.mjs"
},
"n8nCommunityPackages": [
"@tavily/n8n-nodes-tavily"
],
"dependencies": {
"@tavily/n8n-nodes-tavily": "0.5.1",
"n8n": "2.37.9"
}
}Next, add hostless.yaml to enforce single-replica scaling inside the 1 GiB free tier and wire up the /healthz readiness probe:
build:
system: auto
command: "npm ci --omit=dev --no-audit --no-fund && npm run check"
min_cpu: 0.5
max_cpu: 2
min_memory: 1024
max_memory: 4096
start_command: "node scripts/start-n8n.mjs"
scaling:
trigger: http_requests
min_cpu: 0.1
max_cpu: 0.5
min_memory: 128
max_memory: 1024
min_replicas: 1
max_replicas: 1
max_http_requests_per_replica: 10
health_check:
type: http
http_path: "/healthz"
interval_in_seconds: 30Step 3: Add Startup Scripts for Memory Bounds & Persistent Nodes
Add scripts/seed-community-nodes.mjs so build-time community packages are copied cleanly into ~/.n8n/nodes/node_modules on container boot without triggering runtime npm installs:
import { cpSync, existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
import { homedir } from 'node:os';
import { join } from 'node:path';
import { fileURLToPath } from 'node:url';
export function seedCommunityNodes({
appRoot = fileURLToPath(new URL('../', import.meta.url)),
userRoot = process.env.N8N_USER_FOLDER || homedir(),
} = {}) {
const pkg = JSON.parse(readFileSync(join(appRoot, 'package.json'), 'utf8'));
const nodesRoot = join(userRoot, '.n8n', 'nodes');
const restored = [];
const manifestPath = join(nodesRoot, 'package.json');
const manifest = existsSync(manifestPath)
? JSON.parse(readFileSync(manifestPath, 'utf8'))
: { name: 'installed-nodes', private: true, dependencies: {} };
for (const name of pkg.n8nCommunityPackages ?? []) {
const source = join(appRoot, 'node_modules', name);
const target = join(nodesRoot, 'node_modules', name);
if (existsSync(join(target, 'package.json'))) continue;
const installed = JSON.parse(readFileSync(join(source, 'package.json'), 'utf8'));
if (installed.version !== pkg.dependencies[name] || !installed.n8n) {
throw new Error(`Invalid bundled community package: ${name}`);
}
mkdirSync(join(target, '..'), { recursive: true });
cpSync(source, target, { recursive: true, force: false });
manifest.dependencies ??= {};
manifest.dependencies[name] ??= installed.version;
restored.push(`${name}@${installed.version}`);
}
if (restored.length) {
writeFileSync(manifestPath, JSON.stringify(manifest, null, 2) + '\n');
}
return restored;
}Add scripts/start-n8n.mjs to check required secrets before startup (exiting with code 78 if missing), normalize boolean TLS environment variables, map Hostless's injected PORT to N8N_PORT, wire NODE_PATH, cap main V8 heap at 384 MiB (plus 128 MiB for the internal Code runner), and forward shutdown signals:
import { spawn } from 'node:child_process';
import { fileURLToPath } from 'node:url';
import { delimiter } from 'node:path';
import { seedCommunityNodes } from './seed-community-nodes.mjs';
const required = [
'N8N_ENCRYPTION_KEY',
'DB_POSTGRESDB_HOST',
'DB_POSTGRESDB_USER',
'DB_POSTGRESDB_PASSWORD',
];
const missing = required.filter((name) => !process.env[name]?.trim());
if (missing.length > 0) {
console.error(`Missing required environment variables: ${missing.join(', ')}`);
process.exit(78);
}
function normalizeBooleanEnv(name, fallback) {
const raw = process.env[name];
if (raw === undefined || raw.trim() === '') return fallback;
const normalized = raw.trim().replace(/^(['"])(.*)\1$/, '$2').toLowerCase();
if (normalized === 'true' || normalized === '1') return 'true';
if (normalized === 'false' || normalized === '0') return 'false';
return fallback;
}
const env = {
...process.env,
DB_TYPE: process.env.DB_TYPE || 'postgresdb',
DB_POSTGRESDB_SSL_ENABLED: normalizeBooleanEnv('DB_POSTGRESDB_SSL_ENABLED', 'true'),
DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED: normalizeBooleanEnv(
'DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED',
'false',
),
N8N_PORT: process.env.PORT || process.env.N8N_PORT || '8000',
N8N_LISTEN_ADDRESS: '0.0.0.0',
N8N_RUNNERS_MAX_CONCURRENCY: process.env.N8N_RUNNERS_MAX_CONCURRENCY || '1',
N8N_RUNNERS_MAX_OLD_SPACE_SIZE: process.env.N8N_RUNNERS_MAX_OLD_SPACE_SIZE || '128',
NODE_PATH: [fileURLToPath(new URL('../node_modules', import.meta.url)), process.env.NODE_PATH]
.filter(Boolean)
.join(delimiter),
};
const restored = seedCommunityNodes();
if (restored.length) console.log('Restored bundled community nodes:', restored.join(', '));
const cliPath = fileURLToPath(new URL('../node_modules/n8n/bin/n8n', import.meta.url));
const mainHeap = process.env.N8N_MAIN_MAX_OLD_SPACE_SIZE || '384';
const heapArgs = /--max[-_]old[-_]space[-_]size(?:=|\s)/.test(env.NODE_OPTIONS || '')
? []
: [`--max-old-space-size=${mainHeap}`];
const child = spawn(process.execPath, [...heapArgs, cliPath, 'start'], {
env,
stdio: 'inherit',
});
let stopping = false;
function forwardSignal(signal) {
if (stopping) return;
stopping = true;
child.kill(signal);
setTimeout(() => child.kill('SIGKILL'), 25_000).unref();
}
process.on('SIGTERM', () => forwardSignal('SIGTERM'));
process.on('SIGINT', () => forwardSignal('SIGINT'));
child.on('exit', (code, signal) => {
process.exitCode = code ?? (signal ? 1 : 0);
});Finally, include scripts/check-config.mjs to verify Node 24 and confirm no Dockerfile accidentally enters the repository:
import { readFile, access } from 'node:fs/promises';
const pkg = JSON.parse(await readFile(new URL('../package.json', import.meta.url), 'utf8'));
const errors = [];
if (!pkg.dependencies?.n8n) errors.push('n8n must be pinned in dependencies');
if (Number(process.versions.node.split('.')[0]) !== 24) errors.push('Node.js 24 is required');
try {
await access(new URL('../Dockerfile', import.meta.url));
errors.push('Dockerfile must not exist');
} catch {
// Expected: non-Docker runtime
}
if (errors.length) {
for (const error of errors) console.error(`ERROR: ${error}`);
process.exit(1);
}
console.log(`OK: Node ${process.versions.node}, n8n ${pkg.dependencies.n8n}`);Step 4: Deploy on Hostless & Configure Secrets
Create a new App on Hostless connected to your repository's main branch with Build System: Auto. Store DB_POSTGRESDB_PASSWORD and N8N_ENCRYPTION_KEY inside the Hostless Secret Store, then add the remaining configuration:
# Supabase Shared Session Pooler (non-secret)
DB_TYPE=postgresdb
DB_POSTGRESDB_HOST=aws-0-eu-central-1.pooler.supabase.com
DB_POSTGRESDB_PORT=5432
DB_POSTGRESDB_DATABASE=postgres
DB_POSTGRESDB_USER=n8n_app.<YOUR_PROJECT_REF>
DB_POSTGRESDB_SCHEMA=n8n
DB_POSTGRESDB_POOL_SIZE=2
DB_POSTGRESDB_SSL_ENABLED=true
DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED=true
# Store ONLY inside Hostless Secret Store
DB_POSTGRESDB_PASSWORD=<YOUR_DB_PASSWORD>
N8N_ENCRYPTION_KEY=<RANDOM_64_CHAR_HEX_KEY>
# Public URLs (swap to custom domain after SSL issues)
N8N_HOST=your-app.hostless.app
N8N_PROTOCOL=https
N8N_EDITOR_BASE_URL=https://your-app.hostless.app
N8N_WEBHOOK_URL=https://your-app.hostless.app/
N8N_PROXY_HOPS=1
# Resource & Database Binary Tuning
N8N_CONCURRENCY_PRODUCTION_LIMIT=1
N8N_DEFAULT_BINARY_DATA_MODE=database
N8N_EXECUTION_DATA_STORAGE_MODE=database
EXECUTIONS_DATA_PRUNE=true
EXECUTIONS_DATA_MAX_AGE=168
EXECUTIONS_DATA_PRUNE_MAX_COUNT=1000
EXECUTIONS_DATA_MAX_DISPLAY_SIZE=16777216
N8N_PAYLOAD_SIZE_MAX=16
N8N_RUNNERS_MODE=internal
N8N_MAIN_MAX_OLD_SPACE_SIZE=384
N8N_RUNNERS_MAX_OLD_SPACE_SIZE=128
N8N_RUNNERS_MAX_CONCURRENCY=1
N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
N8N_BLOCK_FILE_ACCESS_TO_N8N_FILES=true
N8N_DIAGNOSTICS_ENABLED=falseNotice two critical details: first, N8N_WEBHOOK_URL replaces the deprecated WEBHOOK_URL variable (deprecated since n8n 2.35.0) and pairs with N8N_PROXY_HOPS=1. Second, storing binary data and execution logs in PostgreSQL with 7-day / 1,000-row auto-pruning keeps deployments stateless without overflowing Supabase's free 500 MB database limit.
Step 5: Custom Domain with Cloudflare (DNS-Only for WebSockets)
To attach a custom subdomain such as n8n.yourdomain.com, add the domain in Hostless, create a matching CNAME record in Cloudflare DNS with proxy disabled (DNS only), and wait for SSL provisioning. Keeping Cloudflare proxy off prevents WebSocket disconnects in the n8n editor. Once SSL is active, update N8N_HOST, N8N_EDITOR_BASE_URL, and N8N_WEBHOOK_URL and redeploy.
Frequently Asked Questions
Does the Hostless free tier sleep like Render?
No. Hostless runs free Node.js services always-on within a 0.5 vCPU and 1 GiB RAM allowance without credit card entry, keeping webhooks and scheduled triggers responsive 24/7.
Why use Supabase Session Pooler port 5432 instead of port 6543 or Direct Connection?
Supabase free-tier direct connections resolve over IPv6 only and fail with connect ENETUNREACH on IPv4 cloud runners. Transaction pooling on port 6543 disables session-level prepared statements that n8n TypeORM migrations require. Shared Session Pooler on port 5432 supports IPv4 and full session semantics.
How do community nodes stay installed across redeployments?
Pin community packages in package.json so npm ci installs them during build, then copy any missing packages from node_modules to ~/.n8n/nodes/node_modules at startup while setting NODE_PATH to your build node_modules directory.
Why use N8N_WEBHOOK_URL instead of WEBHOOK_URL?
Starting in n8n 2.35.0, WEBHOOK_URL is deprecated and logs warnings. Always set N8N_WEBHOOK_URL paired with N8N_PROXY_HOPS=1 behind a reverse proxy.
Related Engineering Resources
- llm-retry-kit — Dependency-free TypeScript LLM retry & fallback layer
- Browse all technical guides
- Running into an issue with this setup? Send a message or read the Persian version of this guide.