Module 1: From Chatbot to Agent: What Changes with Agentic AI
7. Where you'll run your agents: self-hosted Community vs Cloud
Description
By the end of this lesson you'll be able to decide, with real numbers and not intuition, where your n8n agent runs: on your own infrastructure (self-hosted, Community edition) or on n8n's managed cloud (Cloud). And you'll leave an n8n instance running on your machine, ready for you to build your first AI Agent node on it in the next capsule.
This decision matters because the agentic loop you saw in the previous lesson — the agent reasoning, calling tools, observing results — can run dozens or hundreds of times for a single task you give it. If you're paying per execution without knowing how many you're going to run, you're betting blind: a freelancer automating internal tasks for three clients doesn't have the same cost profile as a 200-person company that needs its support and sales teams to share credentials under a single corporate login.
Connection to the module: this lesson closes the theoretical framework that started with "agent vs chatbot vs procedural AI" and continued with "when to use an agent." You already know what to build and when it makes sense to build it. Now you resolve where it runs, so the mini-project in the next lesson can start directly on a working instance, with no infrastructure friction halfway through the exercise.
Community, Cloud, and Enterprise: the same application, three ways to run it
Imagine you need a car for daily deliveries. You can buy it (you maintain it, it's yours, the cost is the car plus gas), you can use a per-trip driver service (you pay per delivery, zero maintenance), or you can hire a corporate fleet with a fleet manager, insurance, and consolidated reporting (for when it's no longer one car, it's forty). n8n offers exactly those three ways of running the same software.
n8n is distributed under the Sustainable Use License (SUL) v1.0. In practical terms, that license lets you use, copy, modify, and self-host n8n for free for your business's internal use or for non-commercial use — but it prohibits you from reselling it or hosting it as a managed service for third parties (that does require an Enterprise license, as would apply to someone wanting to offer "n8n as a service" to their own customers). Files with .ee. in the name inside the repository are the exception: they belong to the Enterprise package and need a separate license to activate, even in a self-hosted install.
The three ways to run n8n, then:
- Community (self-hosted): free, you manage the server. Includes practically the entire node set — including the AI nodes (AI Agent, chat models, tools, memory) — plus basic logging and queue mode for scaling executions.
- Cloud: n8n manages the infrastructure for you. You pay a monthly subscription with an execution limit and, on the mid-tier plans, "AI credits" included for model usage.
- Enterprise (self-hosted or Cloud Business/Enterprise): adds what an organization needs once it's no longer one person operating agents, but several teams: SSO/SAML/LDAP, projects with per-team permissions, sharing workflows and credentials between users, external variables and secrets, log streaming, high availability (multi-main), and version control via Git.
Notice something important: the AI nodes are not on the list of Enterprise-exclusive features. That's not an oversight — it's the signal that the agentic loop you built in the previous lesson isn't a premium feature. It's part of the core, available in the free edition.
The default decision: Community self-hosted
For the profile this guide targets — a person or small team building their first agents — Community self-hosted is the right starting point, and not out of "open source first" dogma, but because of the numbers:
| Community (self-hosted) | Cloud Starter | Cloud Pro | |
|---|---|---|---|
| License cost | $0 | ~US$20/month (billed annually) | ~US$50/month (billed annually) |
| Executions included | Unlimited (limited by your own server) | 2,500/month | 10,000/month |
| AI nodes (AI Agent, tools, memory) | Included | Included | Included |
| Additional real cost | Small VPS (~US$5-6/month) + whatever you spend on the model | AI credits included (2,300/month), extra if you go over | AI credits included (up to 13,700/month) |
| SSO, shared projects, Git | No | No | No (only from Business/Enterprise up) |
If you're prototyping — which is exactly what you'll do in the next lesson's mini-project — paying a recurring subscription before you know how many executions you're going to need means spending upfront on something a few-dollar-a-month server already handles. The math changes once execution volume grows a lot (Cloud saves you the server's operation) or once the problem stops being technical and becomes organizational (several teams need to share credentials under a single corporate login — at that point you're already talking about Enterprise, whether self-hosted or Cloud Business).
Worked example: spinning up your self-hosted instance with Docker
Let's get n8n running locally with Docker Compose, with two configuration decisions almost every tutorial skips and that are going to save you a real headache down the road.
First, generate a fixed encryption key (without this, n8n generates a random one on first startup, and if you ever move or restore the instance without that key, you lose access to every saved credential — your model API keys included):
openssl rand -base64 32
Save the result in an .env file next to your docker-compose.yml:
# .env — fixed encryption key, don't regenerate it each time
N8N_ENCRYPTION_KEY=paste_the_generated_key_here
Now the Compose file:
# docker-compose.yml
services:
n8n:
image: docker.n8n.io/n8nio/n8n
restart: unless-stopped
ports:
- "5678:5678"
environment:
- GENERIC_TIMEZONE=America/Mexico_City
- TZ=America/Mexico_City
- N8N_ENCRYPTION_KEY=${N8N_ENCRYPTION_KEY}
- N8N_RUNNERS_ENABLED=true
- N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
volumes:
- n8n_data:/home/node/.n8n
volumes:
n8n_data:
Bring it up:
docker compose up -d
What to expect: the command downloads the image the first time (a few seconds to a couple of minutes depending on your connection) and starts the container. In the logs (docker compose logs -f n8n) you'll see a line like:
Editor is now accessible via:
http://localhost:5678
Open that URL in your browser. The first time, it asks you to create the instance owner account (name, email, password) — that's local, it isn't sent to any n8n server. Then you land on the empty canvas. To confirm the AI nodes are there at no extra cost, click "+" to add a node and search for "AI Agent" in the search box: it shows up right alongside nodes like HTTP Request or Code, with no lock icon or paid-plan warning. That instance — with data persisted in the n8n_data volume — is the one you'll use in the next lesson to build your first agent.
What's left for Cloud or Enterprise
It's not that Community is "the cheap version" — it's that Cloud and Enterprise solve different problems, which you probably don't have yet:
- Operations: if you don't want to manage updates, backups, or the server itself, Cloud takes that off your plate in exchange for the monthly subscription.
- Team, not individual: as soon as you need two or more people to share credentials and workflows with different permissions per project, or for access to be controlled from your corporate identity provider (SSO/SAML/LDAP), that lives in Enterprise — self-hosted with an Enterprise license, or Cloud on the Business plan and up.
- Traceability and compliance: log streaming to a SIEM, version control via Git, high availability with multi-main — organizational features, not features for an individual agent.
None of these solve anything you need for the next lesson's mini-project. You're going to need them the day your prototype turns into a service other people on the team depend on.
Common mistakes
1. Thinking self-hosted is a stripped-down version of the AI (conceptual). It's easy to assume that if something is free, the AI engine must be limited or degraded compared to Cloud. You already saw it in the feature table: the AI nodes aren't on the Enterprise-exclusive list. The agentic loop — model, prompt, tools, memory — is identical in Community and in Cloud. What changes is who manages the server, not what the agent can do. To spot it: if someone tells you "the agent performs worse on self-hosted," ask them to point to the exact line in the feature documentation — they won't find it.
2. Not setting N8N_ENCRYPTION_KEY before saving the first credential. If you let n8n generate the key on its own and later move the container to another server, restore from a backup of the volume without the key, or rebuild the container without the same .env file, every saved credential (including your model API keys) becomes undecipherable. You spot it because n8n starts up fine but nodes with saved credentials fail with authentication errors that didn't happen before. It's fixed by setting the key from the very first startup, as in the example above, and backing up the .env file along with the volume.
3. Confusing "self-hosted" with "entirely free" (conceptual). Self-hosted eliminates the cost of n8n's license, not the total cost of operating an agent. You still pay for the server (even if it's a few-dollar VPS) and, above all, you still pay for every call to the language model if you use a provider via API. The real comparison against Cloud isn't "$0 versus $20/month" — it's "VPS + model consumption" versus "Cloud subscription + its included AI credits." Ignoring this leads to underestimating the real cost of an agent that makes many model calls per execution.
Exercises
Exercise 1. You're a freelancer automating internal tasks for three of your clients: one agent that summarizes emails, another that classifies support tickets. Between the two, you estimate around 500 executions a month. Nobody but you is going to touch that instance. Community self-hosted or Cloud Starter? Justify your answer with at least one number from this lesson's table.
See solution
Community self-hosted. Cloud Starter costs around US$20/month billed annually and includes 2,500 executions — well above the 500 you need, meaning you'd be paying for capacity you don't use. A small VPS (~US$5-6/month) covers 500 monthly executions without a problem, and you don't need any of the team features (SSO, shared projects) that would justify paying more. It works because at this volume, Cloud's fixed cost doesn't get diluted — you'd be paying for idle capacity.
Exercise 2. A 40-person company wants its support and sales teams to share certain workflows and credentials, with access controlled from the corporate identity provider (Google Workspace via SSO). Is Community self-hosted enough? If not, what's missing and where does that feature live?
See solution
It's not enough. Community only lets the instance owner and whoever creates each workflow or credential see it — there are no shared projects between users, no SSO/SAML/LDAP. Both features are Enterprise-exclusive, whether self-hosted with an Enterprise license or Cloud on the Business plan and up. It works because the problem is no longer technical (running the agentic loop) but organizational (who sees which credential), and that access-control layer is precisely what separates Community from Enterprise.
Exercise 3. Complete the docker-compose.yml below by adding the missing line so saved credentials survive if you ever rebuild the container on another server, and explain in one sentence why it's necessary.
services:
n8n:
image: docker.n8n.io/n8nio/n8n
ports:
- "5678:5678"
environment:
- GENERIC_TIMEZONE=America/Mexico_City
# a line is missing here
volumes:
- n8n_data:/home/node/.n8n
volumes:
n8n_data:
See solution
- N8N_ENCRYPTION_KEY=${N8N_ENCRYPTION_KEY}
It's necessary because n8n uses that key to encrypt credentials before saving them to the database; if you don't set it, n8n generates a random one per instance, and moving or rebuilding the container on another server without that same key leaves the saved credentials undecipherable.
Summary and next step
You learned that n8n is distributed under the Sustainable Use License, that Community self-hosted includes the complete agentic loop at no license cost, and that Cloud and Enterprise solve operational and team problems — not agent-capability problems. You spun up a local instance with Docker Compose, with a fixed encryption key from the very first startup, and confirmed the AI Agent node is there, available.
Before moving on you should be able to: explain to a colleague, with numbers, why Community is enough for prototyping your own agents; identify the point at which a team needs to move to Enterprise; and have that n8n instance running at http://localhost:5678, ready to receive a workflow.
That instance is exactly where the next lesson starts: you're going to open the canvas, drag in the AI Agent node, connect it to a current model, and try out the full agentic loop — reason, act, observe — talking to yourself in n8n's built-in chat.
Resources
- Choose how to use n8n — official comparison between Cloud, self-hosted, and licensing.
- Community Edition features — the exact list of what's left out of Community.
- Sustainable Use License v1.0 (n8n on GitHub) — the license's full legal text.
- Install n8n with Docker — the official, up-to-date command, image, and recommended variables.
- Set a custom encryption key — why and how to set
N8N_ENCRYPTION_KEY. - n8n Pricing — current Cloud plans, execution limits, and AI credits.