Working with N8N in an offline environment

Hello !

I’m using N8N with Docker in a environment without internet access.
I recently updated N8N from 0.160.0 to 0.209.0. My issue is that now, N8N tries to reach these URL :

Is there a way to tell N8N not to try to reach internet ?

Regards,

Hi @gaglimax, welcome to the community :tada:

n8n should run fine without being able to reach these URLs.

You can verify this by setting network to none when running n8n, for example through docker run -it --rm --name n8n -p 5678:5678 --network none n8nio/n8n:0.209.3.

You might get a few complaints about n8n trying to fetch update information, templates, load telemetry scripts and send telemetry data, but these should be fine to ignore. If you want to prevent n8n from even attempting this you would need to configure the relevant environment variables accordingly. A full list of all variables is used by n8n is available at Environment variables reference - n8n Documentation.

I believe the relevant ones here are N8N_DIAGNOSTICS_ENABLED=false, N8N_VERSION_NOTIFICATIONS_ENABLED=false and N8N_TEMPLATES_ENABLED=false, but you do want to check the aforementioned reference to be sure.

1 Like

Hi @MutedJam !

Thanks for the quick reply.
Indeed, N8N works without internet access. With the environment variables you provided, N8N is not trying to reach most of the URL.
But it’s still trying to reach “public.n8n.cloud”. The requests is sending at each reload of the web page.
The probleme is that the website is not loading anything before the request to “public.n8n.cloud” ends. In my configuration, it takes around 20s so I cannot do anything before that :

Hm, that sounds bad and afaik this telemetry stuff should not behave like this (though I think we did have problems around this in the past).

That said, I do self-host n8n, have the aforementioned environment variables set and am not seeing such requests made by the UI. All requests are made against my own server URL:

Is there a chance these requests might have been caused by a cached version of some n8n files your browser might still have stored somewhere? Are you also seeing this behaviour when using the incognito/private mode of your browser?

Hi @gaglimax, I just had a quick chat with @jan about this one and there might be three more environment variables to set here. On my own instance I also have N8N_DIAGNOSTICS_CONFIG_FRONTEND, N8N_DIAGNOSTICS_CONFIG_BACKEND and EXTERNAL_FRONTEND_HOOKS_URLS set. Could you try setting these to empty values? The latter uses a default value which seems to cause the public.n8n.cloud request here.

Please do let me know if you still see any unexpected requests afterwards.

1 Like

I tried to set those environment variables empty and to navigate in private mode but the request remains there.
Here are my environment variables :

DB_TYPE: postgresdb
DB_POSTGRESDB_HOST: postgres
DB_POSTGRESDB_PORT: 5432
DB_POSTGRESDB_DATABASE: n8n
DB_POSTGRESDB_USER: n8n
DB_POSTGRESDB_PASSWORD: "xxxxxxx"
N8N_USER_MANAGEMENT_DISABLED: "True"
N8N_EDITOR_BASE_URL: "https://qualif-n8n.xxxx.fr/"
WEBHOOK_TUNNEL_URL: "https://qualif-n8n.xxxx.fr/"
N8N_TEMPLATES_ENABLED: "False"
N8N_PROTOCOL: "https"
N8N_SSL_KEY: "/home/node/.n8n/certs/server.key"
N8N_SSL_CERT: "/home/node/.n8n/certs/server.pem"
N8N_PERSONALIZATION_ENABLED: "False"
N8N_VERSION_NOTIFICATIONS_ENABLED: "False"
N8N_DIAGNOSTICS_ENABLED: "False"
N8N_DIAGNOSTICS_CONFIG_FRONTEND:
N8N_DIAGNOSTICS_CONFIG_BACKEND:
EXTERNAL_FRONTEND_HOOKS_URLS:
N8N_HIDE_USAGE_PAGE: "True"

So based on the information provided I tried reproducing this problem by running docker run -it --rm --name n8n -p 5678:5678 -e N8N_USER_MANAGEMENT_DISABLED=True -e N8N_TEMPLATES_ENABLED=False -e N8N_PERSONALIZATION_ENABLED=False -e N8N_VERSION_NOTIFICATIONS_ENABLED=False -e N8N_DIAGNOSTICS_ENABLED=False -e N8N_DIAGNOSTICS_CONFIG_FRONTEND= -e N8N_DIAGNOSTICS_CONFIG_BACKEND= -e EXTERNAL_FRONTEND_HOOKS_URLS= n8nio/n8n:0.209.3 (creating a fresh docker container not using any existing volume with data on it).

I’ve then opened the frontend via http://localhost:5678 in a new incognito browser window to avoid using any cached data, but no requests were sent to public.n8n.cloud.

Is there a chance your environment variables have not been applied? What happens if you use follow the above steps on your local machine, do you still observe any traffic to this URL when using the docker run command provided and using a fresh incognito window?

1 Like

Ok the problem was in those lines.
In compose file, if you want to set an empty environment variable, the two syntaxes are :

VARIABLE=

Or :

VARIABLE: ""

The following will not set the variable :

VARIABLE:

Thank you for your help ! :grinning:

1 Like

Excellent, I am glad to hear this worked! Sorry for the initial confusion around this :slight_smile:

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