{"id":4653,"date":"2026-11-13T19:59:36","date_gmt":"2026-11-13T19:59:36","guid":{"rendered":"https:\/\/skynethosting.net\/blog\/?p=4653"},"modified":"2026-11-15T20:04:10","modified_gmt":"2026-11-15T20:04:10","slug":"self-hosted-n8n-on-a-vps","status":"publish","type":"post","link":"https:\/\/skynethosting.net\/blog\/self-hosted-n8n-on-a-vps\/","title":{"rendered":"Self-Hosted n8n on a VPS: The Complete Beginner\u2019s Guide"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">You can run n8n on your own server by renting a VPS, installing Docker, starting n8n from a Docker Compose file and putting a subdomain with HTTPS in front of it. Most beginners finish in about an hour. You end up with a private automation server that has no per workflow pricing, and the only limits are the ones your server sets.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This guide shows every command and explains what each line does. You should never paste code you do not understand.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We have run hosting infrastructure for more than 20 years and hosted over 700,000 websites. A self-hosted app like n8n follows the same rules as any other server job. Keep it patched, keep it backed up and keep the door locked.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What Is Self-Hosted n8n and Why Run It on a VPS?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Self-hosted n8n is the n8n workflow automation tool running on a server you control instead of on n8n Cloud. A VPS suits it well because it stays online around the clock, gives you full root access and costs a fixed amount each month. You trade some setup time for control over your data, your configuration and your bill.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Understanding n8n and its workflow automation capabilities<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">n8n is a visual workflow automation tool. You connect apps and services on a canvas, and n8n moves data between them whenever something happens. One new form entry can create a CRM contact, post a Slack message and add a row to a spreadsheet while nobody touches a keyboard.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Every workflow starts with a trigger node. That might be a webhook, a schedule or an event inside another app. Action nodes follow it, and each one does a single job such as sending an email, calling an API or reshaping data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">n8n ships with hundreds of built in integrations, and the HTTP Request node covers everything else. If a service has an API, you can talk to it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One thing to know before you commit. n8n uses a fair code license (n8n calls it the Sustainable Use License) rather than a classic open source license. Running it for your own business is fine. Selling n8n itself as a hosted service to other people is a different matter, so read the license terms first.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Differences between n8n Cloud and self-hosted n8n<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">On n8n Cloud, the n8n team runs the servers, installs updates and handles backups. You pay a subscription based on usage. When you self host, you take over all of that work, and in return you pay your VPS provider instead.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><td>&nbsp;<\/td><td><strong>n8n Cloud<\/strong><\/td><td><strong>Self-hosted on a VPS<\/strong><\/td><\/tr><\/thead><tbody><tr><td>Setup<\/td><td>Sign up and start building<\/td><td>Install Docker, configure DNS and HTTPS<\/td><\/tr><tr><td>Updates<\/td><td>Handled for you<\/td><td>You pull new versions yourself<\/td><\/tr><tr><td>Backups<\/td><td>Handled for you<\/td><td>You schedule and test them<\/td><\/tr><tr><td>Cost model<\/td><td>Subscription tied to usage<\/td><td>Fixed VPS price, no per execution fee<\/td><\/tr><tr><td>Data location<\/td><td>n8n\u2019s infrastructure<\/td><td>The server and region you pick<\/td><\/tr><tr><td>Control<\/td><td>Limited to what n8n exposes<\/td><td>Full access to configuration and server<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Here is the honest part. n8n\u2019s own documentation describes self hosting as a path for experienced users and points anyone unfamiliar with servers toward n8n Cloud. We think that warning is fair. We also think a careful guide closes most of the gap, which is why this one spends so long on backups and security.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How a VPS provides control over your automation environment<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A VPS gives you your own slice of a physical server with dedicated resources and root access. You choose the operating system, the software and the location. Nobody else\u2019s workload competes for the memory you reserved.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Location matters more than people expect. If most of your workflows call APIs in North America, a server in North America cuts round trip time on every single step. We run servers in 25 locations worldwide, so you can place n8n close to the services it talks to or close to the region where your data has to stay.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A VPS also gives you a stable public IP address. Some third party APIs only accept calls from allowlisted addresses, and a fixed IP makes that setup easy. Webhooks need a server that is always reachable, which a laptop under your desk is not.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Plain <a href=\"https:\/\/skynethosting.net\/cpanel-web-hosting.htm\">shared web hosting<\/a> cannot do this job. It does not give you Docker or root access, and that is the right product for a website, not for an automation engine. You need a VPS.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Advantages and responsibilities of running your own n8n server<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The advantages are concrete. Your workflow data and credentials stay on a server you chose. You pay one predictable monthly price whether you run ten executions or ten thousand. You can tune the setup, install extra software next to n8n and move the whole thing to a new server when you outgrow the old one.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The responsibilities are just as concrete. If the server goes down at 3 a.m., that is your problem. If you skip updates, known security issues stay open on a machine that holds API keys for your business. If you never test a backup, you will find out it was broken on the worst possible day.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">None of that is scary once it becomes routine. It does mean self hosting is a commitment and not a one time install.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Common business and personal automation use cases<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Lead capture is the classic first workflow. A website form posts to an n8n webhook, n8n adds the contact to a CRM and sends a welcome email. Invoice reminders, social media scheduling and file syncing between cloud drives follow the same pattern.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Freelancers and agencies often build client automations on one shared n8n server. If you already build client sites on <a href=\"https:\/\/skynethosting.net\/reseller-hosting.htm\">reseller hosting<\/a>, an n8n server next to that work is a natural addition. Hosting businesses can go further. WHMCS exposes an API, so a workflow can react to new orders or support tickets in a <a href=\"https:\/\/skynethosting.net\/whmcs.htm\">free WHMCS license<\/a> setup without anyone copying data by hand.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">AI workflows are the fastest growing category. n8n can send text to a language model API, take the answer and push it into another tool. The model runs on the provider\u2019s servers, so your VPS only coordinates the work.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What Do You Need Before Installing n8n on a VPS?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You need a Linux VPS running Ubuntu, a domain or subdomain whose DNS you can edit, SSH access and a basic idea of what Docker does. A VPS with 2 GB of RAM is a sensible starting point for a few light workflows. Business use deserves 4 GB or more. These are our starting points, not official n8n minimums.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Choosing a VPS operating system and server configuration<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Pick Ubuntu Server 24.04 LTS. LTS means long term support, so the system receives security updates for years. Ubuntu also has the largest pool of tutorials and forum answers, and that matters the first time something breaks.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Choose the server image without a desktop environment. A graphical desktop wastes memory on a machine you will only reach through a terminal.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Storage type matters too. n8n writes workflow history to its database all day, and fast disks keep the editor responsive. Our servers use Intel Dual Xeon processors with NVMe drives, and you can see the current options on our <a href=\"https:\/\/skynethosting.net\/vps.htm\">USA VPS page<\/a>. Check the plan details there for the specs available today.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Understanding CPU, RAM and storage requirements<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">n8n itself is light. Memory is usually the resource that runs out first, not CPU. A simple webhook workflow uses very little. A workflow that handles large files, big JSON payloads or heavy Code node logic can spike memory because data gets copied between steps.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><td><strong>Use case<\/strong><\/td><td><strong>RAM<\/strong><\/td><td><strong>vCPU<\/strong><\/td><td><strong>Disk<\/strong><\/td><\/tr><\/thead><tbody><tr><td>Learning and personal workflows<\/td><td>2 GB<\/td><td>1 to 2<\/td><td>20 GB or more<\/td><\/tr><tr><td>Small business, several active workflows<\/td><td>4 GB<\/td><td>2<\/td><td>40 GB or more<\/td><\/tr><tr><td>Heavy files, many webhooks, PostgreSQL on the same server<\/td><td>8 GB or more<\/td><td>4<\/td><td>80 GB or more<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Treat those numbers as a first guess and watch real usage. Run docker stats after a week and adjust.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Disk fills up faster than beginners expect. Execution history, logs, Docker images and backups all pile up. A fast drive helps as well, and our write up on <a href=\"https:\/\/skynethosting.net\/pcie-nvme-ssd-reseller-hosting.htm\">NVMe drives compared with SSDs<\/a> explains why the difference shows up in database heavy applications.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Preparing a domain name or subdomain for n8n<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use a dedicated subdomain such as n8n.yourdomain.com. It keeps n8n away from your main website, and certificates and DNS records stay simple. You do not need to buy a new domain.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You will create one A record that points the subdomain at your VPS\u2019s public IP address. Do this at the DNS provider that controls your domain. Leave the record alone for now if you have not picked a server yet, and come back to it in the DNS section below.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One detail catches people out. If your DNS runs through <a href=\"https:\/\/skynethosting.net\/cloudflare.htm\">CloudFlare CDN<\/a>, set the n8n record to DNS only (the grey cloud) while the certificate is first issued. The automatic certificate method we use later needs to reach your server directly, and the orange cloud proxy gets in the way.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Setting up SSH access and basic Linux commands<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">SSH is how you control the server from your own computer. Your VPS provider sends you an IP address and a login. On Mac and Linux you open a terminal. On Windows 10 and 11 the built in terminal or PowerShell works the same way.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You will use only a handful of commands in this guide. Here they are, in plain English.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><td><strong>Command<\/strong><\/td><td><strong>What it does<\/strong><\/td><\/tr><\/thead><tbody><tr><td>pwd<\/td><td>Shows which folder you are in right now<\/td><\/tr><tr><td>ls<\/td><td>Lists the files in the current folder<\/td><\/tr><tr><td>cd folder<\/td><td>Moves into a folder<\/td><\/tr><tr><td>nano file<\/td><td>Opens a simple text editor. Save with Ctrl+O, exit with Ctrl+X<\/td><\/tr><tr><td>sudo<\/td><td>Runs the next command with administrator rights<\/td><\/tr><tr><td>cat file<\/td><td>Prints a file to the screen so you can read it<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Do not run everything as the root user. We create a normal user with sudo rights in the next section. It is a small step that limits the damage a typo can do.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Understanding Docker, Docker Compose and database options<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Docker runs software inside containers. A container is a sealed box holding one application and everything it needs. An image is the template the box is built from, and a volume is a folder kept outside the box so data survives when the box is thrown away.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Docker Compose lets you describe all your containers in one text file and start them with one command. That file becomes living documentation of your server. If the VPS ever dies, you copy the file to a new one and you are most of the way back.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">n8n stores workflows, credentials and execution history in a database. It uses SQLite by default, which is a single file and needs no setup. PostgreSQL is the heavier option for larger setups. We cover when to switch in the last section of this guide.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How Do You Install n8n on a VPS Using Docker Compose?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Connect over SSH, install Docker from Docker\u2019s official repository, create a project folder with an .env file and a Compose file, then run docker compose up -d. n8n starts in the background and comes back by itself after a server reboot. The official n8n guide for this setup is the <a href=\"https:\/\/docs.n8n.io\/deploy\/host-n8n\/install-options\/use-a-cloud-provider\/use-docker-compose\/\" target=\"_blank\" rel=\"noopener\">n8n Docker Compose server setup page<\/a>, and we follow its structure here with a few safety changes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Connecting to the VPS through SSH<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Open a terminal and connect with the IP address from your provider. Replace the example address with yours.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">ssh root@203.0.113.10<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The first time you connect, your computer asks whether to trust the server. Type yes. Then create a normal user so you stop working as root. We call it deploy, but any name works.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">adduser deploy<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">usermod -aG sudo deploy<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">su &#8211; deploy<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">adduser creates the account and asks you for a password. usermod -aG sudo adds that account to the group that may use sudo. su &#8211; deploy switches you into it. From here on, every command runs as this user.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Screenshot to add: terminal after a successful SSH login showing the Ubuntu welcome banner.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Updating Ubuntu and installing Docker<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Start by updating the system. Fresh VPS images are often a few weeks behind on patches.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">sudo apt update<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">sudo apt upgrade -y<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">apt update refreshes the list of available packages. apt upgrade -y installs the newer versions and answers yes to every prompt. If it says a reboot is needed, run sudo reboot, wait a minute and reconnect.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now install Docker. Ubuntu has its own Docker package, but we use Docker\u2019s official repository because it carries the current Compose plugin. These commands add the repository.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">sudo apt install -y ca-certificates curl<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">sudo install -m 0755 -d \/etc\/apt\/keyrings<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">sudo curl -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg -o \/etc\/apt\/keyrings\/docker.asc<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">sudo chmod a+r \/etc\/apt\/keyrings\/docker.asc<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">echo &#8220;deb [arch=$(dpkg &#8211;print-architecture) signed-by=\/etc\/apt\/keyrings\/docker.asc] https:\/\/download.docker.com\/linux\/ubuntu $(. \/etc\/os-release &amp;&amp; echo &#8220;${UBUNTU_CODENAME:-$VERSION_CODENAME}&#8221;) stable&#8221; | sudo tee \/etc\/apt\/sources.list.d\/docker.list &gt; \/dev\/null<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The first four lines download Docker\u2019s signing key, so Ubuntu can check that packages really come from Docker. The last line registers the repository. Then install the packages and check them.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">sudo apt update<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">docker &#8211;version<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">docker compose version<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Both version commands should print a number. If you want to run Docker without typing sudo every time, add your user to the docker group with sudo usermod -aG docker $USER and log out and back in. Be aware that anyone in that group effectively has root power on the server, so keep it to people you trust.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Creating a Docker Compose configuration for n8n<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Make a project folder. Everything for this setup will live in it, which makes backups and moves simple.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">mkdir ~\/n8n-compose<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">cd ~\/n8n-compose<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">nano compose.yaml<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Paste in this first version. It runs n8n on its own, with no domain and no HTTPS yet. We add those in the next section.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">services:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; n8n:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp; image: docker.n8n.io\/n8nio\/n8n:${N8N_VERSION}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp; restart: always<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp; ports:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; &#8220;127.0.0.1:5678:5678&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp; environment:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; N8N_ENCRYPTION_KEY=${N8N_ENCRYPTION_KEY}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; GENERIC_TIMEZONE=${GENERIC_TIMEZONE}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; TZ=${GENERIC_TIMEZONE}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp; volumes:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; n8n_data:\/home\/node\/.n8n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">volumes:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; n8n_data:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here is what each part does. image names the n8n template and the version tag to use. restart: always brings n8n back after a crash or reboot. ports publishes n8n\u2019s port 5678, but only on 127.0.0.1, which means the server itself. The outside world cannot reach it directly, and that is on purpose.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The environment lines pass settings into the container. The ${&#8230;} parts are placeholders that Docker fills in from a file called .env, which we write next. The volumes lines map a named volume to \/home\/node\/.n8n, the folder where n8n keeps its database and its encryption key.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Configuring environment variables and persistent storage<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Create the .env file in the same folder. First generate a random encryption key and copy the output.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">openssl rand -hex 32<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">nano .env<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">DOMAIN_NAME=example.com<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">SUBDOMAIN=n8n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">GENERIC_TIMEZONE=America\/New_York<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">SSL_EMAIL=you@example.com<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">N8N_VERSION=stable<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">N8N_ENCRYPTION_KEY=paste-your-random-key-here<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">DOMAIN_NAME and SUBDOMAIN combine into the address n8n.example.com. GENERIC_TIMEZONE controls schedule triggers, so set it to your own zone or your 9 a.m. workflow will fire at the wrong hour. SSL_EMAIL is where Let\u2019s Encrypt sends certificate warnings. N8N_VERSION=stable follows the version n8n recommends for production. Once everything works, replace it with an exact number such as 2.47.7 so updates only happen when you choose.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The encryption key deserves a closer look. n8n uses it to encrypt every credential you save. Set it now, before the first start. If n8n launches without one, it generates its own and stores it inside the volume, and a key you add later will not match it. That mismatch locks you out of saved credentials. Lock the file down so other users cannot read it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">chmod 600 .env<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Persistent storage works through the n8n_data volume. Docker keeps it outside the container, so you can delete and recreate the container without losing a single workflow. The command to remember is the dangerous one. docker compose down removes containers and keeps volumes. docker compose down -v removes the volumes as well, and your data goes with them.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Starting the n8n container and checking installation status<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Start everything in the background.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">docker compose up -d<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">docker compose ps<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The -d flag means detached, so the container keeps running after you close the terminal. docker compose ps should show n8n with a status of Up. The first run downloads the image, which takes a minute or two.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Confirm that n8n answers. This command asks n8n\u2019s health endpoint for a reply from inside the server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">curl -sf http:\/\/localhost:5678\/healthz<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">docker compose logs -f n8n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A healthy instance returns a short message saying the status is ok. The second command follows the live log. Press Ctrl+C to stop watching it, and n8n keeps running. If the container keeps restarting, the log almost always names the reason.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Screenshot to add: output of docker compose ps showing the n8n container with status Up.<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How Do You Configure a Domain and HTTPS for Your n8n Server?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Point an A record from a subdomain at your VPS, add a reverse proxy such as Traefik that fetches a free Let\u2019s Encrypt certificate, and tell n8n its public address through environment variables. Traefik renews the certificate on its own. After that, you reach the editor at an https address instead of an IP and a port.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Creating a subdomain and configuring DNS records<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Log in to the DNS panel for your domain and add one record.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><td><strong>Type<\/strong><\/td><td><strong>Name<\/strong><\/td><td><strong>Value<\/strong><\/td><\/tr><\/thead><tbody><tr><td>A<\/td><td>n8n<\/td><td>Your VPS public IP address<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Set a low TTL such as 300 seconds if the panel lets you. A low TTL means mistakes fix themselves quickly. Changes usually appear within minutes, but some providers take longer.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check from the server before you go further.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">dig +short n8n.example.com<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The answer should be your VPS\u2019s IP address. If it is empty or shows another address, wait and try again. Starting Traefik before DNS is ready is the most common reason certificates fail on the first attempt.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Setting up a reverse proxy with Nginx or Traefik<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A reverse proxy is a front door. It accepts web traffic on ports 80 and 443, handles HTTPS, then passes requests to n8n on the inside. That keeps n8n itself off the public internet and gives you one place to manage certificates.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Both Nginx and Traefik do the job well. Nginx with Certbot is a favorite of many sysadmins. We use Traefik here because it reads labels from the Compose file and requests certificates by itself, so the whole setup stays in one file.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img fetchpriority=\"high\" decoding=\"async\" width=\"751\" height=\"385\" src=\"https:\/\/skynethosting.net\/blog\/wp-content\/uploads\/2026\/11\/image.gif\" alt=\"\" class=\"wp-image-4654\" style=\"aspect-ratio:1.9512987012987013;width:601px;height:auto\" title=\"\" srcset=\"https:\/\/skynethosting.net\/blog\/wp-content\/uploads\/2026\/11\/image.gif 751w, https:\/\/skynethosting.net\/blog\/wp-content\/uploads\/2026\/11\/image-300x154.png 300w\" sizes=\"(max-width: 751px) 100vw, 751px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\"><em>Figure 1: How traffic reaches n8n on your VPS.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Open the firewall for web traffic first. We cover the firewall in detail later, but ports 80 and 443 must be reachable now for the certificate check to work. Then replace your compose.yaml with this complete version.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">services:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; traefik:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp; image: &#8220;traefik:v3&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp; restart: always<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp; command:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; &#8220;&#8211;providers.docker=true&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; &#8220;&#8211;providers.docker.exposedbydefault=false&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; &#8220;&#8211;entrypoints.web.address=:80&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; &#8220;&#8211;entrypoints.web.http.redirections.entryPoint.to=websecure&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; &#8220;&#8211;entrypoints.web.http.redirections.entrypoint.scheme=https&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; &#8220;&#8211;entrypoints.websecure.address=:443&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; &#8220;&#8211;certificatesresolvers.mytlschallenge.acme.tlschallenge=true&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; &#8220;&#8211;certificatesresolvers.mytlschallenge.acme.email=${SSL_EMAIL}&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; &#8220;&#8211;certificatesresolvers.mytlschallenge.acme.storage=\/letsencrypt\/acme.json&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp; ports:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; &#8220;80:80&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; &#8220;443:443&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp; volumes:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; traefik_data:\/letsencrypt<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; \/var\/run\/docker.sock:\/var\/run\/docker.sock:ro<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; n8n:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp; image: docker.n8n.io\/n8nio\/n8n:${N8N_VERSION}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp; restart: always<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp; ports:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; &#8220;127.0.0.1:5678:5678&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp; labels:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; traefik.enable=true<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; traefik.http.routers.n8n.rule=Host(`${SUBDOMAIN}.${DOMAIN_NAME}`)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; traefik.http.routers.n8n.tls=true<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; traefik.http.routers.n8n.entrypoints=web,websecure<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; traefik.http.routers.n8n.tls.certresolver=mytlschallenge<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp; environment:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; N8N_ENCRYPTION_KEY=${N8N_ENCRYPTION_KEY}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; N8N_PORT=5678<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; N8N_PROTOCOL=https<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; NODE_ENV=production<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; N8N_WEBHOOK_URL=https:\/\/${SUBDOMAIN}.${DOMAIN_NAME}\/<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; GENERIC_TIMEZONE=${GENERIC_TIMEZONE}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; TZ=${GENERIC_TIMEZONE}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp; volumes:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; n8n_data:\/home\/node\/.n8n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">volumes:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; n8n_data:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; traefik_data:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The Traefik service listens on ports 80 and 443 and redirects every plain HTTP request to HTTPS. Its socket mount lets it read container labels, and the read only flag (:ro) stops it from changing anything. The n8n labels tell Traefik which hostname belongs to n8n and which certificate resolver to use.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We removed the Traefik dashboard option that appears in some older tutorials. You do not need an extra admin panel exposed on your server.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Installing an SSL certificate for secure HTTPS connections<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s Encrypt issues free certificates, and Traefik asks for one automatically the first time someone visits your hostname. It proves you control the domain by answering a challenge on port 443, then stores the certificate in the traefik_data volume. Renewal happens in the background.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Apply the new configuration and watch the Traefik log.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">docker compose up -d<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">docker compose logs -f traefik<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Look for a line about obtaining a certificate and no errors after it. If you see repeated failures, stop and fix the cause before trying again. Let\u2019s Encrypt applies rate limits to failed attempts, and hammering the same request can lock you out for a while.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Prefer a paid certificate with a validation warranty, or one that covers many hostnames? Our <a href=\"https:\/\/skynethosting.net\/ssl-reseller-program.htm\">SSL reseller program<\/a> sells those. For a single n8n subdomain, the free certificate is enough.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Configuring the n8n webhook URL and application address<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">n8n needs to know its public address so it can print correct webhook links. Three settings do that. N8N_HOST is the hostname, N8N_PROTOCOL is https and N8N_WEBHOOK_URL is the full public address with a trailing slash. n8n added N8N_WEBHOOK_URL in version 2.30.0. Older versions use WEBHOOK_URL instead.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Skip this step and you will see the symptom quickly. Webhook nodes show http:\/\/localhost:5678\/&#8230; as their address, and no outside service can call that. The same setting also matters for OAuth logins to apps like Google, because the redirect address is built from it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can read about every available setting on the <a href=\"https:\/\/docs.n8n.io\/deploy\/host-n8n\/configure-n8n\/basic-configuration\/use-environment-variables\/\" target=\"_blank\" rel=\"noopener\">n8n environment variables page<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Accessing the n8n editor through your custom domain<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Open https:\/\/n8n.example.com in your browser, with your own domain in place of the example. The first visit shows a setup screen that asks you to create the owner account. Use your real email and a long unique password from a password manager.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That owner account controls every workflow and credential on the server, so treat the password like a root password. n8n\u2019s documentation notes that this setup is reachable only over HTTPS, so plain http requests are redirected.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the page does not load, work through the checklist in the troubleshooting section at the end. DNS and blocked ports cause nearly every first time failure.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Screenshot to add: the n8n owner account setup screen on the custom domain, with the padlock visible.<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How Do You Secure and Maintain a Self-Hosted n8n Installation?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Lock down SSH and the firewall, protect the editor with the owner login plus two factor authentication, keep one encryption key stored safely away from the server, back up the data on a schedule and update containers on purpose. None of these steps is hard. Skipping any of them is how automation servers end up in incident reports.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Configuring authentication and restricting server access<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Start with the n8n owner account and switch on two factor authentication in your n8n personal settings. Add colleagues as separate users instead of sharing the owner login, so you can remove one person without changing everyone\u2019s password.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The server needs the same care. Add your public SSH key to the deploy user and turn off password logins in \/etc\/ssh\/sshd_config by setting PasswordAuthentication no. Do it only after you have confirmed that key login works, or you will lock yourself out.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here is a point worth thinking about. Webhooks must be public, because other services call them. The editor does not have to be. A stricter setup keeps the editor reachable only through a VPN or an allowlist of office IP addresses, while the webhook paths stay open to the internet. Beginners can start with the owner login plus two factor authentication and tighten things later.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Protecting API credentials and setting a persistent encryption key<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Every API key, OAuth token and database password you save in n8n is encrypted with N8N_ENCRYPTION_KEY. Lose that key and the credentials become unreadable, even if you still have a perfect database backup. You would have to type every one of them in again by hand.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Store a copy of the key in a password manager, away from the server and away from your backups. A backup and its key sitting in the same folder defeats the point of encrypting anything.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Be careful with what you connect, too. Give each credential only the permissions its workflow needs. A workflow that reads a Google Sheet should not hold a token that can delete your whole Drive. When an integration offers a read only key, take it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Configuring firewall rules and securing exposed ports<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Ubuntu includes ufw, a simple firewall. Allow SSH first, so you do not cut off your own connection, then web traffic, then switch it on.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">sudo ufw allow OpenSSH<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">sudo ufw allow 80\/tcp<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">sudo ufw allow 443\/tcp<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">sudo ufw enable<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">sudo ufw status<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here is a trap that has caught plenty of administrators. Docker edits the firewall rules on its own, and ports it publishes can bypass ufw entirely. A container published on 0.0.0.0 stays open even when ufw says otherwise.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That is exactly why our Compose file publishes n8n\u2019s port as 127.0.0.1:5678:5678. Check what is really listening from outside with sudo ss -tulpn. You should see ports 22, 80 and 443 open to the world and 5678 bound to localhost only. Anything else needs an explanation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Creating automated backups of workflows and database files<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A VPS snapshot is not a backup strategy. Keep copies of the n8n volume somewhere other than the server. This script archives the n8n_data volume and deletes copies older than 14 days.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">nano ~\/n8n-compose\/backup.sh<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">#!\/bin\/bash<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">set -e<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">cd ~\/n8n-compose<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">STAMP=$(date +%F)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">mkdir -p backups<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">docker compose stop n8n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">docker run &#8211;rm -v n8n-compose_n8n_data:\/data -v &#8220;$PWD\/backups&#8221;:\/backup alpine \\<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; tar czf \/backup\/n8n_data_$STAMP.tar.gz -C \/data .<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">docker compose start n8n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">find backups -name &#8220;n8n_data_*.tar.gz&#8221; -mtime +14 -delete<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The volume name starts with your folder name. Run docker volume ls to confirm it matches n8n-compose_n8n_data. Stopping n8n for a few seconds guarantees the SQLite file is not caught mid write. The cost is real, though. A webhook that arrives during those seconds is lost, so schedule the job for your quietest hour.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">chmod +x ~\/n8n-compose\/backup.sh<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">crontab -e<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">0 3 * * * \/home\/deploy\/n8n-compose\/backup.sh<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That cron line runs the script at 3 a.m. every day. Then copy the backups folder off the server with scp or rclone to storage you control. If you run PostgreSQL later, use pg_dump for the database instead.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now the step most people skip. Test a restore. Create a new volume on a spare server or a test VPS, unpack the archive into it, start n8n with your saved encryption key and confirm your workflows appear and credentials still work. A backup you never restored is a guess.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Updating Docker containers and monitoring server performance<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">n8n releases a new minor version most weeks, according to its own documentation. You do not need to chase every one. A monthly update rhythm suits most small servers, and a security notice is the reason to move faster.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Run your backup script and confirm the new archive exists.<\/li>\n\n\n\n<li>Read the release notes for the version you are moving to. Major jumps, such as moving between the 1.x and 2.x lines, can carry breaking changes.<\/li>\n\n\n\n<li>Edit N8N_VERSION in your .env file to the new number.<\/li>\n\n\n\n<li>Run docker compose pull and then docker compose up -d.<\/li>\n\n\n\n<li>Check docker compose logs n8n and open a few workflows to confirm they still run.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Rolling back is not always as simple as setting the old tag again. A new version may migrate the database, and the old version might not read it. If an update goes wrong, restore the backup you took in step one.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For monitoring, point a free uptime monitor at https:\/\/n8n.example.com\/healthz so you hear about outages before your clients do. On the server, docker stats shows memory use per container, df -h shows disk space and docker compose logs &#8211;tail 100 n8n shows recent errors. n8n also publishes monitoring options in its documentation, including metrics for larger setups. Clean up old images now and then with docker image prune.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How Do You Create Your First Workflow and Troubleshoot Common n8n Problems?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Build a small webhook workflow first. Use a Webhook node as the trigger, an Edit Fields node to shape the data and a Respond to Webhook node to send an answer, then test it with curl. If something breaks, check DNS first, then ports, then certificate logs, then the webhook URL setting.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Building a simple automated workflow using trigger and action nodes<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Follow these steps in the editor.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Click to create a new workflow and add a Webhook node. Set the method to POST and the path to hello. Set Respond to \u201cUsing Respond to Webhook Node\u201d.<\/li>\n\n\n\n<li>Add an Edit Fields node after it. Create a field called message and give it the value Hello from my own server.<\/li>\n\n\n\n<li>Add a Respond to Webhook node and connect it to the Edit Fields node.<\/li>\n\n\n\n<li>Click Execute Workflow on the Webhook node. n8n starts listening and shows you a test URL.<\/li>\n\n\n\n<li>From your own computer, call that test URL with curl -X POST and the address n8n shows.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">The reply should contain your message field, and the canvas lights up each node that ran. That one loop proves your DNS, HTTPS, reverse proxy and n8n all work together.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Screenshot to add: the three node workflow on the canvas with green success markers.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Connecting external applications through API credentials<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Credentials live in their own area of the editor. Add one once, then reuse it across workflows. Simple services give you an API key to paste in. Services such as Google or Microsoft use OAuth2, where you approve access through a login screen.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">OAuth is where your HTTPS domain pays off. The provider sends the browser back to a redirect address built from your n8n URL, and most providers refuse plain http addresses. A correct N8N_WEBHOOK_URL fixes most OAuth setup errors.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Workflows that send email need an SMTP account. If you want a dedicated sender for business mail, look at our <a href=\"https:\/\/skynethosting.net\/mailchannels-email.htm\">MailChannels corporate email<\/a> option. Whatever you choose, create the credential, send yourself a test message and confirm it does not land in spam.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Testing workflow executions and understanding execution history<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">n8n gives every webhook two addresses, and mixing them up is the most common beginner mistake. The test URL contains webhook-test and only works while you have clicked Execute Workflow in the editor. The production URL contains webhook and only works after you activate the workflow.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Use the Executions tab to review every run. It lists successes and failures, and you can open any run to see the exact data that moved through each node. That view saves hours of guessing when something breaks.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">n8n stores this history in the database, so it grows over time. By default n8n prunes old executions. Check the pruning settings on the environment variables page and set them to match how long you really need history. Add an Error Trigger workflow too, so failures send you an alert instead of waiting silently.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Fixing common Docker, DNS, HTTPS and webhook errors<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Most problems fall into a small set of patterns. Find your symptom in this table.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><td><strong>Symptom<\/strong><\/td><td><strong>Likely cause<\/strong><\/td><td><strong>What to do<\/strong><\/td><\/tr><\/thead><tbody><tr><td>Site does not load at all<\/td><td>DNS record wrong or ports closed<\/td><td>Run dig +short on the hostname and sudo ufw status. Ports 80 and 443 must be open.<\/td><\/tr><tr><td>Browser warns about the certificate<\/td><td>Traefik could not get a certificate<\/td><td>Run docker compose logs traefik. Look for challenge errors, a proxied CloudFlare record or a blocked port.<\/td><\/tr><tr><td>Webhook shows localhost:5678<\/td><td>Webhook URL setting missing<\/td><td>Set N8N_WEBHOOK_URL and run docker compose up -d again.<\/td><\/tr><tr><td>Credentials will not decrypt<\/td><td>Encryption key changed<\/td><td>Restore the original key in .env from your password manager and restart.<\/td><\/tr><tr><td>Port 80 or 443 already in use<\/td><td>Apache or Nginx installed on the host<\/td><td>Run sudo ss -tulpn to find it, then stop and disable that service.<\/td><\/tr><tr><td>Container restarts in a loop<\/td><td>Bad setting or file permissions<\/td><td>Read docker compose logs n8n. The last lines usually name the problem.<\/td><\/tr><tr><td>Disk space nearly full<\/td><td>Execution history or old images<\/td><td>Check df -h, tighten pruning and run docker image prune.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Work from the outside in. Does DNS point at the server? Are the ports open? Is Traefik healthy? Is n8n healthy? That order finds the fault faster than staring at n8n\u2019s log first.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Choosing between SQLite and PostgreSQL as your automation needs grow<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Stay on SQLite while you run one instance, a modest number of workflows and a handful of users. It needs no setup and your backup is a single volume. Move to PostgreSQL when execution volume grows, several people edit at once, or you want queue mode with workers, which needs PostgreSQL.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><td>&nbsp;<\/td><td><strong>SQLite<\/strong><\/td><td><strong>PostgreSQL<\/strong><\/td><\/tr><\/thead><tbody><tr><td>Setup<\/td><td>Nothing to configure<\/td><td>Extra container and credentials<\/td><\/tr><tr><td>Best for<\/td><td>Learning, personal use, light business use<\/td><td>Heavy executions, teams, scaling<\/td><\/tr><tr><td>Backups<\/td><td>Copy the n8n volume<\/td><td>Use pg_dump on the database<\/td><\/tr><tr><td>Scaling<\/td><td>Single instance<\/td><td>Supports workers and queue mode<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Plan the choice early. n8n\u2019s documentation says existing SQLite data does not carry over automatically when you switch, and it describes the PostgreSQL setup as a fresh instance. That means a late switch involves exporting workflows and credentials and importing them again. Starting on PostgreSQL costs you a few extra minutes on day one.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you choose it, add a database service to your Compose file and point n8n at it with these variables.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; postgres:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp; image: postgres:16<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp; restart: always<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp; environment:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; POSTGRES_USER=${POSTGRES_USER}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; POSTGRES_PASSWORD=${POSTGRES_PASSWORD}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; POSTGRES_DB=n8n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp; volumes:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; db_storage:\/var\/lib\/postgresql\/data<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"># Added under the n8n service environment:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; DB_TYPE=postgresdb<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; DB_POSTGRESDB_HOST=postgres<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; DB_POSTGRESDB_DATABASE=n8n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; DB_POSTGRESDB_USER=${POSTGRES_USER}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; DB_POSTGRESDB_PASSWORD=${POSTGRES_PASSWORD}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Also add db_storage: to the volumes list at the bottom, and add POSTGRES_USER and POSTGRES_PASSWORD to your .env file. Use a long random password. Pin the PostgreSQL version and do not bump it casually later, because a major PostgreSQL upgrade needs a dump and restore.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Your n8n server needs a home that stays fast as it grows. Our <a href=\"https:\/\/skynethosting.net\/nvme-vps.html\">NVMe VPS plans<\/a> pair NVMe storage with Intel Dual Xeon hardware and 24\/7 support from a team that has run servers for over 20 years. If your plan outgrows a VPS, a <a href=\"https:\/\/skynethosting.net\/dedicated-servers.htm\">dedicated server<\/a> is the next step up.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can run n8n on your own server by renting a VPS, installing Docker, starting n8n from a Docker Compose file and putting a subdomain with HTTPS in front of it. Most beginners finish in about an hour. You end up with a private automation server that has no per workflow pricing, and the only [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4653","post","type-post","status-publish","format-standard","hentry","category-skynethostinghappenings"],"blog_post_layout_featured_media_urls":{"thumbnail":"","full":""},"categories_names":{"1":{"name":"Skynethosting.net News","link":"https:\/\/skynethosting.net\/blog\/category\/skynethostinghappenings\/"}},"tags_names":[],"comments_number":"0","wpmagazine_modules_lite_featured_media_urls":{"thumbnail":"","cvmm-medium":"","cvmm-medium-plus":"","cvmm-portrait":"","cvmm-medium-square":"","cvmm-large":"","cvmm-small":"","full":""},"_links":{"self":[{"href":"https:\/\/skynethosting.net\/blog\/wp-json\/wp\/v2\/posts\/4653","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/skynethosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/skynethosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/skynethosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/skynethosting.net\/blog\/wp-json\/wp\/v2\/comments?post=4653"}],"version-history":[{"count":1,"href":"https:\/\/skynethosting.net\/blog\/wp-json\/wp\/v2\/posts\/4653\/revisions"}],"predecessor-version":[{"id":4655,"href":"https:\/\/skynethosting.net\/blog\/wp-json\/wp\/v2\/posts\/4653\/revisions\/4655"}],"wp:attachment":[{"href":"https:\/\/skynethosting.net\/blog\/wp-json\/wp\/v2\/media?parent=4653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/skynethosting.net\/blog\/wp-json\/wp\/v2\/categories?post=4653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/skynethosting.net\/blog\/wp-json\/wp\/v2\/tags?post=4653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}