---
title: "Discussion on \"How to Self-Host n8n with Docker Compose and Nginx (2026)\" | Hashnode"
description: "Discussion on \"How to Self-Host n8n with Docker Compose and Nginx (2026)\". Self-host n8n with Docker Compose and Nginx on a VPS. Covers WebSocket and webhook proxy settings, free SSL, backups, updates and common errors."
url: "https://hashnode.com/posts/how-to-self-host-n8n-with-docker-compose-and-nginx-2026/6ac6505d6624f0aa42a8061c"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to Self-Host n8n with Docker Compose and Nginx (2026)](https://kwikserver.hashnode.dev/how-to-self-host-n8n-with-docker-compose-and-nginx-2026?utm_source=hashnode&utm_medium=feed)

Self-host n8n with Docker Compose and Nginx on a VPS. Covers WebSocket and webhook proxy settings, free SSL, backups, updates and common errors.

Oct 7 · 11 min read · kwikserver.hashnode.dev  
Read the article

-   [#n8n](https://hashnode.com/tag/n8n)
-   [#docker](https://hashnode.com/tag/docker)
-   [#nginx](https://hashnode.com/tag/nginx)
-   [#self-hosted](https://hashnode.com/tag/self-hosted)
-   [#n8n-workflows](https://hashnode.com/tag/n8n-workflows)

## Written by

[Kwik Server](https://hashnode.com/@kwikserver)

@kwikserver · Chennai, India

  
[View profile](https://hashnode.com/@kwikserver)

## Responses 1

Markdown supported · ⌘↵ to post

[Node Edge Ops](https://hashnode.com/@nodeedgeops)

[Nov 4](https://hashnode.com/posts/how-to-self-host-n8n-with-docker-compose-and-nginx-2026/6ac6505d6624f0aa42a8061c/comment/6aebc12195bbdafcf61a007f)

Binding the app to localhost and putting nginx in front is the right shape for a single-host Compose stack — just make sure the proxy and the container share a path that actually reaches that listen address (same host network namespace, or a published internal port on a user-defined bridge with proxy\_pass by service name). n8n’s editor and webhook traffic need WebSocket Upgrade headers and a Connection upgrade on that location; do not reuse the “clear Connection for keepalive” pattern from a plain REST upstream on the same block or the UI drops mid-session.

Raise proxy\_read\_timeout and proxy\_send\_timeout above the longest workflow or webhook you expect, and terminate TLS at nginx with the usual Host / X-Forwarded-For / X-Forwarded-Proto headers so the app builds public URLs correctly. After compose up or a cert reload I hit a cheap health path from the nginx side to the upstream name first, then through the public vhost, and watch error\_log for connect() failed versus upstream timed out — that tells you whether to fix reachability or just the timeout budget.
