🚀 Deploy n8n for FREE (No Credit Card Needed) – Full Tutorial
Tired of being asked for a credit card just to try cloud hosting? Want to run your own automation server without paying a dime? In this guide, I'll show you how to deploy n8n – a powerful open‑source workflow tool – on Hugging Face Spaces with a free Supabase database. No credit card required, and you get 16 GB of RAM, 2 vCPUs, and automatic HTTPS out of the box. Let’s dive in!
What You’ll Need
We’ll use three free services, all with email‑only signup:
-
Hugging Face Spaces – our hosting platform (gives us a free
yourname.hf.spacedomain with SSL) - Supabase – our PostgreSQL database (free tier is plenty for n8n)
- n8n template – a ready‑to‑run Space we’ll duplicate
No terminal, no Docker commands – just a few clicks and some environment variables.
Step 1: Duplicate the n8n Space
First, create a Hugging Face account – just your email. Then go to this link:
huggingface.co/spaces/tomowang/n8n
Click “Duplicate this Space”, give it a name (e.g., my-n8n-space), set visibility to Public, and hit duplicate. That’s it – your Space is created, but it’s not running yet because we need to connect a database.
Step 2: Set Up Supabase Database
Head to Supabase, sign up (again, just email), and create a new project.
- Pick a name, set a strong database password – save it!
- Choose a region close to you
- Wait a minute for it to initialise
Once ready, go to Project Settings → Database. Scroll down to Connection string and find the Transaction pooler section. This is the secret sauce.
Click ‘Transaction pooler’ and copy the host, port, user, and database. Your host will look something like:
-
aws-1-eu-west-1.pooler.supabase.comordb.xxxxx.supabase.co - Port is 6543
- User is
postgres - Database is
postgres
Keep these handy – we’ll use them in the next step.
Step 3: Environment Variables – The Heart of the Setup
Go back to your Hugging Face Space → Settings → Variables and secrets. This is where we tell n8n how to find the database and how to behave.
We’ll add two secrets (private) and several public variables.
Secrets (private)
-
N8N_ENCRYPTION_KEY– a random 32‑character string. Generate one in your terminal with
openssl rand -base64 32
or use an online generator.
-
DB_POSTGRESDB_PASSWORD– the password you saved from Supabase.
Public variables
-
N8N_EDITOR_BASE_URL=https://YOUR-SPACE-NAME.hf.space/ -
WEBHOOK_URL= same as above -
N8N_PROTOCOL=https -
N8N_PORT= 7860 (this is critical – Hugging Face expects port 7860) -
DB_POSTGRESDB_HOST= the host from Supabase (transaction pooler) -
DB_POSTGRESDB_PORT=6543 -
DB_POSTGRESDB_USER=postgres -
DB_POSTGRESDB_DATABASE=postgres -
DB_TYPE=postgresdb(optional but safe) -
GENERIC_TIMEZONE= your local timezone (e.g.,Europe/Berlin) -
EXECUTIONS_DATA_PRUNE=true -
EXECUTIONS_DATA_MAX_AGE=72 -
EXECUTIONS_DATA_SAVE_ON_ERROR=all -
EXECUTIONS_DATA_SAVE_ON_SUCCESS=none
Delete these if they exist: HTTP_PROXY, HTTPS_PROXY, NODE_TLS_REJECT_UNAUTHORIZED, N8N_HOST. They cause connection problems.
Alternative: Single DATABASE_URL
If you want to avoid managing all those DB_POSTGRESDB_* variables, you can replace them with a single secret called DATABASE_URL. Simply delete all the DB_POSTGRESDB_* variables, then add a secret with the full connection string from Supabase (transaction pooler). It looks like this:
postgresql://postgres:YOUR_PASSWORD@YOUR_HOST:6543/postgres
That’s it – much cleaner.
Step 4: Restart and Watch the Logs
Once all variables are set, go to the App tab, click the three dots, and select ‘Restart this Space’. Wait a moment, then open the Logs section.
You’re looking for a line that says:
n8n ready on ::, port 7860
If you see that, your Space is live!
Step 5: Access n8n and Create Admin Account
Now open your Space URL: https://YOUR-SPACE-NAME.hf.space. You’ll see the n8n login page. Click ‘Sign up’ and create your admin account. Congratulations – you’re now running n8n for free!
Troubleshooting Common Errors
If things go wrong, here’s how to fix them:
-
No encryption key found– make sure you added theN8N_ENCRYPTION_KEYsecret. Re‑add it and restart. -
connect ENETUNREACH … :5432– you’re using the wrong port. SetDB_POSTGRESDB_PORTto6543. -
Tenant or user not found– your database host, user, or password is wrong. Double‑check the transaction pooler details in Supabase. -
404 when visiting your Space – most likely n8n is listening on the wrong port. Make sure
N8N_PORT=7860and restart.
Why This Works & Bonus Tips
Hugging Face Spaces gives you a free domain, SSL, and more resources than most free cloud VMs. Supabase’s transaction pooler makes the connection stable even on the free tier. Your workflows are stored in Supabase, so they survive restarts.
If you ever want to upgrade n8n, simply edit the Dockerfile in your Space’s files and change the image tag, or re‑duplicate the latest template.
That’s It!
You now have a fully functional automation server at zero cost. If this helped you, feel free to share it or drop a comment if you have any questions. Happy automating!
Useful Links
- n8n template (direct duplicate link): https://huggingface.co/spaces/baoyin2024/n8n-free?duplicate=true
- Supabase: supabase.com
- n8n documentation: docs.n8n.io
Top comments (0)