An n8n instance you tried locally is not yet a production system. Webhooks need a public HTTPS address, stored credentials need a stable encryption key, and your data needs a tested backup.
This guide follows n8n's official documentation. Variable names and defaults can change between versions, so always check the documentation for the release you run.
1. The most important settings at a glance
| Setting | What it is for | What to watch |
|---|---|---|
| N8N_PROTOCOL, N8N_HOST | The protocol and host name clients use; the defaults are http and localhost. | On their own they are not enough for the public webhook address behind a reverse proxy. |
| N8N_WEBHOOK_URL | The public base address shown for webhooks and in the editor. | According to the documentation the older WEBHOOK_URL is a deprecated alias; follow the documentation for your version. |
| N8N_PROXY_HOPS | The number of reverse proxies in front of n8n; the default is 0. | Set it to 1 with one proxy; adjust it to your proxy chain. |
| N8N_ENCRYPTION_KEY | The encryption key for stored credentials. | Set your own and keep it separate from the backup. |
| GENERIC_TIMEZONE, TZ | The time zone for scheduled nodes and the container. | A wrong time zone shifts the run times of scheduled workflows. |
| N8N_SECURE_COOKIE | Limits cookies to HTTPS connections; the default is true. | Sign-in can fail over plain HTTP; the fix is HTTPS, not switching it off. |
| Databases | SQLite by default (~/.n8n/database.sqlite); PostgreSQL is available with DB_TYPE=postgresdb. | The database location belongs in your backup plan. |
2. Webhook URL and HTTPS behind a reverse proxy
n8n listens internally on port 5678 while the reverse proxy serves public traffic on port 443. By default n8n builds the webhook address from the protocol, host and port, which is wrong behind a proxy. According to the documentation, setting N8N_WEBHOOK_URL is the fix.
- Point a public subdomain (for example n8n.yourcompany.com) to the server and obtain a valid certificate on the proxy.
- Set the values below in the n8n environment, then restart the service.
- Open a Webhook node and check that the displayed test and production URLs show your public domain.
- Publish a simple test workflow and call its production URL from outside, not from the server itself.
N8N_HOST=n8n.cegneved.hu
N8N_PROTOCOL=https
N8N_WEBHOOK_URL=https://n8n.cegneved.hu/
N8N_PROXY_HOPS=1
GENERIC_TIMEZONE=Europe/Budapest
TZ=Europe/Budapest3. The encryption key
n8n stores saved credentials (for example API keys and OAuth tokens) encrypted in the database. According to the documentation it generates a random key on first start and stores it in the ~/.n8n folder; you can supply your own with the N8N_ENCRYPTION_KEY environment variable. In queue mode, set it on every worker.
- Set your own long random key before you save the first credentials.
- Record it in a password manager, in a different place from the backup files.
- Do not change it without a reason; the documentation does not detail what happens with a missing or changed key, so treat it as if stored credentials could become unusable.
4. Backup, restore and updates
- According to the documentation, --backup covers only workflows and credentials; for a full backup also consider n8n's backup guide and the database.
- Before updating, take a backup and read the release notes.
- With Docker Compose the documented order is: docker compose pull, docker compose down, then docker compose up -d.
- Test a restore monthly on a separate test server; a backup is only worth something if it restores.
| What to retain | How? | Note |
|---|---|---|
| Workflows | n8n export:workflow --backup --output=backups/latest/ | --backup is shorthand for --all --pretty --separate. |
| Credentials | n8n export:credentials --backup --output=backups/latest/ | Exports encrypted by default; --decrypted writes plain text, so use it only for migrations, in a protected place. |
| Data directory | The /home/node/.n8n volume | In Docker it must be mapped to a persistent volume; with PostgreSQL the keys and other important files still live here. |
| Restore | n8n import:workflow --separate --input=backups/latest/ | Items with the same IDs are overwritten, and imported workflows are inactive by default. |
5. Common problems and where to look first
| Symptom | Initial investigation |
|---|---|
| The webhook address shows localhost | The N8N_WEBHOOK_URL and N8N_PROXY_HOPS settings, then a restart. |
| You cannot sign in to the editor | HTTPS usage and the N8N_SECURE_COOKIE default; cookies are not applied over HTTP. |
| The production webhook does not run | Whether the workflow is published; the test URL works only while listening. |
| 403 response from the webhook | The node's IP allowlist; if filled in, requests from other addresses are rejected. |
| A large request does not arrive | The webhook payload limit is 16 MB; on a self-hosted server N8N_PAYLOAD_SIZE_MAX changes it. |
| The disk fills up | Execution data cleanup and the size of the data directory. |



