How to self-host n8n
Date:
Tue, 25 Aug 2026 09:47:17 +0000
Description:
Learn how to self-host n8n with Docker, from picking a server to setting up SSL, PostgreSQL, backups, and updates.
FULL STORY ======================================================================Copy link Facebook X Whatsapp Reddit Pinterest Flipboard Threads Email Share this article 0 Join the conversation Follow us Add us as a preferred source on Google Newsletter Subscribe to our newsletter Frustrated by workflow limits and token-based billing on AI automation platforms? n8n is a fair-code automation platform that you can host on your own device or servers, free
from the usage restrictions that plague cloud-based platforms.
Weve covered n8n on TechRadar before, so head over to our first-time user guide and list of compatible hosting solutions if youre looking for more information. For now, however, Ill walk you through the exact step-by-step process of setting up a self-hosted n8n environment using Docker, Docker Compose, and a Linux-based virtual machine or server. What you'll need for this setup A virtual machine, server, or NAS with at least 2 vCPUs and 4GB of RAM. Heavier workloads will benefit from more CPU cores and memory. A compatible version of Linux installed on your server or machine, such as Ubuntu, Debian, or Raspberry Pi OS. CentOS Stream, Fedora, and RHEL are also supported. Access to the Docker and Docker Compose repositories using your Linux distros package installer. All of this can be installed through the Linux terminal. A managed Kubernetes cluster if you intend to run production-grade workflows (optional). Step-by-step installation guide for self-hosting n8n (Image credit: n8n) 1. Install Docker and Docker Compose Power up your Linux terminal. Then update your Linux software catalog by running this command: Latest Videos From TechRadar Watch full video here:
sudo apt-get update
This will update your software packages, install any necessary certificates, and prep the system for installing Docker. Once done, execute the next
command to install Docker and Docker Compose, along with any dependencies
your system needs: You may like How to automate workflows using open-source
AI agents Why are home servers trending? I took the plunge in an attempt to demystify the jargon Running on-premise in an agentic world
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
You can manually confirm that your Docker engine is installed and running by executing this command: Are you a pro? Subscribe to our newsletter Sign up to the TechRadar Pro newsletter to get all the top news, opinion, features and guidance your business needs to succeed! Contact me with news and offers from other Future brands Receive email from us on behalf of our trusted partners
or sponsors By submitting your information you agree to the Terms &
Conditions and Privacy Policy and are aged 16 or over.
docker --version docker compose version 2. Write your Docker Compose file Create a new directory for your n8n setup, then navigate into it:
mkdir n8n-compose cd n8n-compose What to read next How to set up data breach and dark web monitoring for your business How AI-ready NAS is rewriting enterprise data management I'm a NAS expert here's how to build your own personal cloud for just over $1000
Now, you need to create a new .env file inside the new directory. It should look like this:
DOMAIN_NAME= example.com SUBDOMAIN=n8n GENERIC_TIMEZONE=Europe/London SSL_EMAIL=
[email protected]
Make sure to replace these values with your domain name, time zone, and email address. If youre running n8n locally on your device, you can simply remove the domain name, subdomain, and SSL email fields to leave only the GENERIC_TIMEZONE field in there.
Next up, we need to create a compose.yaml file in the same directory along with the .env file. It should read like this:
services: n8n: image: docker.n8n.io/n8nio/n8n restart: always ports: - "127.0.0.1:5678:5678" environment: - N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME} - N8N_PORT=5678 - N8N_PROTOCOL=https - NODE_ENV=production - WEBHOOK_URL=
https://${SUBDOMAIN}.${DOMAIN_NAME}/ - GENERIC_TIMEZONE=${GENERIC_TIMEZONE} - TZ=${GENERIC_TIMEZONE} volumes: - n8n_data:/home/node/.n8n - ./local-files:/files volumes: n8n_data:
This maps n8n to port 5678 on your device and stores all your workflows, credentials, and encryption key in a Docker volume. Again, if youre
installing locally, you can simply remove the N8N_HOST, N8N_PROTOCOL, and WEBHOOK_URL lines.
In the same directory, create a local-files folder to store all your workflows:
mkdir local-files (Image credit: n8n) 3. Launch n8n You can launch all your Docker Compose containers simultaneously using a single one-line command:
docker compose up -d
After about a minute or so, run this command to see if the containers are up and running:
docker compose logs -f n8n
You can now open the n8n editor at
https://localhost:5678 on your local
device using any web browser. 4. Create a n8n account When you launch the n8n editor in your browser for the first time, it will ask you to create a new account. Enter your email, name, and a password with at least one capital letter and a number. Once you complete the form, youll become the instance owner, which is similar to a super-admin in n8n.
This will give your account full access to every workflow and credential, but you should still set up member-level accounts if you intend to have other people use your instance and want to track changes. 5. Build your first AI workflow Youll now be able to access n8ns workflow editor. This is a node-based visual interface that looks a bit like a flowchart with the option to add triggers and actions to create complex automations. If youve used a tool like Zapier or Make before, it shouldnt take you long to figure out the basics.
n8n lets you use the Execute step button to trigger different parts of a workflow during editing, which is useful in testing and troubleshooting. Once youre confident that everything works, you can save the workflow and toggle
it on so that it stays active. (Image credit: n8n) FAQs Is n8n open-source?
n8n isnt open-source but free-to-use with certain limitations. Its
distributed under a fair-code license that lets you use the platform for personal or internal business workflows free of cost. If you wish to commercialize it as a consumer-facing product, however, youll need to pay for a commercial license. Does it cost anything to self-host n8n?
Theres some cost involved in setting up a self-hosted n8n environment, but
its much less compared to how much youd pay with a cloud-based automation platform with a subscription. Your only expenses here are your hosting costs for the server you use, but even that can be removed if you have a powerful enough local rig that can run workflows on its own. Does n8n come with its
own database?
n8n comes pre-loaded with SQLite on with every installation, which is fine
for internal use. If you want to run production workflows, however, Id recommend switching to PostgreSQL, which can better support complex
multi-user workflows. How do I keep my n8n instance secure?
Make sure to run your n8n instance over an HTTPS connection instead of plain HTTP. If youre using an external server or a local network thats shared by other users, take extra care to keep your encryption keys secure and do not put them directly in your .env file. Depending on your server configuration, you can use a secret manager like Azure Key Vault or Google Cloud Secret Manager to avoid attackers from reading your API keys by scanning the source code in plain text.
======================================================================
Link to news story:
https://www.techradar.com/pro/how-to-self-host-n8n
--- Mystic BBS v1.12 A49 (Linux/64)
* Origin: tqwNet Technology News (1337:1/100)