Skip to content
Deploy

Use case · Automation

Self-host n8n on a Linux VPS

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.

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

$14.99/mo

USD per month · billed for 1, 3, 6 or 12 months

  • 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

$24.99/mo

USD per month · billed for 1, 3, 6 or 12 months

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

T3 · Dallas

AMD Ryzen

$39.99/mo

USD per month · billed for 1, 3, 6 or 12 months

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

Plan prices do not go up at renewal, and there is no setup fee. Prices and specs from our live catalog, checked .

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.

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 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 within minutes. From $14.99/mo.