# Testcontainers

> Unit tests with real dependencies

Source: https://talira.ai/catalog/testcontainers-7ggnf5qp
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [developer tools / testing / integration](https://talira.ai/categories/developer-tools/testing/integration), [developer tools / testing](https://talira.ai/categories/developer-tools/testing), [developer tools / environment / containers](https://talira.ai/categories/developer-tools/environment/containers)
- Platforms: linux, macos, windows[^1]
- Licence: MIT[^2][^4][^5]
- Pricing: Free and open source[^2][^3]
- Free tier: yes[^2][^3]
- Self-hostable: yes[^6]
- Backed by: [Docker](https://talira.ai/orgs/docker.md)
- Funding: Series C, 2022[^7]

Testcontainers is an open source library for tests that need real dependencies: from test code it starts throwaway, lightweight instances of databases, message brokers, web browsers or anything else that runs in a container, waits until they're ready and removes them afterwards. It has implementations for Java, Go, [.NET](https://talira.ai/catalog/net-9p8d54vj.md), Node.js, Python, Rust, Ruby, PHP, Haskell, Clojure, [Elixir](https://talira.ai/catalog/elixir-edq5dfnt.md), Scala and native code, and about 140 ready-made modules ([PostgreSQL](https://talira.ai/catalog/postgresql-cm55wcnd.md), Kafka, [Redis](https://talira.ai/catalog/redis-v917j45s.md), LocalStack, [Ollama](https://talira.ai/catalog/ollama-gr2tx5nn.md) and more); the Java library integrates with JUnit 4, JUnit 5 and Spock. It needs a Docker-API compatible runtime: [Docker Engine](https://talira.ai/catalog/docker-engine-9442r3nw.md) on Linux, [Docker Desktop](https://talira.ai/catalog/docker-desktop-c9vm7nb4.md) or [Testcontainers Cloud](https://talira.ai/catalog/testcontainers-cloud-pv195b44.md), with [Podman](https://talira.ai/catalog/podman-dsk3mjnr.md), [Colima](https://talira.ai/catalog/colima-et45brqd.md) and [Rancher Desktop](https://talira.ai/catalog/rancher-desktop-49a2z9zb.md) usable but not actively tested. AtomicJar made it, and Docker, which acquired AtomicJar in December 2023, keeps the libraries open source: MIT for Java, Go, Node.js and .NET, Apache-2.0 for Python, MIT or Apache-2.0 for Rust.

## Links

- Website: https://testcontainers.com
- GitHub: https://github.com/testcontainers/testcontainers-java
- Docs: https://testcontainers.com/getting-started/

## Problems it solves

- integration tests against a real Postgres instead of an in-memory fake like H2
- spin up a real database in a Docker container for each integration test run and throw it away afterwards
- spin up Kafka in a container for a test run and tear it down afterwards
- our tests share one database and keep stepping on each other's data
- mocks of our cloud services in tests don't catch real bugs
- start Redis and Elasticsearch from test code without a docker-compose file
- run Selenium browser tests in throwaway containers
- integration tests that work the same on every developer's laptop and in CI
- test against the exact database version we run in production
- test our AWS code against LocalStack from the test suite
- start a local LLM with Ollama for integration tests
- wait until a container's service is actually ready before the test starts
- a JUnit 5 extension that manages container lifecycles for tests
- Go integration tests with real dependencies running in Docker

## Features

- throwaway containers started and removed from test code
- libraries for Java, Go, .NET, Node.js, Python, Rust, Ruby, PHP, Haskell, Clojure, Elixir, Scala and native code
- about 140 modules in 11 categories: relational and NoSQL databases, message brokers, cloud emulators, vector databases, inference engines and more
- wait strategies that hold the test until a service is ready
- networking, command execution, file copying, container logs and images built on the fly
- JUnit 4, JUnit 5 (Jupiter) and Spock integrations in Java
- reusable containers (experimental in Java)
- image name substitution for private registries and mirrors
- runs against Docker Engine, Docker Desktop or Testcontainers Cloud

## Limitations

- Needs a Docker-API compatible container runtime: Podman, Colima and Rancher Desktop work with extra setup but aren't actively tested[^1]

## Capabilities

- Has official SDKs: plan not known

## Trust

Overall: 0.37 out of 1.
Signals: backing 0.55, extensibility 0.00.

- backed by Docker
- funding: Series C, 2022

Warnings:

- GitHub activity not fetched yet

## Related

- Works with [Docker Engine](https://talira.ai/catalog/docker-engine-9442r3nw.md)

## Sources

[^1]: https://java.testcontainers.org/supported_docker_environment/ (checked 20 Nov 2026)
[^2]: https://github.com/testcontainers/testcontainers-java/blob/main/LICENSE (checked 20 Nov 2026)
[^3]: https://www.docker.com/blog/docker-whale-comes-atomicjar-maker-of-testcontainers/ (checked 20 Nov 2026)
[^4]: https://github.com/testcontainers/testcontainers-python/blob/main/LICENSE.txt (checked 20 Nov 2026)
[^5]: https://github.com/testcontainers/testcontainers-rs/blob/main/LICENSE-MIT (checked 20 Nov 2026)
[^6]: https://testcontainers.com (checked 20 Nov 2026)
[^7]: https://www.docker.com/press-release/accelerate-investments-in-developer-productivity-trusted-content-and-ecosystem-partnerships/ (checked 20 Nov 2026)
