This guide explains how to run n8n-claw locally on your machine using Docker and ngrok — no VPS required. Ideal for testing and development.
Tested on: Debian 13 (KDE) with Docker and ngrok already installed.
Scope of this guide: This setup was tested for core agent functionality — Telegram chat, task management, web search, web reader, reminders, and basic memory. Some advanced features (MCP Builder, WorkflowBuilder, Agent Library, semantic memory search, voice/photo support) require additional configuration documented below but were not fully tested in the local environment. See the notes in each relevant section.
- Docker installed and running
- ngrok installed and authenticated — follow the official quickstart guide for your OS
- A Telegram bot token — create one via @BotFather
- Your Telegram Chat ID — get it from @userinfobot
- An Anthropic API key — from console.anthropic.com (pay-as-you-go, no subscription needed — $5 credit is enough for months of testing)
Note: The official
setup.shscript (located in the repo root) is designed for a fresh Linux VPS running as root. It automates everything: system updates, Docker install, credential creation, workflow import, placeholder substitution, workflow wiring, and agent activation. For local Docker setups, follow this guide instead — it replaces the automated script with manual steps that work on any machine.
Open a terminal and navigate to the folder where you want to install n8n-claw. The clone command will create a new n8n-claw subfolder in whatever directory you are currently in.
For example, to install on your Desktop:
cd ~/Desktop
git clone https://github.com/freddy-schuetz/n8n-claw.git
cd n8n-clawOr in your Home directory:
cd ~
git clone https://github.com/freddy-schuetz/n8n-claw.git
cd n8n-clawEverything — Docker configuration, workflow files, database migrations — lives inside the
n8n-clawfolder. When you're done testing, deleting this folder (along with Docker volumes) removes everything cleanly. All subsequent commands in this guide must be run from inside this folder.
The workflow JSON files and the SearXNG config contain placeholder strings that setup.sh normally replaces automatically. In a local setup, you must do this before importing anything into n8n.
You need your public URL before running the substitution:
ngrok http 5678Copy the https:// URL shown (e.g. https://abc123.ngrok-free.app). Keep this terminal open — the ngrok tunnel must stay open for the entire session. If ngrok stops, Telegram webhooks stop working and the agent won't respond.
setup.sh extracts this value from credential-form.json before import. Do the same locally:
python3 -c "
import json
wf = json.load(open('workflows/credential-form.json'))
for n in wf.get('nodes', []):
if n.get('webhookId'):
print(n['webhookId'])
break
"Copy the output — you'll need it in the next command.
Run this command replacing the placeholder values with your own:
find workflows/ -name "*.json" -exec sed -i \
's|{{SUPABASE_URL}}|http://kong:8000|g;
s|{{SUPABASE_SERVICE_KEY}}|eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoic2VydmljZV9yb2xlIn0.M2d2z4SFn5C7HlJlaSLfrzuZim_14wxiQEyFBMeOkSQ|g;
s|{{SUPABASE_ANON_KEY}}|eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiJ9.ZopqoUt20nEV8rw6HtnRmNIyOFZE1dIknwpBI9gn06w|g;
s|{{N8N_URL}}|https://YOUR-NGROK-URL|g;
s|{{N8N_INTERNAL_URL}}|http://172.17.0.1:5678|g;
s|{{N8N_API_KEY}}|YOUR-N8N-API-KEY|g;
s|{{TELEGRAM_CHAT_ID}}|YOUR-TELEGRAM-CHAT-ID|g;
s|{{CREDENTIAL_FORM_WEBHOOK_ID}}|YOUR-CREDENTIAL-FORM-WEBHOOK-ID|g' {} \;Replace:
https://YOUR-NGROK-URL→ your ngrok URLYOUR-N8N-API-KEY→ generate this in Step 6, then re-run this command with the real valueYOUR-TELEGRAM-CHAT-ID→ your Telegram Chat IDYOUR-CREDENTIAL-FORM-WEBHOOK-ID→ the value from Step 2b
This patches all workflow JSON files in one pass. Without this step, all tools that interact with the database (Memory Save, Memory Search, Task Manager, Reminder, etc.) will silently fail with an unknown error when triggered. The internal database URL is
http://kong:8000— nothttp://localhost:8000— because inside the Docker network, containers reach each other by service name as defined indocker-compose.yml.
setup.sh also generates a secret key for SearXNG. Do the same locally:
SEARXNG_SECRET=$(openssl rand -hex 32)
sed -i "s|{{SEARXNG_SECRET_KEY}}|${SEARXNG_SECRET}|g" searxng/settings.ymlWithout this, SearXNG may fail to start or refuse requests. Web search will not work.
Kong is the API gateway that sits in front of PostgREST and controls authenticated access to the database. Generate its config manually:
sed 's/{{SUPABASE_ANON_KEY}}/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiJ9.ZopqoUt20nEV8rw6HtnRmNIyOFZE1dIknwpBI9gn06w/g; s/{{SUPABASE_SERVICE_KEY}}/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoic2VydmljZV9yb2xlIn0.M2d2z4SFn5C7HlJlaSLfrzuZim_14wxiQEyFBMeOkSQ/g' supabase/kong.yml > supabase/kong.deployed.ymlWithout
kong.deployed.yml, the Kong container fails to start and no workflow can reach the database.The keys used here are the standard Supabase self-hosted development keys, publicly documented by Supabase as safe defaults for local and non-production environments. Source: supabase.com/docs/guides/self-hosting/docker#generate-api-keys. Do not use them in production.
cp .env.example .envOpen .env and fill in the minimum required values. Add N8N_API_KEY as an empty line — you will fill it in Step 6 after generating it from the n8n UI:
# n8n — update with your ngrok URL from Step 2
N8N_URL=https://YOUR-NGROK-URL
N8N_INTERNAL_URL=http://172.17.0.1:5678
N8N_HOST=localhost
N8N_PROTOCOL=http
N8N_WEBHOOK_URL=https://YOUR-NGROK-URL
N8N_API_KEY=
# Generate any random string for these two
N8N_ENCRYPTION_KEY=localtest123xyz456abc
POSTGRES_PASSWORD=localtest123
# Supabase — use the same keys from Step 3
SUPABASE_URL=http://localhost:8000
SUPABASE_JWT_SECRET=super-secret-jwt-token-for-local-testing
SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiJ9.ZopqoUt20nEV8rw6HtnRmNIyOFZE1dIknwpBI9gn06w
SUPABASE_SERVICE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoic2VydmljZV9yb2xlIn0.M2d2z4SFn5C7HlJlaSLfrzuZim_14wxiQEyFBMeOkSQ
# Telegram
TELEGRAM_BOT_TOKEN=your_bot_token
TELEGRAM_CHAT_ID=your_chat_id
# Anthropic
ANTHROPIC_API_KEY=your_anthropic_key
# Timezone
TIMEZONE=Europe/Rome
N8N_ENCRYPTION_KEYencrypts stored credentials — never change it after first run or all saved credentials become unreadable.setup.shgenerates it withopenssl rand -hex 16; a fixed string works fine for local testing.
The following were not tested in this local setup. The core agent works fully without them.
| Variable | Feature | Status in local test | How to enable |
|---|---|---|---|
EMBEDDING_API_KEY |
Semantic memory search (RAG) — finds memories by meaning. Without it, memory works with keyword search only. | OpenAI, Voyage AI (free tier), or Ollama locally. Set EMBEDDING_PROVIDER accordingly. |
|
| OpenAI API key | Voice transcription (Whisper) + photo analysis (GPT-4o Vision) | Add real OpenAI key to OpenAI API credential in n8n |
|
BRAVE_API_KEY |
Alternative web search for MCP Builder | Free at brave.com/search/api — 2,000 req/month | |
NEXTCLOUD_URL/USER/PASS |
CalDAV calendar integration | Requires a running Nextcloud instance | |
VEXA_API_KEY |
Meeting intelligence | Requires a running Vexa instance |
docker compose up -dUse
docker composewithout hyphen — Docker Compose v2 syntax. On first run, Docker downloads all required images — this may take a few minutes.
Verify everything is running:
docker compose psYou should see all containers with status Up or healthy:
n8n-claw— the n8n workflow enginen8n-claw-db— PostgreSQL databasen8n-claw-rest— PostgREST, auto-generates a REST API from the databasen8n-claw-kong— API gateway, handles authentication for database requestsn8n-claw-studio— Supabase Studio, web UI for browsing the databasen8n-claw-meta— Postgres Meta, used internally by Supabase Studion8n-claw-crawl4ai— web crawler that returns clean markdown from any URLn8n-claw-searxng— self-hosted meta search engine, no API key neededn8n-claw-email-bridge— IMAP/SMTP bridge for email integration
The database schema is applied automatically by the PostgreSQL container on first start, via the migration files in
supabase/migrations/. This includes all tables (soul,user_profiles,agents,tasks,reminders,memory_long,mcp_registry, etc.) and seed data.
- Open http://localhost:5678
- Create your admin account (save your password!)
- Go to Settings → n8n API → Create an API key
- Copy the key and add it to your
.env:
N8N_API_KEY=the_key_you_just_generatedThen restart n8n:
docker compose restart n8nNow that you have the real N8N_API_KEY, you must re-run the substitution command from Step 2c with the actual value. This is required for the MCP Builder and Self Modify tools to work correctly.
find workflows/ -name "*.json" -exec sed -i \
's|YOUR-N8N-API-KEY|the_key_you_just_generated|g' {} \;Replace the_key_you_just_generated with your actual API key.
setup.shcollects the API key interactively before doing any substitution, so it never has this two-pass problem. In the local setup, we must generate the key first and then patch the workflows — do not skip this step or MCP Builder and Self Modify will fail silently.
Import order matters — follow this exact sequence so that sub-workflows exist before the workflows that call them:
- mcp-client
- reminder-factory
- reminder-runner
- mcp-weather-example (🌤️ MCP: Weather)
- workflow-builder
- mcp-builder
- mcp-library-manager
- agent-library-manager
- sub-agent-runner
- credential-form
- memory-consolidation
- background-checker
- heartbeat
- n8n-claw-agent (last)
To import: click the three dots menu (⋮) in the top right of the n8n UI → Import from file, then select each .json file from the workflows/ folder.
The Agent workflow is imported last because all other workflow IDs must exist before wiring its internal references in Step 9.
Create credentials directly from the nodes inside the workflows.
Open the 🤖 n8n-claw Agent workflow and connect credentials by clicking on each node that requires them:
- Anthropic node → Anthropic API credential → enter your API key
- Telegram Trigger node → Telegram Bot credential → enter your bot token
- Postgres nodes → Postgres credential with:
- Host:
db— Port:5432— Database:postgres— User:postgres - Password: your
POSTGRES_PASSWORDfrom.env - SSL:
disable
- Host:
Also open 🏗️ MCP Builder and 🧠 Sub-Agent Runner and connect the same Anthropic and Postgres credentials there.
The host
dbrefers to the PostgreSQL container by its Docker service name — notlocalhost— because inside the Docker network each container is reached by its service name as defined indocker-compose.yml.
Note on credentials in workflows: When opening a workflow, you may see a warning that credentials are not set even though you already created them. This is a display glitch — simply open the affected node and close it again without making changes. n8n will refresh the credential state and the warning will disappear.
After connecting credentials in MCP Builder, open the workflow, click the LLM node, and select Anthropic API as the chat model. This is not linked automatically.
⚠️ Not fully tested in local setup — MCP Builder requiresN8N_API_KEYandN8N_INTERNAL_URLto be correctly substituted (Step 2c) and needs to reach the n8n API from inside the Docker network.
WorkflowBuilder requires the community node n8n-nodes-claude-code-cli to be installed first (Settings → Community Nodes). Without it, the workflow cannot be published. This feature is optional and was not tested in the local setup — skip it for now.
Create a placeholder OpenAI credential with a fake key (e.g. sk-fake123) — this allows workflows to publish without errors. Voice and photo nodes will fail if triggered, but the rest of the agent works normally. Replace with a real key when you want to enable those features.
setup.sh replaces all REPLACE_*_ID placeholders programmatically. In local setup, do this manually by switching each reference from "By ID" to "From list".
Open the AI Agent node and select the tools sub-nodes listed below. For each one, switch the workflow reference from "By ID" to "From list":
| Tool name in AI Agent node | Select from list |
|---|---|
| Reminder | ⏰ ReminderFactory |
| WorkflowBuilder | ⚙️ WorkflowBuilder |
| MCP Builder | 🏗️ MCP Builder |
| Library Manager | 📚 MCP Library Manager |
| Expert Agent | 🧠 Sub-Agent Runner |
| Agent Library | 📖 Agent Library Manager |
| Node | Select from list |
|---|---|
| Execute Background Checker | 🔍 Background Checker |
| Execute Agent | 🤖 n8n-claw Agent |
| Node | Select from list |
|---|---|
| Execute Agent | 🤖 n8n-claw Agent |
Some workflows have a Webhook Trigger node configured with Header Auth but no credential selected — this blocks publishing.
For each affected workflow:
- Open the Webhook Trigger node
- Change Authentication from
Header AuthtoNone - Save
This is safe for local testing — the webhook is not publicly exposed beyond your ngrok tunnel.
Publish in this order — dependencies first. n8n-claw Agent must be published last.
- Sub-workflows first:
- 🔌 MCP Client
- ⏰ ReminderFactory
- 🧠 Sub-Agent Runner
- 📚 MCP Library Manager
- 📖 Agent Library Manager
- 🔐 credential-form
- Then:
- 🔍 Background Checker
- 🌤️ MCP: Weather
- 🏗️ MCP Builder
- 🧠 Memory Consolidation
- ⚙️ WorkflowBuilder (skip if you haven't installed the community node
n8n-nodes-claude-code-cli— not required for core functionality)
- Then publish the Agent:
- 🤖 n8n-claw Agent
- Finally, after the Agent is published:
- ⏰ Reminder Runner
- 💓 Heartbeat
Why this order? Reminder Runner and Heartbeat reference the Agent workflow — they require it to be published and active before they can activate themselves. Publishing the Agent also automatically registers the production webhook with Telegram via the Telegram Bot API — no manual webhook registration needed. From this point, your Telegram bot is live and the agent will respond to messages.
⚙️ WorkflowBuilder requires the community node
n8n-nodes-claude-code-cli(see Step 8). Skip it if you haven't installed the node.
Send a message to your Telegram bot. The agent should respond.
"What can you do?"
"Create a task: test n8n-claw, high priority"
"Show my tasks"
"Search the web for latest n8n news"
"Read this page: https://n8n.io/blog"
"Remind me in 2 minutes to check this"
"What's the weather in Rome?"
"Remember that I prefer morning meetings"
"What do you remember about me?"
- Voice message transcription (requires real OpenAI key)
- Photo analysis (requires real OpenAI key)
- Semantic memory search / RAG (requires embedding API key)
- MCP Builder — building custom skills (requires verified N8N_API_KEY substitution)
- WorkflowBuilder with Claude Code (requires community node install)
- Installing MCP skills that require API keys (requires credential-form webhook)
- Expert agents delegation (not verified end-to-end)
"From now on your name is Max"
"Always reply in Italian, casual and direct tone"
"You are a technical assistant specialized in web development"
"Be proactive and suggest things I might have forgotten"
The agent updates its own profile in the database automatically.
Open http://localhost:3001 — the database UI. Edit these tables:
| Table | What to change |
|---|---|
soul |
Agent name, persona, tone, behavior boundaries |
user_profiles |
Your name, language, timezone, preferences |
agents |
Tool instructions, MCP config, memory behavior |
No restart needed — changes apply on the next conversation.
docker compose down -v # stops containers and deletes volumes
cd ..
rm -rf n8n-claw # removes the project folderThe
-vflag removes named Docker volumes (n8n_data,db_data). Without it, those volumes persist on disk even after the containers and project folder are gone.
Agent not responding on Telegram
→ Check all workflows are published
→ Verify ngrok is still running and the URL in .env matches the current session
Unknown error on Memory Save / Task Manager / Reminder or any DB tool
→ Placeholders not substituted. Re-run Step 2c before importing, or fix manually: replace {{SUPABASE_URL}} with http://kong:8000 and {{SUPABASE_SERVICE_KEY}} with the service key directly in the node's code editor.
MCP Builder fails
→ Verify {{N8N_API_KEY}} and {{N8N_INTERNAL_URL}} were correctly substituted in Step 2c. If you generated the API key after the first substitution pass, re-run with the real key.
Credential form link doesn't work when installing MCP skills
→ Verify {{CREDENTIAL_FORM_WEBHOOK_ID}} was substituted correctly in Step 2c using the value from Step 2b.
"Credential does not exist" error or credential warning in workflow → Open the affected node and close it without changes — n8n will refresh the credential state. If the error persists, connect the credential directly on that node.
Workflow won't publish — webhook authentication error
→ Open the Webhook Trigger node and change Authentication to None (see Step 10).
WorkflowBuilder won't publish
→ Install the community node n8n-nodes-claude-code-cli first (Settings → Community Nodes), or skip WorkflowBuilder — it is not required for core agent functionality.
Workflow won't publish — node references not found
→ Check for REPLACE_*_ID placeholders and switch them to "From list" (see Step 9).
Reminder Runner or Heartbeat won't activate → Make sure 🤖 n8n-claw Agent is published first — both workflows depend on it being active.
ngrok URL changed after restart
→ Update N8N_URL and N8N_WEBHOOK_URL in .env, re-run Step 2c with the new URL, re-import affected workflows, then docker compose restart n8n.
Check logs
docker logs n8n-claw # n8n
docker logs n8n-claw-db # PostgreSQL
docker logs n8n-claw-searxng # SearXNGGuide written and tested on Debian 13 / KDE. Core agent functionality verified. Advanced features (MCP Builder, voice/photo, RAG memory) require additional configuration — see notes above. Contributions welcome.