# How to Fix Your n8n server is configured to use a secure cookie (2026 Verified Ubuntu/Docker Fix)

- URL: https://nodebudget.dev/errors/n8n-secure-cookie-https-fix/
- Category: HTTPS & Caddy · Severity: High
- Author: Yuanqiang Leng (https://github.com/a895047059)
- Updated: 2026-11-26

## Exact Log Signature
`Your n8n server is configured to use a secure cookie, however you are either visiting via plain HTTP`

## Root Cause
N8N_SECURE_COOKIE=true is active while accessing n8n via raw http://IP:5678 instead of an HTTPS reverse proxy.

## Verified Fix Commands
```bash
# Put Caddy 2.8 in front on port 443 and set .env:
WEBHOOK_URL=https://n8n.yourdomain.com/
N8N_HOST=n8n.yourdomain.com
N8N_PROTOCOL=https
N8N_SECURE_COOKIE=true
```

## Permanent Production Prevention
Never disable N8N_SECURE_COOKIE in production; let Caddy auto-provision TLS.

---
Source: NodeBudget (https://nodebudget.dev/tools/error-decoder/)
