In today’s AI landscape, running powerful AI agents locally offers significant advantages in terms of privacy, cost, and control. Combining n8n’s powerful workflow automation platform with local Large Language Models (LLMs) creates a compelling solution for businesses and developers seeking to build AI-powered applications without relying on cloud APIs. This comprehensive guide will walk you through setting up the n8n Self-hosted AI Starter Kit and exposing it securely online using Pinggy.
Self-host n8n AI Starter Kit
Install Docker and Docker Compose
Clone the repository:
git clone https://github.com/n8n-io/self-hosted-ai-starter-kit.git
Start the containers:
docker compose --profile cpu up
(or use GPU profiles if available)
Access n8n at: http://localhost:5678/
Configure Your AI Environment
Expose with Pinggy for Remote Access
Basic HTTP tunnel:
ssh -p 443 -R0:localhost:5678 a.pinggy.io
With authentication:
ssh -p 443 -R0:localhost:5678 -t a.pinggy.io b:username:password
Access your AI workflows remotely via the generated Pinggy URL
Build AI Applications
The rise of Large Language Models (LLMs) has transformed what’s possible with AI, but relying on cloud APIs comes with challenges:
Self-hosting AI agents addresses these challenges by keeping data and processing on your own infrastructure. Combined with n8n’s workflow automation capabilities, you can create sophisticated AI applications tailored to your specific needs.
The n8n Self-hosted AI Starter Kit is an open-source Docker Compose template that bootstraps a complete local AI development environment. It integrates:
This combination provides everything needed for building advanced AI workflows without cloud dependencies.
Before starting, ensure you have:
Open your terminal and run:
git clone https://github.com/n8n-io/self-hosted-ai-starter-kit.git
cd self-hosted-ai-starter-kit
The starter kit offers different profiles based on your hardware:
For CPU-only systems:
docker compose --profile cpu up
For NVIDIA GPU users:
docker compose --profile gpu-nvidia up
For AMD GPU users on Linux:
docker compose --profile gpu-amd up
For Mac/Apple Silicon users:
docker compose up
Once the containers are running, access the n8n interface at:
http://localhost:5678/
You’ll be prompted to create an account during the first login. After completing the setup:
http://localhost:5678/workflow/srOnR8PAY3u4RSwb
While your n8n instance works perfectly on your local network, you might want to access it remotely or share it with collaborators. This is where Pinggy comes in, allowing you to create secure tunnels to your localhost.
To expose your n8n instance with a simple HTTP tunnel, run:
ssh -p 443 -R0:localhost:5678 a.pinggy.io
This command will create a tunnel and provide you with a public URL (e.g., https://abc123.pinggy.link
) that redirects to your local n8n instance.
For better security, add basic authentication to your tunnel:
ssh -p 443 -R0:localhost:5678 -t a.pinggy.io b:username:password
This adds an extra layer of protection, requiring users to enter credentials before accessing your n8n instance.
Now that your self-hosted AI environment is up and running, you can start building powerful workflows. Here are some ideas to get you started:
Create a conversational agent that remembers past interactions using:
Build a workflow that can process and extract insights from documents:
Automate data processing tasks with AI assistance:
When exposing your self-hosted AI environment, consider these security measures:
If Llama3 isn’t downloading:
# Check Ollama logs
docker logs ollama
# Manually trigger a model download
docker exec -it ollama ollama pull llama3:8b
If n8n can’t connect to Ollama, verify the service configuration:
http://localhost:5678/home/credentials
http://ollama:11434/
(or http://host.docker.internal:11434/
for Mac users running Ollama locally)Self-hosting AI agents with n8n and Pinggy gives you full control over your workflows, data, and infrastructure without relying on cloud APIs. With just Docker and a few simple commands, you can build secure, private, and scalable AI applications tailored to your needs. Whether you’re building chatbots, document analysis tools, or data automation pipelines, this setup empowers you to harness the power of local LLMs with ease.