VPS Malaysia Blog

General

How to Set Up n8n? A Step-by-Step Guide for Self-Hosted Workflow Automation

n8n lets teams self-host workflow automation with visual nodes, API connectors and full infrastructure control. For production, Docker Compose with PostgreSQL, HTTPS and a reverse proxy is the cleanest long-term path.

3D n8n-style workflow automation graph with Docker PostgreSQL reverse proxy and API nodes
400+Integrations and workflow connectors
DockerRecommended production deployment path
PostgresDurable database for long-term hosting

Self-Hosted Automation

What this guide covers.

3D n8n-style workflow automation graph with Docker PostgreSQL reverse proxy and API nodesWorkflow Engine

n8n lets teams self-host workflow automation with visual nodes, API connectors and full infrastructure control. For production, Docker Compose with PostgreSQL, HTTPS and a reverse proxy is the cleanest long-term path.

Self-hosted n8n gives more control and privacy than a fully managed automation SaaS, but you manage updates and infrastructure.

npm is fastest for testing, Docker is clean for production, and Docker Compose is best for long-term self-hosting.

Production setup should include PostgreSQL, reverse proxy, HTTPS, environment variables and process restart policies.

Redesigned Guide

Visual decision path.

Platform Choice

n8n Cloud is managed and quick. Self-hosted n8n runs on your own VPS or machine, giving control over data, limits and integrations.

Visual drag-and-drop workflowsTriggers and action nodesAPI and app integrationsSelf-hosting for privacyCloud option for managed convenience

Deployment Options

Choose the install path based on lifecycle. npm is local and fast, Docker isolates runtime, Docker Compose manages n8n plus database and proxy as a stack.

npm for local testingDocker for production container isolationDocker Compose for long-term hostingVPS for remote accessDomain name for HTTPS

Production Layer

Production n8n needs more than the app process. Use a reverse proxy, TLS certificate, stable database, environment variables and restart policy.

Nginx reverse proxyLet's Encrypt HTTPSPostgreSQL databaseN8N_HOST and webhook URL variablesPM2, Docker restart policy or systemd

First Workflow

Start with a simple trigger and one action node, test the result, then activate the workflow. Expand only after logs and credentials are clear.

Open workflow editorAdd trigger nodeConnect action nodesTest with sample dataActivate and monitor execution history

Quick Reference

n8n Deployment Table

npm

Fastest for local testing, not ideal as the final production setup.

Docker

Portable production runtime with easy updates and isolation.

Docker Compose

Best for n8n plus PostgreSQL, proxy and persistent volumes.

Database

PostgreSQL is preferred over SQLite for long-term production use.

Security

Use HTTPS, environment variables, credential hygiene and backups.

Operations

Monitor executions, use restart policies and update carefully.

A reliable n8n deployment is a small automation platform, not just one command. Containerize it, persist data, protect access and test workflows before turning them into business-critical automations.

Explore VPS Malaysia Services