Title: Help: 404 Page Not Found on clean n8n + Postgres + Traefik install (Docker Compose)
Body:
Hi community. I’m stuck on an n8n self-hosted installation on a VPS and I’m getting a 404 page not found error.
I’ve tried everything and I’m in a loop. “I’m fed up.” I’m asking for your help to tell me what I’m doing wrong.
My Setup (What IS working):
- VPS: Hostinger (Debian 12), IP:
31.220.62.169 - DNS (A Record):
n8n.wisemindia.cloudis correctly pointed to31.220.62.169. - External Firewall (Hostinger): Ports
80/tcpand443/tcpare open and active. - Internal Firewall (ufw):
ufwis installed, andufw allow 22,ufw allow 80,ufw allow 443are active. - Docker and Docker Compose: They are installed and working.
The Problem (The “Blocker”): - I created the following
docker-compose.ymlfile (using thecat > ... << EOFmethod becausenanowas failing). - I ran
docker compose up -d. docker psshows me that all 3 containers (traefik,postgres,n8n) are running (“Up”).- But when I try to access
https://n8n.wisemindia.cloud(orhttp://), the browser gives me a404 page not founderror.
My hypothesis is that Traefik (the router) is not connecting correctly to the n8n container, and that’s why it’s giving me the 404.
Can you please review mydocker-compose.ymland tell me what is wrong? “I don’t want to make any more attempts” until I know what it is.
Mydocker-compose.yml:
version: '3.8'
services:
traefik:
image: traefik:v2.9
restart: always
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.myresolver.acme.tlschallenge=true"
- "--certificatesresolvers.myresolver.acme.email=wisemind.ia.tech@gmail.com"
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- traefik_letsencrypt:/letsencrypt
networks:
- d-network
postgres:
image: postgres:15
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=************
- POSTGRES_DB=n8n
volumes:
- postgres_data:/var/lib/postgresql/data
expose:
- "5432"
networks:
- d-network
n8n:
image: n8nio/n8n:stable
restart: always
environment:
- DB_TYPE=postgres
- DB_POSTGRESDB_HOST=postgres
- DB_POSTGRESDB_USER=postgres
- DB_POSTGRESDB_PASSWORD=************
- DB_POSTGRESDB_DATABASE=n8n
- EXECUTIONS_PROCESS=main
- N8N_SECURE_COOKIE=true
- WEBHOOK_URL=httpsD://n8n.wisemindia.cloud/
expose:
- "5678"
links:
- postgres
volumes:
- n8n_data:/home/node/.n8n
depends_on:
- postgres
- traefik
labels:
- "traefik.enable=true"
- "traefik.http.routers.n8n.rule=Host(`n8n.wisemindia.cloud`)"
- "traefik.http.routers.n8n.entrypoints=websecure"
- "traefik.http.routers.n8n.tls.certresolver=myresolver"
- "traefik.http.services.n8n.loadbalancer.server.port=5678"
- "traefik.docker.network=d-network"
networks:
- d-network
volumes:
postgres_data:
n8n_data:
traefik_letsencrypt:
networks:
d-network:
driver: bridge