---
title: "Self-Hosting with ZeroDB Local"
description: "Run ZeroDB locally with SQLite + FAISS — no API key, no cloud, full privacy"
canonical: "https://docs.ainative.studio/docs/guides/self-hosting"
last-updated: "2026-10-03T21:47:10.764Z"
---

# Self-Hosting with ZeroDB Local

Source: https://docs.ainative.studio/docs/guides/self-hosting

> Run ZeroDB locally with SQLite + FAISS — no API key, no cloud, full privacy

## Self-Hosting with ZeroDB Local

ZeroDB Local runs entirely on your machine. SQLite for storage, FAISS for vector search, inline embeddings — no API key or cloud connection needed.

```bash
pip install zerodb-local
```

## Quick Start

```python
from zerodb_local import ZeroDBLocal

## Create a local database
db = ZeroDBLocal("./my-data")

## Store documents (embeddings generated locally)
db.add_texts([
    "ZeroDB is a persistent knowledge layer",
    "Vector search finds similar documents",
    "Agents need memory to be useful",
])

## Search by meaning
results = db.search("database for AI agents", k=3)
for r in results:
    print(f"Score: {r['score']:.3f} — {r['text']}")
```

## Run as a Server

```bash
zerodb serve --port 8080 --data ./my-data
```

This starts a local HTTP server with the same API as the cloud version. Useful for development and testing.

## Architecture

| Component | Technology | Role |
|-----------|-----------|------|
| Storage | SQLite | Document and metadata storage |
| Vector index | FAISS | Approximate nearest neighbor search |
| Embeddings | Sentence Transformers (inline) | No external API needed |

## When to Use Local vs Cloud

| Feature | ZeroDB Local | ZeroDB Cloud |
|---------|:---:|:---:|
| No API key needed | Yes | No |
| Runs offline | Yes | No |
| Free embeddings | Yes (inline) | Yes (TEI) |
| Multi-tenant | No | Yes |
| GraphRAG | No | Yes |
| MCP server | No | Yes |
| File storage | No | Yes |
| PostgreSQL | No | Yes |
| Best for | Dev, testing, privacy | Production, multi-user |

## PyPI

- Package: [zerodb-local on PyPI](https://pypi.org/project/zerodb-local/)
- Version: 0.2.0+
- Python: 3.9+

## Next Steps

- [ZeroDB Cloud](/docs/zerodb/overview) — Full cloud product
- [MCP Setup](/docs/mcp/overview) — Agent tool integration
