Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The practical way to self-host n8n on an Ubuntu server is Docker Engine with Docker Compose v2. For a public instance, use a dedicated hostname and HTTPS through a reverse proxy, preserve n8n’s persistent data, and configure the external webhook URL correctly. Self-hosting also means you are responsible for server security, updates, backups, and recovery; n8n recommends its Cloud service for people without server-management experience.

What you need before installing n8n on Ubuntu

Use an Ubuntu server or a computer that can stay online, with permission to install and manage software. Install Docker Engine and the Docker Compose v2 plugin by following Docker’s Ubuntu installation instructions. n8n’s Linux deployment guide uses Docker Compose and delegates distribution-specific Docker installation to Docker’s documentation.

Check that both commands are available:

  • docker --version
  • docker compose version

The current n8n manual Compose guide specifies at least 4 GB of RAM and 2 vCPUs for the full setup it describes, which includes AI Assistant sandbox services. That figure is not a universal minimum for a simpler n8n-only installation. See n8n’s manual Docker Compose guide for the requirements and configuration applicable to its setup.

Choose a public or private deployment

If you only need to access n8n from the server or a private network, you may not need to expose it publicly. For access over the internet, plan a dedicated hostname, DNS, a firewall configuration that allows only the services you intend to expose, and HTTPS. n8n’s Compose deployment example uses Traefik as a reverse proxy for TLS and redirects HTTP to HTTPS; the n8n service itself is mapped to localhost on port 5678 behind that proxy. Follow the current official Compose example rather than exposing the application port directly without a security plan.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
GEEKOM Air12 Budget Mini PC Office,Intel 7505,8GB RAM(64GB Max),256GB SSD
  • ➊ [ Trusted Quality for Everyday Agentic AI ] GEEKOM equips its SSDs with reliable original-grade flash and conducts rigorous stability testing to support dependable everyday operation. This commitment to quality is backed by a 3-year warranty. Simply connect the Air12 to cloud AI services for research, writing, study support and daily productivity—no NPU or complex local setup required. Designed for students, home users, light office work and first-time buyers, the Air12 is a high-value Cloud Agentic PC for everyday tasks
  • ➋ [ Intel 7505 processor ] Powered by the Intel 7505 processor (2 cores, 4 threads, up to 3.5GHz), the GEEKOM Mini PC Air12 delivers smooth performance for everyday computing, office tasks, and home entertainment. With enhanced single-core processing, it handles daily workloads efficiently and responsively. Compact, quiet, and energy-efficient — a solid alternative to bulky desktops.
  • ➌ [440lbs(200kg) Pressure Rated Metal Frame for Demanding Environments] Unlike the Plastic Shells You’ll Find on Most Mini PCs, geekom Mini Air12 features a triple-reinforced ABS+PC shell, precision-crafted metal frame and baseplate—engineered to withstand up to 440 lbs of pressure for the perfect balance of strength and thermal efficiency. Tool-free upgrades, shock-absorbing feet, and a 3D antenna deliver true durability
  • ➍ [Dual-Channel RAM & NVMe SSD Expandability] Ships with 8GB DDR4 RAM and a 256GB NVMe SSD for smooth everyday performance. Dual memory slots and dual storage slots give you the flexibility to upgrade to 64GB RAM and 2TB SSD, so your system can adapt as your workload grows. Enjoy faster load times, smoother multitasking, and long-term reliability.
  • ➎ [Triple 4K Displays for Maximum Productivity] Connect up to three 4K monitors via HDMI 2.0, Mini DisplayPort 1.4, and USB-C — ideal for stock trading dashboards, multi-tab research, office document editing, and light spreadsheet work. WiFi 6 and Bluetooth with high-gain antenna ensure stable wireless connections throughout your workspace. 5x USB ports and a full-size SD card reader provide quick access to peripherals and camera files — no adapters required.

Self-hosting is not just an installation task: n8n says operators need technical competence with server and container configuration, application resources and scaling, security, and n8n configuration. Errors can cause data loss, security problems, or downtime. If you do not want to take on that responsibility, n8n recommends n8n Cloud. The hosting routes documented by n8n also include DigitalOcean, Heroku, Hetzner, AWS, Azure, Google Cloud Run, Google Kubernetes Engine, and OpenShift; they represent different architectures and levels of operational responsibility, not interchangeable one-click options. See n8n’s hosting overview.

Install n8n on Ubuntu with Docker Compose

Use n8n’s current Compose deployment example as the starting point. Its configuration includes the proxy and TLS setup as well as the n8n service. Adapt the hostname and other values to your server; avoid copying example secrets into a production deployment.

  1. Create a project directory. Keep the Compose configuration and its environment settings together in a directory you can manage and update.
  2. Set up the environment file and secrets. Follow the variables in n8n’s Compose example. Restrict access to the .env file and do not commit real secrets to a public version-control repository. n8n’s manual guide explicitly cautions against putting this file in version control.
  3. Configure your hostname and DNS. For public access, create a DNS A record for a dedicated subdomain that points to the server’s public IP address. Use the same hostname in the proxy and TLS configuration.
  4. Keep n8n’s data persistent. The Compose example mounts a Docker volume at /home/node/.n8n. Preserve that volume: it contains the SQLite database and encryption key in the example. The directory remains important if you use PostgreSQL, because it holds other instance data as well.
  5. Start the stack. In the directory containing the Compose file, run docker compose up -d. Then open the configured HTTPS hostname and confirm that n8n loads.

For the exact Compose file, current environment variables, and proxy configuration, use n8n’s Docker Compose setup instructions. The project’s container-only installation page labels its instructions outdated and points readers to Compose instead; use the current Docker installation documentation as a guide to that distinction.

Set the correct webhook URL behind a reverse proxy

When n8n sits behind a reverse proxy, it must know the public URL that external services should use for webhooks. In the current documentation, set N8N_WEBHOOK_URL to the externally reachable HTTPS base URL, such as https://n8n.example.com/, and configure the number of trusted proxy hops using N8N_PROXY_HOPS. The final proxy must forward the original request headers so n8n can interpret the request correctly. Use the exact values and proxy guidance in n8n’s webhook URL documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

WEBHOOK_URL is deprecated beginning with n8n version 2.35.0; use N8N_WEBHOOK_URL for versions covered by the current guidance. If webhook callbacks fail or show the wrong host or protocol, check DNS, HTTPS, the external URL setting, the configured proxy-hop count, and forwarded headers.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choose SQLite or PostgreSQL

SQLite is n8n’s default and can suit a basic setup. n8n’s current manual Compose guide recommends PostgreSQL for production instances with more than a handful of users or workflows running around the clock. That is contextual guidance, not a guarantee that a particular database will meet every workload’s needs. The manual guide’s optional PostgreSQL procedure is for a fresh instance: existing SQLite data does not transfer automatically. Plan and verify a migration rather than changing the database setting on an established instance and expecting its workflows and credentials to move.

Whichever database you use, retain persistent storage for /home/node/.n8n. The Compose example identifies that volume as containing the SQLite database and encryption key; the directory also stores important instance data when PostgreSQL is in use. Consult the manual Compose guide for the supported database configuration.

Maintain and secure the instance

Treat the server and n8n as services you must operate continuously, not as a one-time install. Keep secrets private, limit public network exposure to the intended services, and maintain backups you can recover from. The deployment guidance establishes the importance of persistent n8n data, but it does not provide a complete backup-and-restore procedure here; choose a backup process appropriate to your database and infrastructure and test that recovery works.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Update n8n using the Compose workflow in the official deployment guide, and periodically run its security audit. The audit identifies issues including credentials, database expressions, filesystem nodes, risky nodes, unprotected webhooks, missing settings, and outdated instances. Run it through the CLI with n8n audit, the authenticated owner API, or the n8n node. Details are in n8n’s security audit documentation.

Troubleshoot a deployment that will not load

  • The hostname does not resolve: Confirm the subdomain’s A record points to the server’s public IP address.
  • The browser cannot reach the site: Check the server firewall and provider network rules, and confirm the proxy is reachable on the intended public ports.
  • The page loads but webhooks use the wrong URL: Verify N8N_WEBHOOK_URL, N8N_PROXY_HOPS, and the original forwarded headers sent by the final proxy.
  • The instance appears to lose data after a restart or replacement: Check that the Compose volume is still mounted at /home/node/.n8n and has not been removed or replaced.
  • TLS or HTTP redirects fail: Check the proxy’s hostname and certificate configuration in the Compose deployment and verify DNS points to the server.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.