Install Hell for 2 weeks partially working now

Environment:
Ubuntu Linux Latest (Pretty standard I dont know enough to be crazy with it other containers are running)
Docker and Portainer installed ( I am using portainer to try and install this)
Trying to run with Postgres but SQLite wont run either.

Describe the problem/error/question

I have been working to get this installed locally for almost 2 weeks. I can get the containers started etc but then there are connection issues etc.
The first attempts I was using my own Stack that I edited. This was nice because I try to keep all my containers stuff in one location /home/appdata but this stack led to postgres not initializing correctly etc. but containers would start.

version: '3.8'

volumes:
  db_storage:
  n8n_storage:

services:
  postgres:
    image: postgres:16
    restart: always
    environment:
        POSTGRES_USER: Admin
        POSTGRES_PASSWORD: 
        POSTGRES_DB: n8n
        POSTGRES_NON_ROOT_USER: Ben
        POSTGRES_NON_ROOT_PASSWORD:
    volumes:
      - /home/appdata/n8n/n8n_storage:/var/lib/postgresql/data
      - /home/appdata/n8n/init-data.sh:/docker-entrypoint-initdb.d/init-data.sh
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -h localhost -U Admin -d n8n"]
      interval: 5s
      timeout: 5s
      retries: 10

  n8n:
    image: docker.n8n.io/n8nio/n8n
    restart: always
    environment:
      DB_TYPE: postgres
      DB_POSTGRESDB_HOST: postgres
      DB_POSTGRESDB_PORT: 5432
      DB_POSTGRESDB_DATABASE: n8n
      DB_POSTGRESDB_USER: Ben
      DB_POSTGRESDB_PASSWORD: 

    ports:
      - 5678:5678
    links:
      - postgres
    volumes:
      - /home/appdata/n8n/n8n_storage:/home/appdata/n8n/node/.n8n
    depends_on:
      postgres:
        condition: service_healthy

This last attempt has been the most successful. I went to GitHub
and I downloaded the yml , I loaded the env file and updated those passwords etc.
The containers are now running but I dont really know where anything is running from or what directories volumes and DBs and things are in etc. feels messy.
I am kind of a docker Novice

What is the error message (if any)?

Anyway it is running and now I get this error and cannot get past it

Your n8n server is configured to use a secure cookie,

however you are either visiting this via an insecure URL, or using Safari.

To fix this, please consider the following options:

  • Setup TLS/HTTPS (recommended), or
  • If you are running this locally, and not using Safari, try using localhost instead
  • If you prefer to disable this security feature (not recommended), set the environment variable N8N_SECURE_COOKIE to false

My Portainer runs under this https://192.168.1.235:9443/ but it is not secure I am not sure why it set up that way I followed a tutorial on that.

N8N though I can add the variable and turn off secure cookie but I am not sure I want to?? If I go localhost I get an error connection refused.

Eventually I want to run this in aws or digital ocean and so I am using this as my POC so I want to learn how to make my setup the right way.
Appreciate any help you can give here.

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi,

Either you need to set this env variable
N8N_SECURE_COOKIE to false
To instruct you want to continue without HTTPS

Or you need to configure TLS / HTTPS to be secure

Well it all depends, if it’s not public on the internet and just for small things. Ignore it. Mostly it’s for session hijacking and impersonating you.

If the goal is to have a system online to be public or whatever you need it to be secure do Https

You could also put it behind a reverse proxy.

Regards,
J.

Thanks so right now this is just running locally on my home network to run automations for me and so I can learn n8n.
I set the variable and it seems I can get in. does this setting only make the connection from my local browser to n8n not secure? What about connections from nodes to like gmail or trello etc.? will those be encrypted or am I opening up to risk?

1 Like

Hi,

As long as the remote system is running a secure protocol it’s all good. The only other incoming for you might be webhooks, but still this has to be tunneled anyways to get to you.

And tbh don’t sweet it you can always add something if needed

Reg,
J.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.