ChromaDotNet.Testcontainers
A Testcontainers for .NET module for Chroma: start a throwaway Chroma container in your tests. The container is ready when the Chroma API answers its heartbeat, so the module works with any Chroma image, whatever its tag.
- Latest release 0.1.7
- NuGet
- GitHub
- Documentation
Install
dotnet add package ChromaDotNet.Testcontainers Example
Start Chroma in a container and connect ChromaDotNet.Client to it. Docker must be running.
using ChromaDB.Client;
using Testcontainers.Chroma;
await using var chroma = new ChromaBuilder("chromadb/chroma:1.5.9").Build();
await chroma.StartAsync();
using var client = new ChromaClient(chroma.GetConnectionString());
var collection = await client.CreateCollectionAsync("documents");
Console.WriteLine($"{collection.Name} on {chroma.GetConnectionString()}");Tested on 25 October 2026 with ChromaDotNet.Testcontainers 0.1.7 and ChromaDotNet.Client 2.18.0.
Origin
The module follows the structure of the Testcontainers for .NET modules. It is proposed to Testcontainers for .NET in testcontainers/testcontainers-dotnet#1784.