Help: 404 Page Not Found on clean n8n + Postgres + Traefik install (Docker Compose)

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):

  1. VPS: Hostinger (Debian 12), IP: 31.220.62.169
  2. DNS (A Record): n8n.wisemindia.cloud is correctly pointed to 31.220.62.169.
  3. External Firewall (Hostinger): Ports 80/tcp and 443/tcp are open and active.
  4. Internal Firewall (ufw): ufw is installed, and ufw allow 22, ufw allow 80, ufw allow 443 are active.
  5. Docker and Docker Compose: They are installed and working.
    The Problem (The “Blocker”):
  6. I created the following docker-compose.yml file (using the cat > ... << EOF method because nano was failing).
  7. I ran docker compose up -d.
  8. docker ps shows me that all 3 containers (traefik, postgres, n8n) are running (“Up”).
  9. But when I try to access https://n8n.wisemindia.cloud (or http://), the browser gives me a 404 page not found error.
    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 my docker-compose.yml and tell me what is wrong? “I don’t want to make any more attempts” until I know what it is.
    My docker-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

I can see you’re getting a 404 error with your Traefik + n8n setup. The most common cause is incorrect Traefik labels or network configuration in your docker-compose.yml file.

Since your message got cut off, could you share your complete docker-compose.yml file? I’ll need to see the Traefik labels on your n8n service and the network configuration to identify the issue.

In the meantime, check these common issues:

• Ensure n8n and Traefik are on the same Docker network

• Verify the Traefik router rule matches your domain exactly

• Make sure the service port in Traefik labels points to n8n’s port 5678

• Check if Traefik dashboard is accessible to confirm Traefik itself is working