I’m running two Ubuntu computers on my network.
From my KDE desktop, I can ping the n8n ubuntu server for minutes / hours and I’ve got 0% package loss.
However, on my n8n UI it’s switching from “connection lost” to all fine every second or so.
On off on off on off etc.
No firewall between the two local computers / on the LAN.
The docker logs are quite empty:
sudo docker logs n8n-n8n-1 --tail=100 -f
[sudo] password for secuuser:
Initializing n8n process
n8n ready on ::, port 5678
n8n Task Broker ready on 127.0.0.1, port 5679
Failed to start Python task runner in internal mode. because Python 3 is missing from this system. Launching a Python runner in internal mode is intended only for debugging and is not recommended for production. Users are encouraged to deploy in external mode. See: https://docs.n8n.io/hosting/configuration/task-runners/#setting-up-external-mode
[license SDK] Skipping renewal on init: license cert is not initialized
Attempting to reinstall missing packages
Registered runner "JS Task Runner" (H4-RR1QbrEf9KjLO0WJBf)
Community package installed: n8n-nodes-scriberr
Community package installed: n8n-nodes-imap
Packages reinstalled successfully. Resuming regular initialization.
Version: 2.16.1
Building workflow dependency index...
Finished building workflow dependency index. Processed 0 draft workflows, 0 published workflows.
Start Active Workflows:
Activated workflow "Webhook Test" (ID: YJUGA56kNoUSQ0Zn)
Editor is now accessible via:
http://hpserver.local:5678
(node:7) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
A “Connection Lost” error in a self-hosted n8n environment usually indicates that the browser can no longer reach the backend, often due to WebSocket or networking configuration issues.
Immediate Troubleshooting
-Websocket Support: If using a reverse proxy (like Nginx Proxy Manager, Traefik, or Caddy), you must enable “Websocket Support” in your proxy settings to allow real-time communication between the UI and backend.
-Browser Isolation: Open n8n in an incognito/private window to rule out browser extensions (especially ad-blockers) that might be blocking WebSocket connections.
-Container Status: Use docker ps to ensure your n8n container hasn’t crashed silently.
Environment Configuration
Verify these critical environment variables in your docker-compose.yml or docker run command:
-Push Backend: Explicitly set N8N_PUSH_BACKEND=websocket. Some versions default to sse, which can cause issues behind certain proxies.
-Host and Protocol: Ensure N8N_HOST and N8N_PROTOCOL are correctly set to your local IP/domain and access method (e.g., http or https).
-Trust Proxy: If you are using a reverse proxy, set N8N_TRUST_PROXY=true so n8n correctly identifies the connection origin.
Network & Firewall
Port Binding: Confirm you are binding to 0.0.0.0:5678 rather than just 127.0.0.1:5678, otherwise the service will only be accessible from the host machine.
Local Firewall: Temporarily disable your local firewall (e.g., Windows Firewall or ufw on Linux) to see if it is blocking incoming traffic on port 5678.
Cloudflare Tunnels: If using a tunnel, ensure “Websocket Support” is enabled in the Cloudflare Dashboard and that you are not stripping “Origin” headers.
@Chris7935 are you accessing the UI by IP or hostname? if by hostname, DNS resolution hiccups on KDE can cause the websocket to drop even when ICMP ping is fine — try hitting it by raw IP like http://192.168.x.x:5678 and see if the flickering stops