Skip to content

About

Run ChromaDB in Docker and practice collections, explicit embeddings, and similarity queries.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Arya Fatthurahman

ChromaDB Lab

Run ChromaDB in Docker and practice collections, explicit embeddings, and similarity queries.

Database: ChromaDB Category: Vector database Runs in Docker License: MIT compose-check

What this lab is

Chroma is a developer-friendly vector store often used for retrieval-augmented generation. This lab runs the Chroma server, creates a collection, upserts documents with explicit vectors, and queries the nearest neighbors through the Python client.

Quickstart

docker compose up -d
python -m pip install chromadb
python examples/chroma_client.py
curl -s http://localhost:8000/api/v2/heartbeat

Connection details

Field Value
URL http://localhost:8000
Heartbeat /api/v2/heartbeat (newer versions; /api/v1/heartbeat on older ones)
Collection lab
Embeddings explicit vectors so no model download is required

Examples

File What it shows
docker-compose.yml Engine, ports, and persistent volume.
.github/workflows/compose-check.yml Validates the Compose file on every push.
examples/chroma_client.py Create a collection, upsert documents, and query.
examples/01_heartbeat.sh Check the server without the Python client.

Exercises

  1. Replace the toy vectors with embeddings from a real model and query with a sentence.
  2. Add metadata filters to the query (for example, only topic=vector).
  3. Delete a document and confirm it no longer appears in results.
  4. Compare cosine and L2 distance on the same collection.

Notes and limits

  • The Python example uses explicit embeddings, so Chroma does not download an embedding model.
  • The latest tag is convenient but not reproducible; pin a version if you need stability.
  • Data persists in the chroma-data volume because IS_PERSISTENT=TRUE.
  • Port 8000 is also used by the Databend lab in this collection; do not run both at once unless you change one port.

Run it from anywhere

This lab publishes its ports on 127.0.0.1 only. To use it from another country, do not open the database port to the internet. Pick one:

  • VPS + private tunnel: run the lab on a small Ubuntu VPS, keep the port closed, and connect through WireGuard or ssh -L.
  • Managed service: use a managed free tier for this engine and point the same examples at its connection string.
  • HTTP UI only: if the engine has a web UI, put it behind Caddy with TLS and basic auth.

The shared checklist, provider map, and commands are in REMOTE-ACCESS.md.

Cleanup

docker compose down -v

-v also removes the named volume, so the next start is a clean slate.

References


Part of the database-labs collection: 26 database engines, one index.

License

MIT (c) 2026 Arya Fatthurahman. See LICENSE.

About

Run ChromaDB in Docker and practice collections, explicit embeddings, and similarity queries.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors