Issue with self-hosted n8n on Hostinger. Intermittent "Lost Connection to the Server" and ERR_SSL_PROTOCOL_ERROR after that

I have n8n self hosted on Hostinger via one click setup where I have two containers (n8n and traefik)

Problem:

There two issues happen in my case, not sure if they are related but always happen in sequence

  1. “Lost Connection to the Server”

  1. ERR_SSL_PROTOCOL_ERROR

Sometime after some time I have the first issue, it also stop showing the UI on hosted link and show error “ERR_SSL_PROTOCOL_ERROR“.

After few hours it automatically continue working properly.

It is annoying that it get the issue and resolved itself in few hours. I don’t know what thing is actually solving it or causing this issue.

Here is my Docker Compose configuration

version: "3.7"

services:
  traefik:
    image: "traefik"
    restart: always
    command:
      - "--api=true"
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.web.http.redirections.entryPoint.to=websecure"
      - "--entrypoints.web.http.redirections.entrypoint.scheme=https"
      - "--entrypoints.websecure.address=:443"
      - "--certificatesresolvers.mytlschallenge.acme.tlschallenge=true"
      - "--certificatesresolvers.mytlschallenge.acme.email=${SSL_EMAIL}"
      - "--certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json"
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - traefik_data:/letsencrypt
      - /var/run/docker.sock:/var/run/docker.sock:ro

  n8n:
    image: docker.n8n.io/n8nio/n8n
    restart: always
    ports:
      - "127.0.0.1:5678:5678"
    labels:
      - traefik.enable=true
      - traefik.http.routers.n8n.rule=Host(`${SUBDOMAIN}.${DOMAIN_NAME}`)
      - traefik.http.routers.n8n.tls=true
      - traefik.http.routers.n8n.entrypoints=websecure
      - traefik.http.routers.n8n.tls.certresolver=mytlschallenge
      - traefik.http.middlewares.n8n.headers.SSLRedirect=true
      - traefik.http.middlewares.n8n.headers.STSSeconds=315360000
      - traefik.http.middlewares.n8n.headers.browserXSSFilter=true
      - traefik.http.middlewares.n8n.headers.contentTypeNosniff=true
      - traefik.http.middlewares.n8n.headers.forceSTSHeader=true
      - traefik.http.middlewares.n8n.headers.SSLHost=${DOMAIN_NAME}
      - traefik.http.middlewares.n8n.headers.STSIncludeSubdomains=true
      - traefik.http.middlewares.n8n.headers.STSPreload=true
      - traefik.http.routers.n8n.middlewares=n8n@docker
      - traefik.http.services.n8n.loadbalancer.server.port=5678
    environment:
      - N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - NODE_ENV=production
      - WEBHOOK_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/
      - GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
      - N8N_ENCRYPTION_KEY=SOME_ACTUAL_KEY
      - NODE_FUNCTION_ALLOW_BUILTIN=crypto
    volumes:
      - n8n_data:/home/node/.n8n
      - /local-files:/files

volumes:
  traefik_data:
    external: true
  n8n_data:
    external: true

Information on your n8n setup

  • n8n version: Latest (2.16.0)
  • Traefik Version: Latest (3.6.13)
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via: Docker
  • Operating system: Ubuntu 24.04

This screams resource limits on the Hostinger VPS to me, n8n eats memory especially on SQLite adn when it OOMs traefik has nothing to route to which is why you get the SSL error after the connection drop. Run docker stats next time it happens and check if the n8n container is restarting. If it is, set NODE_OPTIONS=--max-old-space-size=256 in your environment and look into switching to postgres.

I will check it out. Thank you @anon61017519