n8n is the usual answer when someone wants to wire a local model into real automation — trigger on an email, pull a document, ask the model, write the result somewhere. Self-hosting it is genuinely easy. The part almost every tutorial skips is that n8n is not open source in the sense people assume, and its licence says something specific about what you may do with it. This guide covers the setup, the local-AI wiring, and the licence in the words it actually uses.
Quick answer
- Self-hosting is supported and documented, with Docker the standard route.
- The licence is the Sustainable Use License, not MIT or Apache. GitHub cannot classify it and reports the repository as
NOASSERTION. - Internal business use is fine. Selling access is not. That is the whole distinction.
- Some source files are excluded entirely — anything with
.ee.in its name needs an enterprise licence.
The licence, before the setup
This belongs first because it decides whether the rest is useful to you. n8n describes itself as “fair-code”, which is not an OSI term. The repository has more than 205,000 stars and is pushed to daily, but its LICENSE.md is a custom document.
The operative sentence of the Sustainable Use License, Version 1.0 is short:
“You may use or modify the software only for your own internal business purposes or for non-commercial or personal use. You may distribute the software or provide it to others only if you do so free of charge for non-commercial purposes.”
n8n’s own documentation gives worked examples on both sides, which is more useful than the legal text. Permitted: “Using n8n to sync the data you control as a company, for example from a CRM to an internal database”, “Creating an n8n node for your product”, and “Providing consulting services related to n8n”. Not permitted, where the value “derives entirely or substantially from n8n functionality”: “White-labeling n8n and offering it to your customers for money” and “Hosting n8n and charging people money to access it”.
So: running it inside your own company to automate your own work is squarely allowed, including commercially. Reselling it as a service is not.
🔴 Two exclusions that are easy to miss, both stated at the top of the licence file before the Sustainable Use License begins. Source files with .ee. in the filename or .ee in the directory name are not covered — using those requires “a valid n8n Enterprise License”. And “Content of branches other than the main branch (i.e. ‘master’) are not licensed”, which matters if you were planning to build from a feature branch.
Running it with Docker
Docker is the documented default. The thing worth getting right on the first run is the volume: without one, your workflows and credentials live inside the container and disappear when you replace it.
docker volume create n8n_data
docker run -d --name n8n \
-p 127.0.0.1:5678:5678 \
-e N8N_RUNNERS_ENABLED=true \
-v n8n_data:/home/node/.n8n \
docker.n8n.io/n8nio/n8n
Note the published port is bound to 127.0.0.1 rather than left open. Publishing a port in Docker exposes it beyond the host by default, which is the same trap covered in our Ollama server and Docker guide — and it matters more here, because an automation platform holds credentials for everything it connects to. That combination — a model that can act, holding credentials — is what OWASP calls excessive agency; see securing a local LLM.
If you need it reachable from other machines, put a reverse proxy in front that terminates TLS and handles authentication, rather than widening the bind.
Wiring it to a local model
The reason to self-host both halves is that neither the automation nor the inference leaves your network. n8n reaches Ollama over HTTP, so the two only need to see each other.
The detail that causes most first-run failures: localhost inside a container is the container, not your host. If n8n is containerised and Ollama is running natively, the base URL is http://host.docker.internal:11434 on Docker Desktop, or the host’s address on a Linux bridge network. Pointing it at http://localhost:11434 will simply fail to connect, and the error does not explain why.
Once connected, the useful shapes are the obvious ones — classify an incoming message, summarise a document, extract fields into JSON. For structured extraction specifically, constrain the output rather than hoping: our guide to using Ollama with LangChain covers the same problem in code, and the reasoning applies here.
Context is the thing that will bite you
Automation sends larger prompts than chat does. A workflow that pastes in an email thread, a retrieved document and a system prompt can exceed the model’s context window without any visible error — the oldest content is simply dropped, and the model answers confidently from what is left.
Ollama derives its default context length from available VRAM, and on cards below 24 GiB that default is 4,096 tokens. That is small for this kind of work. Raising it costs memory in direct proportion — see what a context window costs in VRAM for the arithmetic, and size your specific model with the VRAM calculator before raising it.
What to run it on
n8n itself is light — it is a Node application whose job is mostly waiting. The hardware question is entirely about the model behind it. A workflow that runs a few times an hour has very different requirements from one processing a queue continuously, because the model has to stay resident to be responsive.
Start with how much RAM and VRAM you need for the floor, and self-hosted AI for what keeping the whole chain local does and does not protect. If the workflow is answering questions over your own documents, building a private RAG chatbot covers the retrieval side properly.
FAQ
Is n8n free to self-host?
Yes, under the Sustainable Use License, for your own internal business purposes or for non-commercial and personal use. You may not host it and charge others for access.
Is n8n open source?
Not in the OSI sense. n8n calls it “fair-code”. GitHub reports the repository licence as NOASSERTION because the Sustainable Use License is a custom document.
Can I use n8n commercially?
Inside your own organisation, yes — the licence explicitly permits internal business use, and the docs list consulting services as allowed. What is prohibited is selling a product or service whose value derives substantially from n8n itself.
Why can’t n8n reach Ollama?
Almost always because the workflow points at localhost from inside a container, which resolves to the container itself. Use host.docker.internal on Docker Desktop, or the host’s address on Linux.
What are the .ee. files?
Enterprise-licensed source. The licence file states that files containing .ee. in the filename or .ee in the directory name are not covered by the Sustainable Use License and require a valid n8n Enterprise License.
Sources
- n8n
LICENSE.mdin the repository main branch — Sustainable Use License v1.0, the.ee.exclusion and the unlicensed-branches clause, read 22 September 2026 - n8n documentation: community licence (the permitted and prohibited examples quoted above) and install with Docker
Updated 22 September 2026. Licence terms were read from the repository and documentation on that date. Licences change — check before you build a business on one.
Work out what your hardware can actually run
Free calculators and directories, sized from real model weights — before you download gigabytes or order a card:

