Self-hosted n8n automation platform with SQLite (default) or Supabase PostgreSQL.
Automated (Recommended):
./quickstart.sh # Interactive script - asks minimal questionsManual:
# 1. Initialize
make init
vi .env # Set FLY_APP_NAME, FLY_REGION, DB_TYPE (sqlite/postgresdb)
# 2. Create Fly.io app
make app-create
# 3. Create persistent volume
make volume-create # Creates 10GB volume for data storage
# 4. Setup and deploy
make setup
make deploy
# Done! Access at https://n8n-selfhosted.fly.devBefore running the quickstart, ensure you have:
-
Fly.io account - Sign up and install CLI:
brew install flyctl fly auth login
-
Supabase project
⚠️ Only required if using Supabase database- If you choose SQLite (default), no database setup is needed
- If you choose Supabase, create a project at supabase.com or via CLI
- Free tier includes 500MB database
- Save your project reference and database password - you'll need these when running
./quickstart.sh - To get the password:
- If created via web: Go to Project → Settings → Database
- If created via CLI: Use
--db-passwordflag when creating, or retrieve from dashboard
-
openssl - Usually pre-installed on macOS/Linux
Create .env with:
# Fly.io
FLY_APP_NAME=n8n-selfhosted
FLY_REGION=lax
# Database (sqlite or postgresdb)
DB_TYPE=sqlite
# Supabase Database (only required if DB_TYPE=postgresdb)
SUPABASE_PROJECT_REF=your-project-ref
SUPABASE_DB_PASSWORD=your-database-passwordmake help # Show all commands
make volume-create # Create persistent volume
fly status # Check app status
fly logs # View logs
fly apps restart # Restart app- ✅ Idempotent - Safe to run multiple times
- ✅ Validated - Checks config before deploying
- ✅ Automated - Generates encryption keys
- ✅ Secure - Secrets never committed
- App: n8n (latest) on Fly.io
- Database: SQLite (default) or Supabase PostgreSQL (optional)
- Storage: Persistent volume (filesystem mode)
- Region: Configurable (default: Los Angeles)
- HTTPS: Automatic via Fly.io
With SQLite (default):
| Service | Tier | Cost/month |
|---|---|---|
| Fly.io (1GB RAM, 1 CPU) | Paid | $2-5 |
| Total | $2-5 |
With Supabase:
| Service | Tier | Cost/month |
|---|---|---|
| Fly.io (2GB RAM, 2 CPUs) | Paid | $5-10 |
| Supabase (500MB DB) | Free | $0 |
| Total | $5-10 |
Can run on smaller Fly.io VM (512MB RAM, 1 CPU) for ~$2-3/month.
- doc/QUICKSTART.md - 5-minute setup guide
- doc/MAKEFILE.md - All Make commands
- doc/SETUP.md - Database and storage setup
- doc/COMMANDS.md - CLI reference
SQLite (default):
- Database file stored in persistent volume at
/data/database.sqlite - Backup: Copy the database file from the volume
- No external setup required
Supabase PostgreSQL: See doc/SETUP.md for detailed database operations:
- Connect:
psql "postgresql://postgres:PASSWORD@PROJECT.supabase.co:5432/postgres" - Backup:
pg_dump "postgresql://..." > backup.sql - Restore:
psql "postgresql://..." < backup.sql
make check # Validate everything
fly secrets list # List secrets
fly ssh console # SSH into container
fly status # Check app status
fly logs # View logs
fly apps restart # Restart app- Secrets stored in Fly.io (not in git)
- Encryption key auto-generated
- HTTPS enabled by default
- Database uses SSL connections
.envis gitignored
# Check status
fly status
# View logs
fly logs
# Make changes
# ...
# Deploy
make deploy- Run
make helpfor all commands - See doc/ for detailed guides
- n8n docs: docs.n8n.io
This setup is MIT licensed. n8n is available under fair-code license.