{"id":11555,"date":"2025-11-25T15:58:36","date_gmt":"2025-11-25T10:28:36","guid":{"rendered":"https:\/\/www.youstable.com\/blog\/?p=11555"},"modified":"2025-11-25T16:00:16","modified_gmt":"2025-11-25T10:30:16","slug":"install-n8n-on-docker","status":"publish","type":"post","link":"https:\/\/www.youstable.com\/blog\/install-n8n-on-docker","title":{"rendered":"How to Set Up N8N with Docker Compose {Scalable N8N Hosting}"},"content":{"rendered":"\n<p>N8N is a powerful, open-source workflow automation tool that enables you to visually connect applications, services, and APIs to automate tasks and processes without writing<br>complex code. <\/p>\n\n\n\n<p>It\u2019s often described as a self-hosted alternative to&nbsp;<a href=\"https:\/\/zapier.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Zapier<\/a>&nbsp;or Make.com, offering more flexibility and control over your data. You can&nbsp;<strong>install n8n on Docker<\/strong>&nbsp;quickly and securely with this comprehensive tutorial<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"why-developers-love-n8n-and-why-you-should-too\">Why Developers Love n8n (and Why You Should Too)<\/h2>\n\n\n\n<p>If you\u2019re a developer, you know how painful it is to juggle between multiple tools, APIs, and logic just to get basic automation running. That\u2019s where&nbsp;<strong>n8n<\/strong>&nbsp;comes in\u2014and believe me, once you get your hands on it, there\u2019s no turning back.<\/p>\n\n\n\n<p>I\u2019ve seen devs fall in love with n8n for one simple reason:&nbsp;<strong>it gives them superpowers.<\/strong><\/p>\n\n\n\n<p>You\u2019re not just automating tasks\u2014you\u2019re building full-blown backend logic, workflow pipelines, and business automation\u2026 without writing 1,000 lines of code. And the best part? It\u2019s&nbsp;<strong>open-source<\/strong>, self-hostable, and scalable.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"why-self-hosted-n8n-on-youstable\">Why Self-Hosted N8N on YouStable?<\/h2>\n\n\n\n<p><strong><a href=\"https:\/\/www.youstable.com\/n8n-vps-hosting\" data-type=\"link\" data-id=\"https:\/\/www.youstable.com\/n8n-vps-hosting\">YouStable<\/a><\/strong>&nbsp;is a developer-first hosting platform offering optimised environments for self-hosted applications like N8N. Here\u2019s why N8N developers prefer YouStable:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"768\" height=\"768\" src=\"https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2025\/11\/image-4.png\" alt=\"Why Self-Hosted N8N on YouStable?\" class=\"wp-image-11556\" style=\"width:323px;height:auto\" srcset=\"https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2025\/11\/image-4.png 768w, https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2025\/11\/image-4-96x96.png 96w, https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2025\/11\/image-4-150x150.png 150w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Pre-installed Docker &amp; Docker Compose on all VPS plans<\/li>\n\n\n\n<li>Affordable NVMe SSD VPS Hosting<\/li>\n\n\n\n<li>Root Access with Full Control over Infrastructure<\/li>\n\n\n\n<li>Free SSL, Automated Backups &amp; Dedicated IP Support<\/li>\n\n\n\n<li>Developer-Support Ready 24\/7 for your automation stack<\/li>\n<\/ul>\n\n\n\n<p>Whether you\u2019re a solo dev, a growing SaaS founder, or managing enterprise workflows, YouStable<br>empowers your automation journey.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"set-up-docker-environment\">Set up Docker Environment<\/h2>\n\n\n\n<p><strong>Step 1:<\/strong>&nbsp;Deploy Ubuntu VM (20.04 or 22.04)<\/p>\n\n\n\n<p>Get started from the&nbsp;<strong><a href=\"https:\/\/www.youstable.com\/n8n-vps-hosting\" data-type=\"link\" data-id=\"https:\/\/www.youstable.com\/n8n-vps-hosting\">YouStable N8N VPS Hosting<\/a><\/strong>&nbsp;page and choose a plan. Launch your instance with<br>root access.<\/p>\n\n\n\n<p><strong>Step 2:<\/strong>&nbsp;Connect your VM with SSH<\/p>\n\n\n\n<p>If you are using a Windows machine,&nbsp;<a href=\"https:\/\/www.youstable.com\/blog\/tag\/command-in-putty\/\" data-type=\"link\" data-id=\"https:\/\/www.youstable.com\/blog\/tag\/command-in-putty\/\">download PuTTY<\/a>. If you are using it like me, use this command in your terminal to access your VM.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ssh root@your-server-ip\n<\/pre>\n\n\n\n<p><strong>Step 3:<\/strong>&nbsp;Create Docker Compose for n8n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt update &amp;amp;&amp;amp; apt install docker.io docker-compose -y\n<\/pre>\n\n\n\n<p><strong>Step 4:<\/strong>&nbsp;Create a<code>&nbsp;<em>docker-compose.yml<\/em><\/code>&nbsp;file<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">version: \"3\"\nservices:\nn8n:\nimage: n8nio\/n8n\nrestart: always\nports:\n- \"5678:5678\"\nenvironment:\n- DB_TYPE=sqlite\n- N8N_BASIC_AUTH_USER=admin\n- N8N_BASIC_AUTH_PASSWORD=YourSecurePassword\nvolumes:\n- .\/n8n_data:\/home\/node\/.n8n\n<\/pre>\n\n\n\n<p><strong>Step 5:&nbsp;<\/strong>Launch and Verify n8n Container<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">docker-compose up -d\n<\/pre>\n\n\n\n<p>Now you can access your&nbsp;<strong>N8N Dashboard<\/strong>&nbsp;with http:\/\/your-vm-ip:5678 on your Google Chrome or any browser of your choice.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"setup-n8n-with-node-js-no-docker\">Setup N8N with Node.Js {No Docker}<\/h2>\n\n\n\n<p>If you prefer not to use Docker or are using a standard KVM VPS from a hosting provider other than YouStable, then follow these simple steps to deploy your n8n project without Docker.<\/p>\n\n\n\n<p><strong>Step 1:<\/strong>&nbsp;Install Node.Js and npm<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt update &amp;amp;&amp;amp; apt install curl -y\ncurl -fsSL https:\/\/deb.nodesource.com\/setup_18.x | bash -\napt install -y nodejs build-essential\n<\/pre>\n\n\n\n<p><strong>Step 2<\/strong>: Add a system user for N8N<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">adduser --disabled-password --gecos \"\" n8nuser\nusermod -aG sudo n8nuser\n<\/pre>\n\n\n\n<p><strong>Step 3:<\/strong>&nbsp;Installing N8N<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">su - n8nuser\nnpm install n8n -g\n<\/pre>\n\n\n\n<p><strong>Step 4:<\/strong>&nbsp;Start N8N<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">n8n\n<\/pre>\n\n\n\n<p>Now you have set up your N8N without using a docket on port number 5678, to keep it running, you\u2019ll need to consider using PM2.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">npm install pm2 -g\npm2 start n8n\npm2 startup &amp;amp;&amp;amp; pm2 save\n<\/pre>\n\n\n\n<p><strong>Final Step:<\/strong>&nbsp;Add your Domain &amp; SSL (Optional)<\/p>\n\n\n\n<p>Set\u00a0<strong>A Record<\/strong>\u00a0for\u00a0<em>n8n.yourdomain.com<\/em>\u00a0to your VPS IP<br><strong><a href=\"https:\/\/www.youstable.com\/blog\/tag\/hotlink-protection-nginx\/\" data-type=\"link\" data-id=\"https:\/\/www.youstable.com\/blog\/tag\/hotlink-protection-nginx\/\">Install NGINX<\/a><\/strong>\u00a0or Caddy as a Reverse Proxy Use\u00a0<strong><a href=\"https:\/\/www.youstable.com\/blog\/tag\/lets-encrypt-ssl\/\">Let\u2019s Encrypt\u00a0<\/a><\/strong>for SSL YouStable can configure your reverse proxy &amp; SSL for FREE on request.<\/p>\n\n\n\n<p>Whether you\u2019re deploying via Docker Compose or going manual with Node.js, YouStable\u2019s KVM VPS gives you full control, scalability, and peace of mind. It\u2019s the perfect choice for developers, automation Pros, agencies, and startups are ready to take ownership of their workflows.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"can-i-run-n8n-on-a-vps-without-docker\">Can I run n8n on a VPS without Docker?<\/h2>\n\n\n\n<p>Yes, if you\u2019re using a KVM VPS like the ones offered by YouStable, you can install n8n directly using Node.js and npm. This is an alternative for users who prefer not to use Docker-based containers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-are-the-system-requirements-for-installing-n8n-on-docker\">What are the system requirements for installing n8n on Docker?<\/h2>\n\n\n\n<p>Docker&nbsp;<strong>CE 20.x<\/strong>&nbsp;or above<br>Docker&nbsp;<strong>Compose<\/strong>&nbsp;1.27+<br>At least 1GB RAM and 1 vCPU<br>Stable internet connection and access to ports (default: 5678)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"is-it-safe-to-self-host-n8n-using-docker\">Is it safe to self-host n8n using Docker?<\/h2>\n\n\n\n<p>Yes, self-hosting n8n via&nbsp;<strong>Docker is safe<\/strong>&nbsp;if you implement best practices, such as using HTTPS, setting up authentication, configuring firewalls, and keeping the containers up to date.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-port-does-n8n-run-on-by-default-in-docker\">What port does n8n run on by default in Docker?<\/h2>\n\n\n\n<p>By default, n8n runs on port&nbsp;<strong>5678<\/strong>&nbsp;when deployed via Docker. You can change this port in your docker-compose.yml file as needed.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-do-i-update-n8n-in-docker\">How do I update n8n in Docker?<\/h2>\n\n\n\n<p>To update n8n in Docker, simply pull the latest image using docker pull n8nio\/n8n and then restart your container using docker-compose up -d. Always back up your data before updating.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"is-n8n-docker-setup-suitable-for-production-use\">Is n8n Docker setup suitable for production use?<\/h2>\n\n\n\n<p>Yes, Docker deployment of n8n is suitable for production use, especially when hosted on a reliable VPS. You should also configure persistent storage, environment variables, and proper logging to ensure stability.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>N8N is a powerful, open-source workflow automation tool that enables you to visually connect applications, services, and APIs to automate [&hellip;]<\/p>\n","protected":false},"author":13,"featured_media":11556,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-11555","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-email"],"acf":[],"featured_image_src":"https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2025\/11\/image-4.png","author_info":{"display_name":"Prahlad Prajapati","author_link":"https:\/\/www.youstable.com\/blog\/author\/prahladblog"},"_links":{"self":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts\/11555","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/comments?post=11555"}],"version-history":[{"count":3,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts\/11555\/revisions"}],"predecessor-version":[{"id":15766,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts\/11555\/revisions\/15766"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/media\/11556"}],"wp:attachment":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/media?parent=11555"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/categories?post=11555"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/tags?post=11555"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}