Skip to content

Latest commit

 

History

726 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Selfhost AI — One-Command Self-Hosted AI Stack (n8n, Ollama, Open WebUI, OpenClaw)

GitHub stars Latest release License Ubuntu

Deploy 30+ open-source AI and automation tools on your own server with a single command. Selfhost AI is a Docker Compose installer for a private AI homelab: n8n workflow automation, local LLMs with Ollama, a ChatGPT-style chat in Open WebUI, AI agents (OpenClaw, Flowise, Dify, Letta), RAG engines and vector databases (Qdrant, Weaviate, LightRAG, RAGFlow), Supabase, ComfyUI and Grafana monitoring. An interactive wizard picks the services, generates every secret and puts them all behind Caddy with automatic HTTPS. A free, self-hosted alternative to Zapier, Make and ChatGPT.

Quick Start

You need a VPS with a public IP running Ubuntu 24.04 LTS (4 GB RAM / 2 CPU for n8n and monitoring; 20 GB RAM / 4 CPU / 60 GB disk for everything), a domain, and a wildcard DNS record A *.yourdomain.com -> YOUR_SERVER_IP. Then run:

git clone https://github.com/kossakovsky/selfhost-ai && cd selfhost-ai && sudo bash ./scripts/install.sh

The wizard does the rest; see Installation for what it asks.

Key Features

  • One-command install: an interactive wizard, generated secrets and no manual configuration
  • Private AI homelab: run LLMs locally with Ollama, on CPU, NVIDIA or AMD GPUs, including multi-GPU; your data stays on your server
  • ChatGPT alternative: Open WebUI for local and API models, with an optional code-execution sandbox
  • Workflow automation: n8n with 400+ integrations, queue mode with scalable workers, an MCP server for AI IDEs, and 300+ optional community workflows
  • AI agents and RAG: OpenClaw (with Telegram), Flowise, Dify, Letta, LightRAG, RAGFlow, Qdrant, Weaviate
  • Automatic HTTPS: Caddy reverse proxy with Let's Encrypt; services are reached only through Caddy (see security notes for Supabase's ports); optional Cloudflare Tunnel
  • Built-in monitoring: Grafana and Prometheus with an n8n workflow dashboard and ready-made alerts
  • Production ready: health checks, service dependencies, make doctor diagnostics, and updates that preserve your settings
  • Free and open source: Apache 2.0, no vendor lock-in

What's Included

Always installed: Caddy (reverse proxy and HTTPS), PostgreSQL, and Valkey (Redis-compatible). Everything below is optional and chosen in the wizard. "internal" means the service has no public URL and is reachable only from other containers.

AI Chat and Agents

Service What it does URL
Open WebUI ChatGPT-like interface for local and API LLMs and n8n agents webui.
OpenClaw Personal AI agent with a web dashboard, a Telegram bot, and full server access (guide) openclaw.
Open Terminal Linux shell sandbox for Open WebUI agents, with a separate account per user (guide) internal
Flowise No-code / low-code AI agent builder flowise.
Dify AI application platform with LLMOps, RAG pipelines and agent orchestration dify.
Letta Agent server and SDK with persistent memory (formerly MemGPT) letta.

Workflow Automation

Service What it does URL
n8n Workflow automation with 400+ integrations and AI nodes, in queue mode with workers (guide) n8n.
n8n-MCP MCP server that gives Claude Code, Cursor, Windsurf and VS Code n8n node docs and workflow tools n8n-mcp.
n8n Assistant sandbox Code-execution sandbox for n8n's AI Assistant and Agents, isolated with Sysbox, or privileged if you accept that (guide) internal
Postiz Social media scheduling and publishing postiz.
WAHA WhatsApp HTTP API (WEBJS, NOWEB and GOWS engines) waha.
Python Runner Runs your own Python code from python-runner/ (main.py, requirements.txt, installed on every start) on the internal network internal

Local LLMs and Image Generation

Service What it does URL
Ollama Run Llama, Qwen, Mistral, Gemma and other LLMs locally, on CPU, NVIDIA or AMD, with multi-GPU support (guide) ollama. (Bearer token)
ComfyUI Node-based Stable Diffusion / Flux image generation UI (NVIDIA, AMD or CPU; pin GPUs with COMFYUI_GPU_DEVICES) comfyui.
InvokeAI Stable Diffusion studio with a canvas, inpainting and a workflow editor; download a model in the Model Manager first invokeai.

RAG, Vector and Graph Databases

Service What it does URL
Qdrant High-performance vector database qdrant.
Weaviate AI-native vector database with hybrid search weaviate.
Supabase Postgres backend with auth, storage and pgvector (a Firebase alternative) supabase.
Neo4j Graph database neo4j.
LightRAG Graph-based RAG with automatic knowledge-graph extraction lightrag.
RAGFlow RAG engine with deep document understanding and citations ragflow.
RAGApp RAG assistant over your data, with a web UI and an HTTP API ragapp.

Documents, OCR, Web Scraping and Search

Service What it does URL
Docling Converts PDF, DOCX, PPTX, XLSX, HTML and images to Markdown/JSON, with OCR; web UI at /ui docling.
PaddleOCR OCR API that runs on CPU paddleocr.
Gotenberg Converts HTML, Markdown and Office documents to PDF or images internal
Crawl4AI LLM-friendly web crawler and scraper internal
SearXNG Private metasearch engine, also used as the web search for n8n's AI Assistant searxng.
LibreTranslate Self-hosted translation API (50+ languages) translate.

Low-Code Apps and Data

Service What it does URL
Appsmith Low-code builder for internal tools and admin panels appsmith.
NocoDB Open-source Airtable alternative nocodb.

Monitoring and Operations

Service What it does URL
Grafana + Prometheus System and n8n workflow dashboards and alerts (with cAdvisor and node-exporter) grafana., prometheus.
Langfuse LLM observability, tracing and evals langfuse.
Uptime Kuma Uptime monitoring with notifications uptime-kuma.
Portainer Docker management UI (behind basic auth; create the Portainer admin on first login) portainer.
Databasus Database backups and monitoring databasus.
Gost Outbound HTTP/HTTPS proxy for AI services internal
Cloudflare Tunnel Zero-trust access without open ports

URLs are subdomains of your domain, for example n8n.yourdomain.com.

Installation

Prerequisites

  1. A domain name with a wildcard A record, *.yourdomain.com, pointing to your server's IP, configured before installing.
  2. A VPS with a public IP address. Home servers, shared hosting and localhost setups are not supported.
    • Operating system: Ubuntu 24.04 LTS, 64-bit
    • n8n, Monitoring, Databasus and Portainer: 4 GB RAM / 2 CPU cores / 40 GB disk
    • All services: at least 20 GB RAM / 4 CPU cores / 60 GB disk

Run the installer over SSH:

git clone https://github.com/kossakovsky/selfhost-ai && cd selfhost-ai && sudo bash ./scripts/install.sh

The installer updates the system, configures the firewall and brute-force protection, installs Docker, generates .env with all secrets, and starts the services. It asks for:

  1. Your domain (e.g. yourdomain.com).
  2. Your email, used for service logins and for the Let's Encrypt certificate.
  3. Which services to install, in a checklist wizard, plus follow-ups for some of them (hardware profile, Telegram bot token, Cloudflare token, ...).
  4. An optional OpenAI API key (used by Supabase AI and Crawl4AI).
  5. If n8n is selected: whether to import ~300 community n8n workflows (takes 20-30 minutes) and the number of n8n workers (each gets its own task runner).

At the end it prints the Welcome Page URL and login (save them). The Welcome dashboard at welcome.yourdomain.com lists every service's URL and credentials.

Upgrading

make update     # pull the latest installer, update images, restart
make git-pull   # for forks: merge from upstream instead of resetting

make update resets tracked files such as Caddyfile and docker-compose.yml, so put your customizations in the places that survive updates:

  • Custom Caddy sites: caddy-addon/site-*.conf (see caddy-addon/README.md)
  • Compose overrides: a docker-compose.override.yml in the project root; it takes the highest precedence
  • Settings: values in .env are kept (except GOST_NO_PROXY, which is regenerated to cover new services)

Commands

Command Description
make install Full installation
make update Update the installer and all services
make update-preview Preview available updates (dry run)
make git-pull Update a fork by merging from upstream
make status Container status
make logs / make logs s=n8n Logs for all services or for one
make monitor Live CPU and memory usage
make restart / make stop / make start Control the whole stack
make show-restarts Restart count per container
make doctor Diagnostics: DNS, SSL, containers, disk, memory
make import / make import n=10 Import n8n workflows from the backup
make openclaw a="..." Run an OpenClaw CLI command
make setup-tls Use custom TLS certificates instead of Let's Encrypt
make clean Remove unused Docker images and containers (keeps data)

Run make help for the full list.

Guides

Troubleshooting

  • Sites don't load. The server is usually out of RAM or CPU for the services you selected. Check free -h and make monitor, start with n8n only, and enable other services one by one. make doctor checks DNS, certificates and containers.

  • "Dangerous site" warning right after install. Caddy briefly serves a temporary certificate while it gets one from Let's Encrypt. This normally clears within hours; if it lasts more than a day, check make logs s=caddy and your DNS records.

  • Docker images fail to pull. Temporarily disable your VPN.

  • make update fails. Force-sync with upstream. This discards local changes to tracked files:

    git config pull.rebase true && git fetch origin && git checkout main && git reset --hard "origin/main" && make update

Credits

Telemetry

The installer sends anonymous usage statistics through Scarf: event type, installer version, selected services, OS, a random installation ID, and the country Scarf derives from your IP. No personal data is collected. To opt out, set SCARF_ANALYTICS=false in .env.

License

Apache License 2.0. See LICENSE.

About

One-command installer for a self-hosted AI stack on your own server: n8n, Ollama, Open WebUI, OpenClaw, Dify, Flowise, Supabase, ComfyUI, Qdrant & 30+ tools. Docker Compose, automatic HTTPS via Caddy, built-in monitoring. Free Zapier/Make alternative.

Topics

Resources

Security policy

Stars

936 stars

Watchers

23 watching

Forks

Releases

Packages

Contributors

Languages