Infrastructure case

Self-hosted n8n Deployment with Docker, Cloudflare, and PostgreSQL

A private automation server setup for real workflows: domain, Cloudflare proxy, VPS, Docker, n8n, PostgreSQL, HTTPS, and basic hardening.

This setup gives n8n a private place to run real automations: a domain behind Cloudflare, a VPS running Docker, PostgreSQL for workflow data, HTTPS for the editor, and backups to Google Drive. It is the infrastructure layer behind form workflows, chatbots, API jobs, and internal tools.

Domain to Cloudflare to VPS to Docker to n8n.

Public traffic, containers, workflow logic, and storage are separated into clear layers so the automation workspace is easier to inspect, restart, and maintain.

Public layer Domain, Cloudflare proxy, HTTPS
Runtime VPS at about $7/mo, around PHP 430
Workflow layer 30+ workflows in the workspace

Why this setup

A default n8n install can be useful for testing, but a real automation workspace needs a little more structure. The goal here was to make the server usable for private workflows, webhooks, form automations, API jobs, and internal bots while keeping the public surface understandable.

Cloudflare sits in front of the domain, HTTPS is enforced in the browser, Docker keeps services isolated and restartable, and PostgreSQL gives n8n a proper database layer instead of treating the server as a disposable demo.

This setup runs on a VPS that costs about $7 per month, roughly PHP 430, which is enough for a focused workspace with dozens of small workflows.

Proof screenshots

Cloudflare DNS records with proxied status enabled for FloxoLab domains and sensitive IP content hidden
Cloudflare DNS proxy is enabled so the public entry point is not a raw VPS port. IP values are hidden.
Docker ps output showing n8n and PostgreSQL containers running with healthy status and multi-day uptime
n8n and PostgreSQL run as Docker services with multi-day uptime. PostgreSQL was added later, so its uptime can be newer than other services.
n8n dashboard with multiple real workflow rows visible in a private automation workspace
A private n8n workspace with 30+ workflows across drafts, prototypes, and live automations.
Browser security panel showing a secure HTTPS connection for the n8n domain with the admin path hidden
HTTPS is active for the n8n domain. The admin path is hidden in the screenshot.

What was configured

Domain and proxy

Cloudflare DNS and proxy are used in front of the VPS, with sensitive origin details hidden from public screenshots.

Docker runtime

n8n and supporting services run as containers so the stack can be restarted, inspected, and extended without mixing every service directly into the host.

PostgreSQL

PostgreSQL was added as the database layer for n8n. The container is newer because it was introduced as a setup refinement.

HTTPS

The workflow UI loads over HTTPS, so operators are not using the admin surface over plain HTTP.

Basic hardening

The intended shape is small-business practical hardening: Cloudflare in front, HTTPS enforced, firewall rules for required access, and backups rather than an open default install.

This is not described as enterprise infrastructure. It is a practical self-hosted automation foundation for small workflows and internal tools, with the sensitive details removed from public screenshots.

Good fits

Owner-run operations

A small business that wants leads, forms, email drafts, and internal alerts running from one private n8n workspace instead of scattered one-off tools.

VA and service teams

A VA agency or ops team running several client intake workflows from one server, with separate workflows for forms, CRM updates, reports, and review queues.

Webhook-heavy tools

Teams that need stable public endpoints for website forms, chatbots, payment events, WooCommerce actions, Airtable updates, or Google Workspace jobs.

Zapier-style migration

Teams moving recurring automations into a private workflow engine where the logic is visible, documented, and easier to inspect before scaling further.

Backup and maintenance layer

The server and n8n setup already have backups going to Google Drive. That matters because a self-hosted automation server is not only about getting n8n online. It also needs a way to recover workflows, credentials, and service data if an update, server issue, or configuration mistake breaks something.

The maintenance plan is simple: keep restore steps, update notes, and basic monitoring close to the deployment so the setup is easier to maintain over time.

Need a private n8n setup?

If you already have a VPS and need n8n configured properly, this can start as one focused setup session: domain, Cloudflare, Docker, HTTPS, PostgreSQL, backups, and handover notes. If you do not have a server yet, I can map the smallest useful setup before anything is installed.

Get a setup map