Model or dataset
n8n-io/self-hosted-ai-starter-kit avatar
n8n-io/self-hosted-ai-starter-kit

n8n Self-Hosted AI Starter Kit: A Docker Compose Template for Local AI Workflows

The Self-hosted AI Starter Kit is an open-source template that quickly sets up a local AI environment. Curated by n8n, it provides essential tools for creating secure, self-hosted AI workflows.

15,254 stars3,811 forksUnknownApache-2.0

At a glance

What is it?
This open-source Docker Compose template from n8n bundles n8n, Ollama, Qdrant, and PostgreSQL into a single locally-running stack for building AI workflows. The README explicitly marks it as a proof-of-concept template, not a production-ready deployment.
Who is it for?
This starter kit is the right tool for a developer who wants to prototype an AI workflow locally without assembling the component stack manually. It is not suitable for production as-is: the README states it is not fully optimized for production environments.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 68 days ago.
What is it written in?
GitHub does not report a main language for this repository.

Answers come from the project's GitHub data, last synced on September 17, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What This Starter Kit Provides and Who It Is For

Setting up a local AI workflow from scratch requires choosing an LLM runtime, a vector store, a workflow orchestrator, and a database, then wiring them together. This starter kit does that wiring once and exposes it as a single Docker Compose file. The target is a developer or small team who wants to experiment with self-hosted AI workflows, build a proof-of-concept, or evaluate the components together before committing to a production stack.

The README describes the kit as providing everything needed to build secure, self-hosted AI workflows quickly. The example use cases it lists are concrete: scheduling AI agents, summarizing company PDFs without data leaving the machine, building Slack bots for internal communications, and analyzing financial documents at low cost. All of these share the assumption that the data should not leave the local environment, which is the primary reason to run the stack locally rather than using a cloud API.

The Four Components and How They Connect

The docker-compose.yml defines four services on a shared internal network named demo:

Self-hosted n8n is the workflow orchestration layer. It runs on port 5678 and provides over 400 integrations along with AI-specific nodes including the AI Agent node, the Text Classifier node, and the Information Extractor node. Its data is stored in PostgreSQL and its binary data in a named volume.

Ollama handles local language model inference. It runs on port 11434 and pulls Llama3.2 automatically on first startup. The compose file stores model weights in the ollama_storage volume so a model downloaded once does not need to be downloaded again on restart.

Qdrant is the vector database. It provides storage for embeddings generated during RAG (retrieval-augmented generation) workflows. Its data goes into the qdrant_storage volume.

PostgreSQL 16 on Alpine serves as the operational database for n8n itself, storing workflows, credentials, and execution logs. The n8n service uses DB_TYPE=postgresdb and connects to the postgres service by hostname.

Cloning and Starting the Stack

Clone the repository and copy the example environment file before starting:

bash
git clone https://github.com/n8n-io/self-hosted-ai-starter-kit.git
cd self-hosted-ai-starter-kit
cp .env.example .env

The .env.example sets default values that must be changed before any use beyond a quick local test:

code
POSTGRES_USER=root
POSTGRES_PASSWORD=password
POSTGRES_DB=n8n
N8N_ENCRYPTION_KEY=super-secret-key
N8N_USER_MANAGEMENT_JWT_SECRET=even-more-secret
N8N_DEFAULT_BINARY_DATA_MODE=filesystem

The encryption key and JWT secret protect stored credentials and user sessions. Using the example values in a shared or networked environment is a security risk. Once .env is updated, start the stack with the profile matching your hardware. For a CPU-only setup:

bash
docker compose --profile cpu up

For a machine with an Nvidia GPU:

bash
docker compose --profile gpu-nvidia up

For an AMD GPU on Linux:

bash
docker compose --profile gpu-amd up

Ollama will download Llama3.2 on the first run. The README advises watching the Docker console logs to track the download progress before expecting the first workflow to respond.

The Included Workflow and Starting the First Interaction

After the stack is running, open http://localhost:5678/ in a browser to complete the n8n setup. This one-time setup only runs on the first start. The kit includes a pre-built workflow accessible at http://localhost:5678/workflow/srOnR8PAY3u4RSwb. Opening it shows the workflow canvas; clicking the Chat button at the bottom starts an interaction.

The first interaction may be slow if Ollama has not finished downloading Llama3.2. The README notes that checking the Docker console logs shows the download progress. Once the model is ready, the workflow runs locally with no outbound API calls. The n8n interface provides access to all 400+ integrations and to the AI nodes. The README advises keeping everything local by using the Ollama node for language model calls and Qdrant for vector storage, which avoids any data leaving the machine.

Mac and Apple Silicon: The GPU Limitation

Docker on Mac with an M1 or later chip cannot access the Apple GPU. This means the gpu-nvidia and gpu-amd profiles do not apply, and passing GPU acceleration to Ollama inside Docker is not possible. The README gives two options: run the entire stack on CPU, which is slower but requires no extra configuration, or run Ollama as a native Mac application and connect to it from the n8n container.

For the second option, the README specifies setting OLLAMA_HOST to host.docker.internal:11434 in the .env file, then starting the stack without a GPU profile:

bash
docker compose up

After the stack starts, open http://localhost:5678/home/credentials, click Local Ollama service, and change the base URL to http://host.docker.internal:11434/. This routes the n8n Ollama node calls to the native Mac Ollama process rather than the containerized one, giving GPU access through the Mac's native inference path.

What Is Not Production-Ready and What to Verify

The README explicitly describes the kit as not fully optimized for production environments, designed to help get started and to work well for proof-of-concept projects. Several aspects of the default configuration reflect this. The .env.example uses placeholder secrets that provide no real security. The docker-compose.yml uses the n8nio/n8n:latest image tag, which means a docker compose pull will pick up any new release of n8n without pinning to a specific tested version. Volumes are named but not backed up by any mechanism in the compose file.

The Ollama service in the compose file is configured with restart: unless-stopped, meaning it restarts after crashes but not necessarily before n8n is ready for queries. The postgres service has a healthcheck configured with pg_isready to let n8n wait for the database, but the ordering between Ollama and n8n is handled only by the init container that pulls the model.

For teams who want to move this stack to production, pinning image versions, rotating secrets, adding backup volumes, and putting n8n behind a reverse proxy are the immediate steps.

Upgrading, License, and Repository Activity

To pull updated images and restart the stack, the README provides profile-specific upgrade commands. For a CPU-only setup:

bash
docker compose --profile cpu pull
docker compose create && docker compose --profile cpu up

The same pattern applies to the gpu-nvidia and Mac profiles using their respective --profile flags. The two-step create-then-up preserves existing volume data while picking up new image versions.

The license is Apache-2.0, which permits commercial use, modification, and redistribution. The repository has no GitHub releases; versions are pinned implicitly through Docker image tags. The last push to the repository was on 2026-07-23. The repository structure is minimal: the core is the docker-compose.yml file, the .env.example, and a n8n/ directory for pre-built workflow data. An n8n template gallery at n8n.io/workflows/categories/ai/ lists additional AI workflow templates that can be imported into the local instance.

Editorial conclusion

This starter kit is the right tool for a developer who wants to prototype an AI workflow locally without assembling the component stack manually. It is not suitable for production as-is: the README states it is not fully optimized for production environments. Before building on it, change every default secret in .env.example and verify that the Ollama model you need can run on your hardware; Mac users with Apple Silicon cannot pass GPU access into Docker and must run Ollama natively or accept CPU-only inference.

Frequently asked questions

What is a self-hosted AI system?

A self-hosted AI system runs entirely on your own hardware or private server rather than sending data to a cloud API. The n8n Self-Hosted AI Starter Kit demonstrates this by running n8n, Ollama, Qdrant, and PostgreSQL locally through Docker Compose, so models run on your machine and no data leaves your network.

Can I build my own AI for free?

The starter kit is free and open-source under the Apache-2.0 license, and all four components it bundles are free to use. You need a machine that can run Docker and enough memory and storage for the Ollama model (Llama3.2 by default). GPU hardware is optional but speeds up inference.

Does the self-hosted AI starter kit work without a GPU?

Yes. The docker compose --profile cpu up command starts the full stack in CPU-only mode. Inference will be slower than with a GPU, but the kit is fully functional. Mac users with Apple Silicon can also run Ollama natively on the Mac and connect it to the Docker n8n instance by setting OLLAMA_HOST=host.docker.internal:11434 in the .env file.

Official sources

  1. Issues
  2. License: Apache-2.0
  3. n8n-io/self-hosted-ai-starter-kit on GitHub
  4. Project website
  5. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/n8n-io-self-hosted-ai-starter-kit.svg)](https://hysenlabs.com/projects/n8n-io-self-hosted-ai-starter-kit)