N8N on intranet

I am currently deploying a self-hosted n8n instance for my company’s Intranet. The requirements are simple: Internal access only and No Reverse Proxy (Nginx). We plan to connect directly via the internal domain/IP.

Since there is no proxy handling port 80/443, I have configured the WEBHOOK_URL to explicitly point to port 5678.


version: ‘3.8’

volumes:
db_storage:
n8n_storage:

services:
postgres:
image: postgres:16
container_name: n8n_postgres
restart: always
environment:

  • POSTGRES_USER=${POSTGRES_USER}
  • POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
  • POSTGRES_DB=${POSTGRES_DB}
    volumes:
  • db_storage:/var/lib/postgresql/data
    healthcheck:
    test: [‘CMD-SHELL’, ‘pg_isready -h localhost -U ${POSTGRES_USER} -d ${POSTGRES_DB}’]
    interval: 5s
    timeout: 5s
    retries: 5

n8n:
image: docker.n8n.io/n8nio/n8n
container_name: n8n_app
restart: always
depends_on:
postgres:
condition: service_healthy
environment:

  • DB_TYPE=postgresdb
  • DB_POSTGRESDB_HOST=postgres
  • DB_POSTGRESDB_PORT=5432
  • DB_POSTGRESDB_DATABASE=${POSTGRES_DB}
  • DB_POSTGRESDB_USER=${POSTGRES_USER}
  • DB_POSTGRESDB_PASSWORD=${POSTGRES_PASSWORD}
  • N8N_ENCRYPTION_KEY=${N8N_ENCRYPTION_KEY}
  • N8N_HOST=${DOMAIN_NAME}
  • N8N_PROTOCOL=http
  • WEBHOOK_URL=http://${DOMAIN_NAME}:5678/
  • N8N_EDITOR_BASE_URL=http://${DOMAIN_NAME}:5678/
  • GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
  • TZ=${TZ}
    ports:
  • “5678:5678”
    volumes:
  • n8n_storage:/home/node/.n8n
    command: /bin/sh -c “n8n start”

This setup should work fine for an intranet-only deployment.If you’re not using a reverse proxy, just make sure WEBHOOK_URL and N8N_EDITOR_BASE_URLboth point to the internal domain/IP with port 5678, exactly as you have it.As long as everything accessing n8n is on the same network, no proxy is required.

2 Likes

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