{"id":22587,"date":"2026-11-28T12:03:05","date_gmt":"2026-11-28T09:03:05","guid":{"rendered":"https:\/\/www.hyyat.com\/knowledgebase\/install-n8n-on-vps\/"},"modified":"2026-11-28T12:03:10","modified_gmt":"2026-11-28T09:03:10","password":"","slug":"install-n8n-on-vps","status":"publish","type":"docs","link":"https:\/\/www.hyyat.com\/en\/knowledgebase\/install-n8n-on-vps\/","title":{"rendered":"Install n8n on a VPS: Self-Hosted Workflow Automation with HTTPS"},"content":{"rendered":"<div class=\"hkb\" dir=\"ltr\">\n<div class=\"hkb-tldr\"><b>In short<\/b>n8n is an open-source automation tool that connects your apps. On a VPS you own, you run unlimited workflows with no per-execution fees. You need <b>Docker<\/b>, a <b>subdomain<\/b> and a <b>docker-compose<\/b> file with n8n and Caddy for automatic HTTPS. A <b>4GB<\/b> plan is comfortable for most businesses.<\/div>\n<figure class=\"hkb-fig\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.hyyat.com\/zasogooh\/2026\/11\/hkb-vu-hero-vu-n8n-en.webp\" alt=\"Installing n8n on a VPS\" width=\"1200\" height=\"630\" loading=\"lazy\" \/><\/figure>\n<p>n8n connects apps such as Google Sheets, WhatsApp Business, email and your online store, and runs repetitive tasks for you: a new store customer is added to a sheet, you get a message, and a welcome email goes out. The cloud version is billed per execution; on your own server the only limit is the server&#8217;s resources, and your data stays with you.<\/p>\n<h2>Choosing resources<\/h2>\n<div class=\"hkb-tbl\">\n<table>\n<thead>\n<tr>\n<th>Use<\/th>\n<th>Suitable plan<\/th>\n<th>Why<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Testing and a few workflows<\/td>\n<td>VPS 2GB<\/td>\n<td>n8n alone needs 1 to 2 GB of memory<\/td>\n<\/tr>\n<tr>\n<td>A business with dozens of workflows<\/td>\n<td>VPS 4GB<\/td>\n<td>Room for parallel executions and PostgreSQL<\/td>\n<\/tr>\n<tr>\n<td>Large files or AI steps<\/td>\n<td>VPS 8GB<\/td>\n<td>Big files and requests use memory<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2>Before you start<\/h2>\n<ul class=\"hkb-list\">\n<li>A VPS with Ubuntu 24.04 or Debian 12 and root SSH access.<\/li>\n<li>Point a subdomain (for example <code>n8n.example.com<\/code>) to the server IP with an A record and wait for it to resolve.<\/li>\n<li>In the firewall, open only ports 22, 80 and 443 and keep the rest closed.<\/li>\n<\/ul>\n<h2>1. Install Docker<\/h2>\n<pre class=\"hkb-code\">curl -fsSL https:\/\/get.docker.com | sh\nsystemctl enable --now docker\ndocker compose version<\/pre>\n<h2>2. Create the project files<\/h2>\n<pre class=\"hkb-code\">mkdir -p \/opt\/n8n &amp;&amp; cd \/opt\/n8n<\/pre>\n<p>Create <code>docker-compose.yml<\/code> with this content, changing the domain and time zone:<\/p>\n<pre class=\"hkb-code\">services:\n  n8n:\n    image: docker.n8n.io\/n8nio\/n8n\n    restart: unless-stopped\n    environment:\n      - N8N_HOST=n8n.example.com\n      - N8N_PROTOCOL=https\n      - WEBHOOK_URL=https:\/\/n8n.example.com\/\n      - GENERIC_TIMEZONE=Asia\/Riyadh\n      - TZ=Asia\/Riyadh\n    volumes:\n      - n8n_data:\/home\/node\/.n8n\n  caddy:\n    image: caddy:2\n    restart: unless-stopped\n    ports:\n      - &quot;80:80&quot;\n      - &quot;443:443&quot;\n    volumes:\n      - .\/Caddyfile:\/etc\/caddy\/Caddyfile\n      - caddy_data:\/data\nvolumes:\n  n8n_data:\n  caddy_data:<\/pre>\n<p>Then a <code>Caddyfile<\/code> in the same folder:<\/p>\n<pre class=\"hkb-code\">n8n.example.com {\n    reverse_proxy n8n:5678\n}<\/pre>\n<h2>3. Start n8n<\/h2>\n<pre class=\"hkb-code\">docker compose up -d\ndocker compose logs -f n8n<\/pre>\n<p>Open <code>https:\/\/n8n.example.com<\/code> and create the owner account straight away, because whoever opens the page first becomes the owner. Caddy obtains the SSL certificate automatically, with no extra setup.<\/p>\n<h2>Updates and backups<\/h2>\n<pre class=\"hkb-code\">cd \/opt\/n8n\ndocker compose pull &amp;&amp; docker compose up -d<\/pre>\n<p>n8n data (workflows and encrypted credentials) lives in the <code>n8n_data<\/code> volume. Take a <b>snapshot<\/b> from the VPS control panel before every update, and export important workflows from n8n from time to time.<\/p>\n<div class=\"hkb-note warn\"><b>A mistake to avoid:<\/b> Exposing n8n on port 5678 to the internet without HTTPS. Credentials for your connected accounts pass through it, so always keep it behind Caddy or another proxy with SSL.<\/div>\n<div class=\"hkb-note\"><b>At Hyyat Host:<\/b> NVMe VPS servers with full root access, ready for n8n in minutes: <a href=\"https:\/\/www.hyyat.com\/en\/vps-hosting\/\">VPS plans<\/a>, with our own control panel for power, console and snapshots, and Arabic and English support.<\/div>\n<h2>Frequently asked questions<\/h2>\n<div class=\"hkb-faq\">\n<details>\n<summary>Is n8n free on my own server?<\/summary>\n<p>The community edition is open source and free to self-host under its licence terms; you only pay for the server.<\/p>\n<\/details>\n<details>\n<summary>How many workflows can I run?<\/summary>\n<p>n8n itself sets no limit; the limit is the server&#8217;s memory and CPU. Start with a 4GB plan and upgrade when needed.<\/p>\n<\/details>\n<details>\n<summary>Do I need PostgreSQL?<\/summary>\n<p>n8n runs on its built-in SQLite database, which is fine for light use. With many executions, move to PostgreSQL for better stability.<\/p>\n<\/details>\n<\/div>\n<div class=\"hkb-rel\"><b>Related guides<\/b><\/p>\n<ul>\n<li><a href=\"https:\/\/www.hyyat.com\/en\/vps-setup-script\/\">New VPS Setup Commands, Step by Step<\/a><\/li>\n<li><a href=\"https:\/\/www.hyyat.com\/en\/docker-compose-generator\/\">Docker Compose Generator for WordPress and Apps<\/a><\/li>\n<li><a href=\"https:\/\/www.hyyat.com\/en\/knowledgebase\/vps-firewall-manage-open-ports\/\">Firewall: Control the Open Ports on Your VPS<\/a><\/li>\n<li><a href=\"https:\/\/www.hyyat.com\/en\/knowledgebase\/when-to-move-from-shared-hosting-to-vps\/\">When Should You Move from Shared Hosting to a VPS? 7 Clear Signs<\/a><\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.hyyat.com\/en\/kb\/servers-without-control-panel\/\">All guides for servers without a panel \u2192<\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In shortn8n is an open-source automation tool that connects your apps. On a VPS you own, you run unlimited workflows with no per-execution fees. You need Docker, a subdomain and a docker-compose file with n8n and Caddy for automatic HTTPS. A 4GB plan is comfortable for most businesses. n8n connects apps such as Google Sheets, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":22573,"comment_status":"open","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"_templately_pack_id":"","_templately_imported_at":"","_templately_source":"","_templately_import_session_id":"","footnotes":""},"doc_category":[2733],"doc_tag":[],"class_list":["post-22587","docs","type-docs","status-publish","has-post-thumbnail","hentry","doc_category-servers-without-control-panel"],"year_month":"2026-11","word_count":616,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"admin","author_nicename":"admin","author_url":"https:\/\/www.hyyat.com\/en\/author\/admin\/"},"doc_category_info":[{"term_name":"Servers Without a Control Panel","term_url":"https:\/\/www.hyyat.com\/en\/kb\/servers-without-control-panel\/"}],"doc_tag_info":[],"knowledge_base_info":[],"knowledge_base_slug":[],"_links":{"self":[{"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/docs\/22587","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/comments?post=22587"}],"version-history":[{"count":0,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/docs\/22587\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/media\/22573"}],"wp:attachment":[{"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/media?parent=22587"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/doc_category?post=22587"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/doc_tag?post=22587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}