Install
$ agentstack add mcp-kossakovsky-selfhost-ai ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ● Network access Used
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ● Environment & secrets Used
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Selfhost AI — Self-Hosted AI Automation Platform
[](https://github.com/kossakovsky/selfhost-ai/stargazers) [](LICENSE) [](https://www.docker.com/) [](https://ubuntu.com/) [](https://n8n.io)
Deploy 30+ AI and automation tools with a single command. This open-source Docker Compose template creates a complete self-hosted environment with n8n (workflow automation), Flowise (AI agents), Ollama (local LLMs), vector databases (Qdrant, Weaviate), RAG engines, Supabase, monitoring stack, and more — all pre-configured behind Caddy reverse proxy with automatic HTTPS. Plus, optionally import 300+ community workflows during setup!
Table of Contents
- [Key Features](#key-features)
- [Why This Setup?](#why-this-setup)
- [What's Included](#whats-included)
- [Installation](#installation)
- [Quick Start and Usage](#quick-start-and-usage)
- [Upgrading](#upgrading)
- [Quick Commands](#quick-commands-makefile)
- [Troubleshooting](#troubleshooting)
- [License](#license)
Key Features
- Private AI Homelab — Run LLMs locally with Ollama, keep your data on your own servers
- ChatGPT Alternative — Open WebUI provides a familiar chat interface for local AI models
- Workflow Automation — n8n with 400+ integrations, scalable queue-based architecture
- AI Agents & RAG — Flowise, Dify, LangChain, vector databases (Qdrant, Weaviate)
- One Command Install — Interactive wizard, automatic secrets, zero manual configuration
- Auto HTTPS — Caddy reverse proxy with automatic Let's Encrypt certificates
- Built-in Monitoring — Grafana + Prometheus stack included, with an n8n dashboard that tracks workflow executions (outcomes, per-workflow volume, time since last success) and ready-made alert rules for failed or stalled workflows
- Production Ready — Scalable workers, health checks, proper service dependencies
- Free & Open Source — No vendor lock-in, Apache 2.0 license
Why This Setup?
This installer helps you create your own powerful, private AI workshop. Imagine having a suite of tools at your fingertips to:
- Automate repetitive tasks.
- Build smart assistants tailored to your needs.
- Analyze information and gain insights.
- Generate creative content.
This setup provides a comprehensive suite of cutting-edge services, all pre-configured to work together. Key advantages include:
- Rich Toolset: Get a curated collection of powerful open-source tools for AI development, automation, and monitoring, all in one place.
- Scalable n8n Performance: n8n runs in
queuemode by default, leveraging Redis for task management and Postgres for data storage. You can dynamically specify the number of n8n workers and task runners during installation, allowing for robust parallel processing of your workflows to handle demanding loads. - Full Control: All of this is hosted by you, giving you full control over your data, operations, and how resources are allocated.
What's Included
✅ Caddy, Postgres, and Redis - Core services for web proxy, database, and caching, which are always included.
The installer also makes the following powerful open-source tools available for you to select and deploy via an interactive wizard during setup:
✅ Appsmith - An open-source low-code platform for building internal tools, dashboards, and admin panels with a drag-and-drop UI builder.
✅ n8n - A low-code platform with over 400 integrations and advanced AI components to automate workflows.
✅ n8n-MCP - A Model Context Protocol server that gives AI coding assistants (Claude Code, Cursor, Windsurf, VS Code Copilot) indexed access to every n8n node's documentation, property schemas and thousands of workflow templates - and, once you add an n8n API key, the ability to create and update workflows in your n8n instance straight from your IDE.
✅ n8n Assistant sandbox - Code-execution sandbox for n8n's built-in AI Assistant and the Agents preview (n8n's own sandbox service, Docker-in-Docker isolated with Sysbox; internal only, see [below](#n8n-assistant-sandbox-ai-assistant--agents)).
✅ ComfyUI - A powerful, node-based UI for Stable Diffusion workflows. Build and run image-generation pipelines visually, with support for custom nodes and extensions. Runs on NVIDIA, AMD or CPU (chosen in the wizard).
✅ Crawl4ai - A flexible web crawler designed for AI, enabling you to extract data from websites for your projects.
✅ Docling - Universal document converter that transforms PDF, DOCX, PPTX, XLSX, HTML, and images into clean Markdown or JSON. Features advanced PDF parsing, OCR support, and a REST API with optional web UI. Perfect for document processing in n8n workflows.
✅ Dify - An open-source AI application development platform that provides comprehensive LLMOps capabilities, including workflow management, prompt engineering, RAG pipelines, and AI agent orchestration. Perfect for building production-ready AI applications.
✅ Flowise - A no-code/low-code AI agent builder that complements n8n perfectly, allowing you to create sophisticated AI applications with ease.
✅ Gost - Versatile HTTP/HTTPS proxy for routing AI service outbound traffic through a central proxy point
✅ Gotenberg - A stateless API for converting HTML, Markdown, Word, Excel, and other documents to PDF, PNG, or JPEG. Available only within the Docker network for internal use by n8n workflows and other services.
✅ Grafana - An open-source platform for visualizing monitoring data, helping you understand system performance at a glance.
✅ InvokeAI - A professional creative engine for Stable Diffusion with a polished web UI, node-based workflow editor, inpainting/outpainting, and a REST API. Choose NVIDIA, AMD, or CPU hardware during install; models and outputs are stored in ./invokeai on the host.
✅ Langfuse - An open-source platform to help you observe and understand how your AI agents are performing, making it easier to debug and improve them.
✅ Letta - An open-source agent server and SDK that can be connected to various LLM API backends (OpenAI, Anthropic, Ollama, etc.), enabling you to build and manage AI agents.
✅ LightRAG - A simple and fast graph-based Retrieval-Augmented Generation system with automatic knowledge graph extraction, dual-level retrieval mechanisms, and incremental updates. Supports multiple storage backends (PostgreSQL, Neo4j, JSON) and embedding models.
✅ LibreTranslate - Self-hosted translation API (50+ languages).
✅ Neo4j - A graph database management system that allows you to model, store, and query data as a network of nodes and relationships.
✅ NocoDB - An open source Airtable alternative that turns any database into a smart spreadsheet with a no-code interface for building collaborative apps.
✅ Ollama - Run Llama 3, Mistral, Gemma, and other large language models locally. Optionally expose its API externally through Caddy under OLLAMA_HOSTNAME, protected by a generated Bearer token. On multi-GPU hosts you can run several instances (OLLAMA_INSTANCE_COUNT) to dedicate a GPU per model.
✅ Open WebUI - A user-friendly, ChatGPT-like interface to interact privately with your AI models and n8n agents.
✅ OpenClaw - Personal AI agent with a web dashboard and a Telegram bot, with full access to the server over SSH and to Docker (see [below](#openclaw-ai-agent-with-telegram-and-server-access)).
✅ Open Terminal - Execution sandbox for Open WebUI agents: a real Linux shell with a filesystem, package installs, local services and Jupyter, a separate Linux account per user (internal only, see [below](#open-terminal-execution-sandbox-for-open-webui-agents)).
✅ PaddleOCR - A CPU-ready OCR API powered by PaddleX Basic Serving.
✅ Portainer - A lightweight, secure web UI to manage your Docker environment (containers, images, volumes, networks) with ease.
✅ Databasus - Database backups & monitoring with a self-hosted UI.
✅ Postiz - An open-source social media scheduling and publishing platform.
✅ Prometheus - An open-source monitoring and alerting toolkit to keep an eye on system health.
✅ Qdrant - A high-performance open-source vector store, specialized for AI. While Supabase also offers vector capabilities, Qdrant is included for its speed, making it ideal for demanding AI tasks.
✅ RAGApp - Open-source application to build Retrieval-Augmented Generation (RAG) assistants over your data. Provides a web UI for chat and an HTTP API for integration with your workflows.
✅ RAGFlow - An open-source RAG engine based on deep document understanding with Elasticsearch backend, providing truthful question-answering capabilities with well-founded citations from complex formatted data.
✅ SearXNG - A free, open-source internet metasearch engine. It aggregates results from numerous search services without tracking or profiling you, ensuring your privacy.
✅ Supabase - An open-source alternative to Firebase, providing database storage, user authentication, and more. It's a popular choice for AI applications.
✅ Uptime Kuma - Self-hosted uptime monitoring tool with notifications
✅ WAHA - WhatsApp HTTP API (REST API) that you can configure in a click! 3 engines: WEBJS (browser based), NOWEB (websocket nodejs), GOWS (websocket go).
✅ Weaviate - An open-source AI-native vector database with a focus on scalability and ease of use. It can be used for RAG, hybrid search, and more.
Included Community Workflows
Get started quickly with a vast library of pre-built automations (optional import during setup)! This collection includes over 300 workflows covering a wide range of use cases:
🚦 What's inside?
- AI Agents & Chatbots: RAG, LLM, LangChain, Ollama, OpenAI, Claude, Gemini, and more
- Gmail & Outlook: Smart labeling, auto-replies, PDF handling, and email-to-Notion
- HR, E-commerce, IT, Security, Research, and more!
- Notion, Airtable, Google Sheets: Data sync, AI summaries, knowledge bases
- PDF, Image, Audio, Video: Extraction, summarization, captioning, speech-to-text
- Slack, Mattermost: Ticketing, feedback analysis, notifications
- Social Media: LinkedIn, Pinterest, Instagram, Twitter/X, YouTube, TikTok automations
- Telegram, WhatsApp, Discord: Bots, notifications, voice, and image workflows
- WordPress, WooCommerce: AI content, chatbots, auto-tagging
Installation
Prerequisites before Installation
- Domain Name: You need a registered domain name (e.g.,
yourdomain.com). - DNS Configuration: Before running the installation script, you must configure DNS A-record for your domain, pointing to the public IP address of the server where you'll install this system. Replace
yourdomain.comwith your actual domain:
- Wildcard Record:
A *.yourdomain.com->YOUR_SERVER_IP
- VPS (Virtual Private Server): A dedicated VPS with a public IP address is required. Home servers, shared hosting, or localhost setups are not supported.
- Operating System: Ubuntu 24.04 LTS, 64-bit
- For a minimal setup with n8n, Monitoring, Databasus and Portainer: 4 GB Memory / 2 CPU Cores / 40 GB Disk Space
- For running all available services: at least 20 GB Memory / 4 CPU Cores / 60 GB Disk Space
Running the Install
The recommended way to install is using the provided main installation script.
- Connect to your server via SSH.
- Run the following command:
``bash git clone https://github.com/kossakovsky/selfhost-ai && cd selfhost-ai && sudo bash ./scripts/install.sh ``
This single command automates the entire setup process, including:
- Preparing your system (updates, firewall configuration, and basic security enhancements like brute-force protection).
- Installing Docker and Docker Compose (tools for running applications in isolated environments).
- Generating a configuration file (
.env) with necessary secrets and your domain settings. - Launching all the services.
During the installation, the script will prompt you for:
- Your primary domain name (Required, e.g.,
yourdomain.com). This is the domain for which you've configured the wildcard DNS record. - Your email address (Required, used for service logins like Flowise, Supabase dashboard, Grafana, and for SSL certificate registration with Let's Encrypt).
- An optional OpenAI API key (Not required. If provided, it can be used by Supabase AI features and Crawl4ai. Press Enter to skip).
- Whether you want to import ~300 ready-made n8n community workflows (y/n, Optional. This can take 20-30 minutes, depending on your server and network speed).
- The number of n8n workers you want to run (Required, e.g., 1, 2, 3, 4. This determines how many workflows can be processed in parallel. Each worker automatically gets its own dedicated task runner sidecar for executing Code nodes. Defaults to 1 if not specified).
- A Service Selection Wizard will then appear, allowing you to choose which of the available services (like Flowise, Supabase, Qdrant, Open WebUI, etc.) you want to deploy. Core services (Caddy, Postgres, Redis) will be set up to support your selections.
Upon successful completion, the script will display a summary report. This report contains the access URLs and credentials for the deployed services. Save this information in a safe place!
Quick Start and Usage
After successful installation, your services are up and running! Here's how to get started:
- Access Your Services:
The installation script provided a summary report with all access URLs and credentials. Please refer to that report. The main services will be available at the following addresses (replace yourdomain.com with your actual domain):
- n8n:
n8n.yourdomain.com(Log in with the email address you provided during installation and the initial password from the summary report. You may be prompted to change this password on first login.) - n8n-MCP:
n8n-mcp.yourdomain.com(MCP endpoint at/mcp. Every request must sendAuthorization: Bearer- the token is on the Welcome Page - so a browser visit returns 401 by design. Connect withnpx -y mcp-remote https://n8n-mcp.yourdomain.com/mcp --header "Authorization: Bearer ", or keep the token out of your shell history and process list with--header-filepointing at a file containingAuthorization: Bearer. Starts in documentation-only mode; to also manage workflows, create an API key in n8n under Settings -> n8n API, setN8N_API_KEYin.envand runmake restart. Note that outside n8n Enterprise an API key has full account access. Optionally setN8N_MCP_ACCESS_TOKEN(n8n Settings -> Instanc
…
Source & license
This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: kossakovsky
- Source: kossakovsky/selfhost-ai
- License: Apache-2.0
- Homepage: https://github.com/kossakovsky/selfhost-ai#readme
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.