Skip to content
Deploy

Use case · Automation

Self-host n8n on a Linux VPS

Price list updated

Yes — you can self-host n8n on a Linux VPS by running it with Docker Compose next to its own PostgreSQL database, so every workflow, credential and execution log stays on a server you control. n8n is CPU-only: it orchestrates your automations and calls hosted AI models with your own API key, so no GPU is involved. You get full root access over SSH to run it as a long-lived service on AMD Ryzen cores.

  • Linux over SSH, full root access
  • Docker Compose or Node.js and npm
  • CPU-only — no GPU needed

What you can run with self-hosted n8n

Workflow automation

Connect apps and APIs with webhook, schedule and HTTP nodes, and move data between services on a server you own.

AI agents and chains

n8n's AI nodes call hosted models through your own OpenAI or Anthropic key; the server runs the agent, the model runs remotely.

Custom code steps

Run JavaScript or Python inside a workflow for the logic the built-in nodes do not cover.

Is a VPS the right place to self-host n8n?

Self-hosted n8n fit
TaskGood fit?Why
Running your own automations and AI agents privatelyYesWorkflows, credentials and logs stay on a server you control
Calling hosted AI models (OpenAI, Anthropic) from workflowsYesn8n sends API requests with your key; the work is CPU-only, no GPU
Running a large language model on the server itselfLimitedOnly a small quantized model through Ollama runs on CPU, and slowly
Training models or generating images on the serverNoThese need GPU hardware, which a VPS does not include

Why self-host n8n instead of the hosted cloud

n8n's Community Edition is free to self-host under its Sustainable Use License, so you pay only for the server it runs on. Self-hosting keeps your workflows, API keys and execution history on your own machine rather than a third party's, and one Linux VPS can run n8n, its PostgreSQL database and a reverse proxy together. When your automations grow busier, you move up a tier instead of changing providers. Review the n8n license for commercial and embedding terms before you build on it.

How to self-host n8n with Docker Compose

The reliable path on Linux is Docker Compose with n8n and PostgreSQL as two containers behind a reverse proxy for TLS (the same container stack as general Docker hosting):

  1. Install Docker and the Compose plugin on Ubuntu, Debian or AlmaLinux with the distribution's package manager (for example apt install docker.io docker-compose-plugin).
  2. Define two services in one docker-compose.yml: the n8nio/n8n image and a postgres image, each with a named volume so your data survives restarts and image updates.
  3. Point n8n at PostgreSQL with DB_TYPE=postgresdb and the database host, name and credentials, so workflows and execution history are stored in Postgres instead of the default SQLite file.
  4. Add a reverse proxy such as Caddy, Nginx or Traefik in front for HTTPS on your own domain, and set N8N_HOST and WEBHOOK_URL to that domain so webhooks resolve correctly.
  5. Start it with docker compose up -d. Docker's own service is enabled under systemd, so the stack comes back on its own after a reboot.

Keep the Compose file and its environment variables under version control without the secrets, and schedule a regular backup of the Postgres volume.

n8n server requirements: CPU, RAM and disk

n8n's documentation sets no minimum CPU or RAM: memory use grows with the data your workflows move, and n8n's own single-instance benchmark ran on a cloud instance with 4 GB of RAM and a PostgreSQL database. So size by setup, from the lightest to queue mode:

Self-hosted n8n setups and the plan to start with
n8n setupWhat runs on the serverPlan to start with
One instance with SQLite, n8n's default databasen8n only; the database is a file on diskT1: 2 vCPU, 2 GB RAM and 40 GB Gen4 NVMe SSD
One instance with PostgreSQL and a reverse proxyn8n, PostgreSQL and Caddy, Nginx or Traefik for HTTPST2: 4 vCPU, 4 GB RAM and 80 GB Gen4 NVMe SSD, the RAM of n8n's benchmark machine
Queue modeThe main n8n instance, Redis, one or more n8n worker processes and PostgreSQLT3: 6 vCPU, 8 GB RAM and 160 GB Gen4 NVMe SSD, or a larger plan for more workers
Workflows that move large files or many itemsWhatever the workflows hold in memory at onceAdd RAM: n8n's fix for out-of-memory errors is more memory or smaller batches

Every plan has Gen4 NVMe SSD storage, from 40 GB on T1, which keeps the database and execution history quick to read and write. vCPU stops at 6 from T3; above it, a plan adds RAM and storage.

Queue mode: Redis and n8n workers

Queue mode is how n8n scales past one process. The main n8n instance receives triggers and webhooks and hands each execution to Redis, which keeps the queue; worker processes pick executions up, run them and report back. All of it can run on one server, or the workers on servers of their own.

  1. Use PostgreSQL. n8n's documentation says running queue mode with SQLite isn't recommended.
  2. Run Redis next to n8n, for example as one more service in the same docker-compose.yml. It listens on port 6379 with no password by default, so keep that port closed to the internet and set a password with QUEUE_BULL_REDIS_PASSWORD if anything outside the server connects to it.
  3. Set EXECUTIONS_MODE=queue on the main instance and on every worker, and point them at Redis with QUEUE_BULL_REDIS_HOST and QUEUE_BULL_REDIS_PORT.
  4. Start workers with n8n worker (or the n8nio/n8n image with the worker command); each one runs several executions at once, set with --concurrency.
  5. Share the N8N_ENCRYPTION_KEY of the main instance with every worker, or the workers cannot read the credentials stored in the database.

Start without queue mode: one instance with PostgreSQL handles everyday automations, and you can switch to queue mode later on the same server.

Back up your N8N_ENCRYPTION_KEY

n8n encrypts the credentials you save with a key read from the N8N_ENCRYPTION_KEY environment variable. If that key is lost, the stored credentials can no longer be decrypted and have to be entered again. Set it explicitly yourself, keep a copy somewhere safe off the server, and back up the PostgreSQL database alongside it.

Keep the n8n editor off the public internet

Turn on n8n's owner account so the editor needs a sign-in, and where you can, reach the editor only over a VPN or from known IP addresses instead of exposing it to the whole internet. Publish only the webhook URLs that outside services genuinely need to reach. Each plan comes with a dedicated IPv4 address, so you can point your own domain at the server and terminate TLS at the reverse proxy. Automations must follow the terms and rate limits of the services and APIs they call; see the acceptable use policy.

Which n8n hosting plan to choose

Shown in Dallas. T1 (2 vCPU, 2 GB RAM and 40 GB Gen4 NVMe SSD) runs a single n8n instance for light or occasional workflows; T2 (4 vCPU, 4 GB RAM and 80 GB Gen4 NVMe SSD) is the comfortable starting point for n8n plus its PostgreSQL database and everyday automations; T3 (6 vCPU, 8 GB RAM and 160 GB Gen4 NVMe SSD) adds RAM for busier instances, more concurrent executions, or queue mode with separate worker processes.

T1 · Dallas

AMD Ryzen

$8.99/mo

Billed yearly · $107.93 first year, then $179.88/yr

  • 2 shared vCPU
  • 2 GB DDR5 RAM
  • 40 GB Gen4 NVMe SSD
  • 1 Gbps port · 1 IPv4
Deploy T1
n8n plus its database

T2 · Dallas

AMD Ryzen

$14.99/mo

Billed yearly · $179.93 first year, then $299.88/yr

  • 4 shared vCPU
  • 4 GB DDR5 RAM
  • 80 GB Gen4 NVMe SSD
  • 1 Gbps port · 1 IPv4
Deploy T2

T3 · Dallas

AMD Ryzen

$23.99/mo

Billed yearly · $287.93 first year, then $479.88/yr

  • 6 shared vCPU
  • 8 GB DDR5 RAM
  • 160 GB Gen4 NVMe SSD
  • 1 Gbps port · 1 IPv4
Deploy T3

Monthly plans renew at the same price, and there is no setup fee. Prices and specs from our live catalog, last updated .

Running AI agents and model APIs from n8n

n8n's AI and HTTP nodes send prompts to hosted models such as OpenAI and Anthropic using your own API key. The model runs on the provider's side and returns a response, so the heavy computation never touches your server: a CPU-only VPS is all n8n needs to orchestrate an agent, chain steps together and store the results. No GPU is involved.

If you want a model on the server itself, only a small quantized model through Ollama will run on the CPU, and it will be slow — useful for testing, not for production throughput. Training models and generating images need GPU hardware, which a VPS does not have.

Running agents this way is part of our wider AI VPS range: if you want a server set up specifically for the job, AI agent hosting covers long-running agents, and MCP server hosting covers the tool servers an agent reaches over the Model Context Protocol.

Can I run n8n on Windows instead?

Yes. n8n also runs on Windows Server through Node.js and npm, started as a service the same way a bot is — see bot hosting for the Windows service setup. Docker Desktop on Windows needs nested virtualization, which is not part of our plan specification, so on Windows the Node.js install is the dependable route. For a clean container stack, use the Linux-first path above: Ubuntu, Debian or AlmaLinux reached over SSH as root.

Sources

n8n's own documentation, read on 14 November 2026:

  1. Enable queue mode (Redis, workers, EXECUTIONS_MODE, the shared encryption key, SQLite in queue mode)
  2. Choose n8n's database (SQLite by default, PostgreSQL with DB_TYPE=postgresdb)
  3. Measure performance (the single-instance benchmark on 4 GB of RAM)
  4. Fix memory issues
  5. Install with Docker

n8n and automation guides

All RDP guides and tutorials

n8n hosting FAQ

Do I need a GPU to run n8n or an AI agent?

No. n8n is CPU-only. It orchestrates workflows and calls hosted AI models (OpenAI, Anthropic and others) through your own API key, so the model runs on the provider's side. A VPS has no GPU, and n8n does not need one.

Can I self-host n8n with Docker Compose?

Yes. Install Docker and the Compose plugin, then run n8n and a PostgreSQL database as two services in one docker-compose.yml with named volumes. Put a reverse proxy in front for TLS and start it with docker compose up -d.

How much RAM does n8n need?

n8n itself is light — a few hundred megabytes at idle. With PostgreSQL and a reverse proxy, about 4 GB is comfortable. T2 (4 vCPU, 4 GB RAM and 80 GB Gen4 NVMe SSD) is a good starting point; busier instances or queue mode want T3 (6 vCPU, 8 GB RAM and 160 GB Gen4 NVMe SSD).

What are the server requirements to self-host n8n?

n8n's documentation sets no minimum CPU or RAM; memory use grows with the data your workflows move, and n8n's own single-instance benchmark ran on a cloud instance with 4 GB of RAM and PostgreSQL. A Linux server with Docker and the Compose plugin is the usual setup: T2 (4 vCPU, 4 GB RAM and 80 GB Gen4 NVMe SSD) for n8n with PostgreSQL, T3 (6 vCPU, 8 GB RAM and 160 GB Gen4 NVMe SSD) for queue mode with Redis and workers.

Do I need Redis to self-host n8n?

Only for queue mode. One n8n instance runs without Redis. In queue mode the main instance passes each execution to Redis, worker processes pick it up, and n8n's documentation advises against SQLite for it, so use PostgreSQL. Set EXECUTIONS_MODE=queue on the main instance and every worker.

What is the N8N_ENCRYPTION_KEY and why back it up?

n8n encrypts stored credentials with it. If you lose the key you cannot decrypt saved credentials, so set it explicitly and keep a backup off the server, along with a backup of the PostgreSQL database.

Can I connect n8n to OpenAI or Anthropic?

Yes. Add your provider API key as a credential and use n8n's AI or HTTP nodes. The server sends the request and receives the response; no model runs locally, so no GPU is needed.

How do I keep the n8n editor private?

Turn on n8n's owner account so the editor needs a sign-in, and where you can reach it only over a VPN or from known IP addresses. Expose just the webhook URLs the outside world must call. A dedicated IPv4 address lets you run TLS on your own domain.

Can I self-host n8n on Windows instead of Linux?

Yes, with Node.js and npm, run as a Windows service — see bot hosting. Docker Desktop on Windows needs nested virtualization, which is not part of our plan specification, so the Linux and Docker Compose path is the one we recommend here.

Is self-hosting n8n free?

n8n's Community Edition is free to self-host under its Sustainable Use License; you pay only for the VPS it runs on, from $14.99/mo, in cryptocurrency or a credit or debit card. Check the n8n license for commercial and embedding terms.

Deploy your n8n server

A Linux VPS on AMD Ryzen for self-hosted n8n and its database, set up instantly. From $14.99/mo.