Back to Blogs
May 16, 20265 min read

Hosting n8n on Render for Free Using Docker and PostgreSQL

A practical walkthrough for hosting n8n on Render with Docker, PostgreSQL persistence, and a free HTTPS deployment.

n8nRenderDockerPostgreSQL

I recently spent some time researching different ways to host n8n for real automation workflows, and I ended up with a setup that is lightweight, stable enough for practical use, and free to start with.

I first checked the official n8n cloud option, but for my use case it felt a bit expensive. I also explored the self-hosted route by running n8n locally and inside Docker containers. That was great for learning and testing, but I did not want my automation to depend on my laptop being online all the time.

So I moved to a cloud deployment approach and hosted n8n on Render using Docker.

What this setup includes

This setup uses:

  • Render Web Service
  • docker.io/n8nio/n8n:latest
  • PostgreSQL for persistence
  • Public HTTPS URL from Render
  • Free tier deployment

Step 1: Create a Render account

Go to Render and create an account. If needed, connect your GitHub account as well.

Step 2: Create a PostgreSQL database

Inside the Render dashboard:

New + -> PostgreSQL

Fill in the details:

  • Name: n8n-db
  • Database: n8n
  • User: auto-generated
  • Region: nearest region
  • Plan: Free

Once the database is created, open it and note these values:

  • Host
  • Port
  • Database
  • Username
  • Password

You will use them later in the n8n service.

Step 3: Create a Web Service

Inside the Render dashboard:

New + -> Web Service

Then choose:

Deploy an existing image from a registry

Step 4: Use the n8n Docker image

Set the image to:

bash
docker.io/n8nio/n8n:latest

Step 5: Configure the Web Service

Use these settings:

SettingValue
Namen8n
Regionnearest region
Instance TypeFree
Port5678

Step 6: Add the n8n environment variables

Open the Environment tab and add:

env
N8N_HOST=your-service-name.onrender.com
N8N_PROTOCOL=https
WEBHOOK_URL=https://your-service-name.onrender.com/
N8N_PORT=5678
GENERIC_TIMEZONE=Asia/Kolkata
N8N_ENCRYPTION_KEY=your-random-secret-key
N8N_SECURE_COOKIE=true
N8N_EDITOR_BASE_URL=https://your-service-name.onrender.com

Replace:

  • your-service-name
  • your-random-secret-key

with your actual values.

Step 7: Add PostgreSQL environment variables

Now connect the PostgreSQL database to n8n by adding these variables:

env
DB_TYPE=postgresdb
DB_POSTGRESDB_HOST=your-postgres-host
DB_POSTGRESDB_PORT=5432
DB_POSTGRESDB_DATABASE=your-database
DB_POSTGRESDB_USER=your-username
DB_POSTGRESDB_PASSWORD=your-password

Use the exact values from your PostgreSQL service in Render.

Step 8: Deploy the service

Click:

Deploy Web Service

Render will:

  • pull the Docker image
  • start the container
  • expose the service through HTTPS
n8n Docker image and PostgreSQL running in Render
n8n Docker image and PostgreSQL running in Render
n8n web service deployed successfully on Render
n8n web service deployed successfully on Render

Step 9: Open your n8n instance

Once deployment is complete, open:

txt
https://your-service-name.onrender.com

You should see the n8n setup screen. Create your admin account and start building workflows.

n8n running in the browser after deployment
n8n running in the browser after deployment

Optional: Add a start command

If the service keeps restarting, set the start command to:

bash
n8n start

Usually this is not required, but it can help in some cases.

Why PostgreSQL matters

Using PostgreSQL makes the setup much more reliable because:

  • workflows are stored persistently
  • credentials stay safe across restarts
  • the deployment behaves better than SQLite for real use

SQLite is fine for local learning, but PostgreSQL is the better choice for a hosted setup.

Limitations to keep in mind

Render’s free web services spin down after 15 minutes of inactivity, and they take about one minute to wake up again. Render also says free web services may be restarted at any time, and anything stored on the service filesystem is ephemeral, so local files and SQLite data can be lost on redeploy, restart, or spin-down. Free web services also do not support persistent disks.

For the database side, Render’s free PostgreSQL tier has a 1 GB storage limit, expires 30 days after creation, and then gives a 14-day grace period before the database and its data are deleted if you do not upgrade. Free Postgres also has no backups.

Render also gives each workspace 750 free instance hours per month. If you use them up, free web services are suspended until the next month.

That means this setup is great for learning, personal automations, and small workflows, but not ideal as a long-term production setup unless you move the database and service to paid infrastructure before the free limits kick in.

I recommend suspending the service when it is not in use.

What to expect on Render free tier

This setup works well for:

  • personal automations
  • webhook testing
  • small side projects
  • learning workflows
  • lightweight integrations

There are still some limits:

  • the service can sleep after inactivity
  • cold starts may happen
  • CPU and RAM are limited
  • heavy production workloads are not ideal

Even with those limits, it is a very practical zero-cost way to run n8n online.

Final result

At the end of this setup, you get:

  • a hosted n8n instance
  • a public URL
  • Docker-based deployment
  • PostgreSQL persistence
  • no VPS management
  • no hosting cost at the start

For anyone trying to build small automation systems or learn self-hosted workflow tooling, this is a very solid path.

Useful links