Hi everyone,
I recently set up n8n on an Ubuntu server and configured it to run as a systemd service. The instance is reachable via my custom domain (e.g. https://n8n-roasted.kaffie.co), but when I open the page, I keep seeing a “Connection lost” message at the top. The UI loads, but it seems like the frontend can’t maintain a stable connection with the backend.
What I’ve done so far:
- I created a systemd service at /etc/systemd/system/n8n.service with the following content:
[Unit]
Description=n8n service
After=network-online.target
Wants=network-online.target
[Service]
WorkingDirectory=/home/n8n
Environment="N8N_HOST=0.0.0.0"
Environment="N8N_PORT=5678"
Environment="N8N_EDITOR_BASE_URL=https://n8n-roasted.kaffie.co"
Environment="N8N_WEBHOOK_URL=https://n8n-roasted.kaffie.co"
Environment="N8N_SECURE_COOKIE=true"
Environment="N8N_RUNNERS_ENABLED=false"
Environment="N8N_PROTOCOL=https"
ExecStart=/usr/bin/env n8n start
Restart=always
RestartSec=10
Type=simple
TimeoutStopSec=30
[Install]
WantedBy=multi-user.target
- I ran systemctl daemon-reload, systemctl enable n8n, and started the service.
- In the browser, the n8n UI loads fine at https://n8n-roasted.kaffie.co, but the “Connection lost” warning stays visible at the top.
- Logs show n8n ready on 0.0.0.0, port 5678, so the backend seems to be running without crashing.
What I see in logs:
No fatal errors, just some warnings about file permissions and deprecated environment variables. But nothing that clearly points to this frontend connection issue.
My questions:
- Are there any additional environment variables needed to fix this issue (like for websockets or proxies)?
- Could this be caused by setting N8N_SECURE_COOKIE=true without using a reverse proxy with HTTPS properly configured?
- What’s the best way to resolve the “Connection lost” issue and ensure proper communication between the frontend and backend?
Thanks in advance for any help or suggestions!