Guide, 2026
Self-hosted AI agents. Pick the right one, then give it a server that never sleeps.
“Best self-hosted AI agent” lists rarely say which licence lets you sell it, which ones are archived, or what the project itself says about memory. Here’s each of those, from the projects’ own docs.
Self-hosted agents, and the server each needs
- OpenClawChat apps, MIT2 GB
- n8nWorkflows, own-use licenceLite 2
- DifyVisual apps, stated minimum4 GiB
RAM as each project states it, where it states one.
Run your agent on a Lite 2
$4
- OpenClaw
- Hermes Agent
- n8n
- Dify
- Langflow
- CrewAI
2 vCPU, 2 GB, 40 GB NVMe. Billed by the hour, paid in crypto.
The short answer
Pick by what you want the agent to do. An assistant you message from Telegram or WhatsApp: OpenClaw or Hermes Agent. Automations across your apps: n8n. Chatbots and document search built visually: Dify or Langflow. Agents in your own Python code: CrewAI or LangGraph.
Most of them run on a 2 GB server when the model is a hosted API; Dify asks for 4 GiB. Running the model on the same server is what needs real memory: 16 GB for an 8B model on CPU.
A self-hosted agent is software on your own server that takes a goal, calls a model, and uses tools: your inbox, your files, an API, a browser. It runs while you sleep, and your data and keys stay on a machine you control.
The choice that matters most isn’t the framework. It’s where the model runs, because that decides the size of the server and the size of the bill.
In this guide you’ll learn
- A picker that names the platform and the server
- Ten platforms compared on licence, memory and login
- Sizing: hosted model or local model
- Security before you open it to the internet
- Running 24/7, and knowing when it stops
Chapter 1
Which agent should you self-host?
Say what you want it to do, where the model runs, and whether you’ll sell it to others. That last one rules some platforms out by licence.
Your pick
OpenClaw on a Lite 2
An always-on assistant you talk to in Telegram, WhatsApp, Discord and other chat apps. Licence: MIT. Also look at Hermes Agent.
Chapter 2
Ten self-hosted agent platforms, compared
Every figure below is what the project itself publishes. Where it publishes nothing, the table says so instead of guessing.
| Platform | Best for | Licence | Memory it states | Login out of the box |
|---|---|---|---|---|
| OpenClaw | An assistant in your chat apps | MIT | 1 GB minimum, 2 GB+ recommended | Gateway listens on the server only |
| Hermes Agent | An assistant in your chat apps | MIT | None stated | Chat users denied until allowlisted |
| n8n | Workflow automation with an AI Agent node | Sustainable Use License | None stated | Owner account on first visit |
| Dify | Chatbots, agents and document search | Dify Open Source License | 2 cores, 4 GiB | Admin set up at /install |
| Langflow | Visual flows served as an API | MIT | 2 GB minimum, 4 GB recommended | Required in official Docker images |
| CrewAI | Teams of agents in Python | MIT | None stated | No interface: a library |
| LangGraph | Stateful agents in Python | MIT | None stated | No interface: a library |
| Microsoft Agent Framework | Agents in Python or .NET | MIT | None stated | No interface: a library |
| Open WebUI | A private ChatGPT for you or a team | Open WebUI License | None stated | First account becomes admin |
| AnythingLLM | Private chat with documents and agents | MIT | 2 GB and 2 cores with AVX2, recommended | Multi-user mode optional |
The licences, in plain words. MIT lets you do almost anything, including selling a service built on it. n8n’s licence covers your own internal business, not selling n8n itself as a service. Dify’s bars a multi-tenant service and removing its logo without permission. Open WebUI’s keeps its branding once you pass 50 users.
Chapter 3
What server does an AI agent need?
An agent calling a hosted model is light: the server holds the agent, its memory and its tools, and the thinking happens at the model provider. An agent with its own model on the same server is heavy.
| Setup | What uses the memory | Start on |
|---|---|---|
| One agent, hosted model | The agent and its tools | Lite 2: 2 vCPU, 2 GB, $4 a month |
| Several agents, a database, or Dify and Langflow | Several services side by side | Lite 6: 6 GB, $8 a month |
| A local model for the agent | The model, loaded in RAM | Lite 16: 16 GB, $20 a month |
With a hosted model, the model bill is separate and usually the bigger number: you pay the provider per token. Our agent cost calculator prices both. With a local model there’s no token bill, but answers on CPU are slower; see private AI server for what fits.
Chapter 4
Secure it before you open it
Several of these platforms make the first person who opens them the admin. On a fresh public server, that should be you, and quickly.
- Claim the admin account firstHow to check: Open WebUI makes the first account the administrator, n8n creates its owner on first visit, and Dify sets its admin at /install. Do it the moment the app is up.
- Keep dashboards off the open internetHow to check: Bind them to 127.0.0.1 and reach them over an SSH tunnel, or put HTTPS and a login in front. OpenClaw keeps its gateway on the server by default; run
openclaw security auditafter changes. - Allowlist who can talk to itHow to check: A chat agent answers anyone who finds it unless you limit it. Hermes Agent, for one, denies every chat user until you allowlist them.
- Keep keys out of the codeHow to check: API keys go in an environment file only the agent’s user can read (
chmod 600), never in a repository. - Treat incoming messages as untrustedHow to check: Anyone who can message the agent can try to steer it. Give it only the tools it needs, and no production passwords.
- Separate what must not mixHow to check: One OpenClaw gateway runs several agents; its docs suggest separate servers only when agents must be strictly isolated.
The server underneath needs the basics too: a firewall and fail2ban, and key-only SSH.
Chapter 5
Run your agent 24/7
“Always on” means it comes back after a crash or a reboot, and you find out when it doesn’t.
- Restart on failureHow to check: Docker apps:
restart: unless-stoppedin the compose file. Native installs: a systemd service withRestart=always. OpenClaw sets this up withopenclaw onboard --install-daemon. - Pin versionsHow to check: Use a version tag, not latest, so an update never changes your agent overnight. Update on purpose, after reading the release notes.
- A heartbeat from outsideHow to check: A free uptime monitor that checks a URL or receives a ping every few minutes tells you when the agent stops, before your users do.
- Back up its memoryHow to check: The agent’s data folder holds its history, settings and often an encryption key. Back it up with the database.
Now it’s your move
Pick the agent by the job, check its licence if you’ll sell it, and size the server by where the model runs. Then claim the admin account before anyone else does.
Start on a Lite 2, or go straight to OpenClaw or n8n in one click. Coding agents? See Claude Code on a VPS. Giving agents your own tools? Host an MCP server.