Skip to content

Self Host n8n for Completly free

n8n needs a Postgress DB to store workflows, credentials, etc.
we are going to be using supabase as the Postgress DB Provider

Runs the actual n8n app, gives us a public url to use n8n from

Render will spin down the n8n service after 15 mintues of inactivity
so we’re gonna ping the service after 14 mintues forever to keep it active and not spin down by setting up a cron job in cron-job.org

  1. click this link : supabase to signup or signin

  2. click New organization button

    • name it with your own name, doesn’t matter
    • select Type to be Personal
    • select Plan to be Free
    • click Create new organization

    click New project button

    • Organization to be whatever is selected by default
    • Project name to be n8n-db, doesn’t really matter
    • Database password to be a new password that we will need shortly
    • Region to be a West US (Oregon) Region (because Render’s Region will also be that)
    • Security to default settings
    • click Create new project
  3. click the Connect button in the top bar

    SUpabase Connect button highlight

    then do these things :

    • set Type to SQLAlchemy
    • Method to Transcation pooler
    • remeber (copy) the block of text just right to Transcation pooler (SHARED POOLER)

    Supabase Transcation Pooler Credential Guide Image

  1. signup or signin to render

  2. create a new webservice by :

    • open New Web Service page
    • click Existing Image
    • Import Url to be this
      docker.n8n.io/n8nio/n8n
    • click Connect
  3. in the next page, set :

    • Name to be anything, eg. n8n

    • Region to be US (Oregon)

    • Instance Type to be Free

    • Environment Variables to match this :

      KeyValue
      DB_POSTGRESDB_DATABASEpostgres
      DB_POSTGRESDB_HOSTthe host value from the supabase page
      DB_POSTGRESDB_PASSWORDthe Database password of the supabase project
      DB_POSTGRESDB_PORTthe port value from the supabase page
      DB_POSTGRESDB_SCHEMApublic
      DB_POSTGRESDB_USERthe user value from the supabase page
      DB_TYPEpostgresdb
      N8N_ENCRYPTION_KEYset to litteraly any random string
    • click Deploy Web Service

  4. after deployment, you will be forwarded to the webservice dashboard we just created
    we need to set more environment variables for proper functioning of n8n

    • go to Left Sidebar > Environment > Environment Variables > Edit > Add
    • and add these environment vairbales :
      KeyValue
      N8N_EDITOR_BASE_URLthe url that render has deployed n8n to, can be found on top of the dashbaord
      WEBHOOK_URLthe url that render has deployed n8n to, can be found on top of the dashbaord
    • then click Save and deploy
  1. signup or signin to cron-job.org

    • go to the dashboard
    • click Create Cronjob
    • set Tile to Keep n8n Awake
    • set Url to the url render deployed n8n to. can be found on the top of Web Service page in Render
    • set Crontab expression to :
      */14 * * * *
    • click Create