I’m deploying n8n with Docker Compose and would like to integrate n8n with the Organizr application. But the n8n iframe is not enabled. How do I enable the iframe for n8n?
n8n sets the X-Frame-Options: DENY HTTP header by default, which prevents its interface from loading inside an iframe. To enable this functionality, you can set the N8N_DISABLE_UI_SECURITY environment variable to true. This disables certain security headers, including X-Frame-Options, allowing n8n to load inside an iframe.
Example in docker-compose.yml:
services:
n8n:
image: n8nio/n8n
environment:
- N8N_DISABLE_UI_SECURITY=true
ports:
- "5678:5678"
This setting is documented in the security environment variables section of the official n8n documentation.
Disabling security headers can expose your n8n instance to risks such as clickjacking. To mitigate these risks:
-
Restrict access: Use firewalls or private networks to limit who can access your n8n instance.
-
Strong authentication: Ensure only authorized users can access the interface.
-
Configuration review: If you are using a reverse proxy like Nginx, verify that it is not adding headers like X-Frame-Options: DENY that could interfere with loading in iframes.
actually i cant quite see the environment variables that you mentioned in the documentation
N8N_DISABLE_UI_SECURITY, that variable does not exist on the documentation you shared, or i might be blind
Hello. Unfortunately the variable N8N_DISABLE_UI_SECURITY=true
does not work, I tested it with the following image docker.n8n.io/n8nio/n8n
. I should point out that I do not use any reverse proxy and I did not find this variable in the documentation!
So does anyone know how to enable the Iframe in n8n?