Repo Dev Tools

kossakovsky/selfhost-ai

Docker Compose installer that deploys 30+ self-hosted AI and automation tools (n8n, Ollama, Open WebUI, etc.) on an Ubuntu VPS behind Caddy with automatic HTTPS.

  • 944 GitHub stars
  • Shell
  • ⚖️ Apache-2.0
  • 🎯 Intermediate
git clone https://github.com/kossakovsky/selfhost-ai && cd selfhost-ai && sudo bash ./scripts/install.sh
kossakovsky/selfhost-ai — repo preview

What it is

Selfhost AI is a Docker Compose installer for a private AI homelab on your own VPS. An interactive wizard lets you choose services such as n8n, Ollama, Open WebUI, OpenClaw, Dify, Supabase, ComfyUI and Qdrant, generates all secrets in a .env file, and puts everything behind a Caddy reverse proxy with Let's Encrypt HTTPS. It also includes Grafana/Prometheus monitoring and is positioned as a free, self-hosted alternative to Zapier, Make and ChatGPT.

Who it's for

  • Developers who want a self-hosted n8n and local LLM stack on their own VPS
  • Teams building AI agents and RAG pipelines who want data kept on their own server
  • Users seeking a free alternative to Zapier, Make or ChatGPT

Requirements

Requirements

  • A VPS with a public IP running Ubuntu 24.04 LTS (64-bit); home servers, shared hosting and localhost are not supported
  • 4 GB RAM / 2 CPU / 40 GB disk for n8n, monitoring, Databasus and Portainer; at least 20 GB RAM / 4 CPU / 60 GB disk for all services
  • A domain name with a wildcard A record (*.yourdomain.com) pointing to the server IP, configured before installing
  • An email address for service logins and the Let's Encrypt certificate

Setup

  1. Configure DNS

    Before installing, create a wildcard A record for your domain pointing to your server's public IP: A *.yourdomain.com -> YOUR_SERVER_IP.

  2. Run the installer over SSH

    Clone the repo and run the install script. The installer updates the system, configures the firewall and brute-force protection, installs Docker, generates .env with all secrets, and starts the services.

    bash
    git clone https://github.com/kossakovsky/selfhost-ai && cd selfhost-ai && sudo bash ./scripts/install.sh
  3. Answer the wizard prompts

    The wizard asks for your domain, your email, which services to install (plus follow-ups such as hardware profile, Telegram bot token or Cloudflare token), an optional OpenAI API key, and if n8n is selected, whether to import ~300 community workflows and the number of n8n workers.

  4. Save the Welcome Page details

    At the end the installer prints the Welcome Page URL and login. The dashboard at welcome.yourdomain.com lists every service's URL and credentials.

Examples

Update the stack

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

What it does: Updates the installer and services while keeping values in .env; use git-pull for forks.

Run diagnostics

bash
bash
make doctor

What it does: Checks DNS, SSL, containers, disk and memory when sites don't load.

View logs for one service

bash
bash
make logs s=n8n

What it does: Shows logs for a single service; make logs without the argument shows all services.

Force-sync when make update fails

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

What it does: Resets to upstream and re-runs the update; this discards local changes to tracked files.

Pros & cons

Pros

  • Pro:One command installs a wide catalog of services (30+) with generated secrets and automatic HTTPS via Caddy
  • Pro:Ollama supports CPU, NVIDIA or AMD GPUs including multi-GPU, keeping LLM data on your server
  • Pro:Includes built-in Grafana/Prometheus monitoring, health checks and a make doctor diagnostics command
  • Pro:Updates preserve .env settings, with documented places (caddy-addon, docker-compose.override.yml) for customizations

Cons

  • Con:Requires a public-IP VPS on Ubuntu 24.04 LTS with a wildcard DNS record; home servers and localhost are unsupported
  • Con:Running all services needs at least 20 GB RAM / 4 CPU / 60 GB disk
  • Con:make update resets tracked files like Caddyfile and docker-compose.yml, so customizations must go in designated locations