By the end of this guide you will have MinIO and Redis running in Docker, a compiled strategy bundle ready, and a backtest executing against live OHLCV data — all persisted to your local S3-compatible object store. The host-node path (Node.js on your machine, containers for infrastructure) is the fastest way to iterate; a fully containerised deployment option is covered at the end.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/backtest-kit/backtest-kit-minio-s3-docker/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Make sure the following tools are installed before you begin:
| Tool | Minimum version | Check command |
|---|---|---|
| Node.js | 18+ | node --version |
| Docker | Any recent | docker --version |
| Docker Compose | V2 (compose sub-command) or standalone | docker compose version |
The project uses
rollup to compile TypeScript and @backtest-kit/cli to launch the runner. Both are installed as local npm dependencies — no global installs are required beyond Node.js itself.Clone the repository and install dependencies
npm install completes, the project tree includes:src/— TypeScript source for adapters, services, and strategy entry pointsdocker/— standalonedocker-composefiles for MinIO and Redisdocker-compose.yaml— root compose file for the fully containerised runner.env.example— environment template (copy to.envbefore running)
Configure the environment
Copy the example file and open it in your editor:The full contents of Variable reference:
.env.example are:| Variable | Description |
|---|---|
CC_MINIO_ENDPOINT | Hostname or IP of the MinIO server. Use host.docker.internal when running the strategy inside a container, or 127.0.0.1 for a host-node run. |
CC_MINIO_PORT | MinIO S3 API port. Default is 9000. |
CC_MINIO_ACCESSKEY | MinIO access key. Matches MINIO_ROOT_USER in the compose file (minioadmin by default). |
CC_MINIO_SECRETKEY | MinIO secret key. Matches MINIO_ROOT_PASSWORD in the compose file (minioadmin by default). |
CC_REDIS_HOST | Hostname or IP of the Redis server. Same host.docker.internal / 127.0.0.1 rule applies. |
CC_REDIS_PORT | Redis port. Default is 6379. |
CC_REDIS_USER | Redis ACL username. The default Redis setup uses default. |
CC_REDIS_PASSWORD | Redis requirepass value. Set to mysecurepassword in the provided compose file. |
Start MinIO and Redis
Launch both infrastructure containers with their dedicated compose files:What each command starts:You should see
- MinIO — image
tripolskypetr/minio:2022, S3 API on:9000, management console on:9001, data persisted todocker/minio/minio_data/. Thebacktest-kitbucket is created automatically viaMINIO_DEFAULT_BUCKETS. - Redis — image
redis:7.4.1, port:6379, passwordmysecurepassword, data persisted todocker/redis/redis_data/.
minio and redis listed with status Up.MinIO console is available at http://localhost:9001. Log in with:- Username:
minioadmin - Password:
minioadmin
backtest-kit bucket, inspect stored objects, configure lifecycle rules, and monitor usage.Build the strategy bundle and run a backtest
The Flag reference:
On first run the adapter’s
npm run start script compiles the TypeScript source with Rollup and then hands off to @backtest-kit/cli:| Flag | Purpose |
|---|---|
--entry | Gates execution — without this flag the runner imports the bundle but does not call main(). Required whenever you want the strategy to actually run. |
--backtest | Selects backtest mode. The src/main/backtest.ts entrypoint checks for this flag, warms historical candles, and launches Backtest.background(). |
--ui | Enables the built-in web UI, served on port :60050. Omit this flag for headless / CI runs. |
./build/index.cjs | Path to the compiled strategy bundle produced by npm run build. |
waitForInit() gates execution until Redis is ready, then warmCandles() fetches OHLCV data from the exchange and writes it into MinIO before the strategy loop begins.Running in Different Modes
The same infrastructure supports all three backtest-kit execution modes. Switch modes by changing the flag passed after--entry:
- Backtest
- Live
- Paper
Replays historical candles stored in MinIO against your strategy. The
warmCandles() fetches any missing OHLCV data from the configured exchange before the replay begins.src/main/backtest.ts entrypoint:- Waits for Redis to be ready (
ioc.redisService.waitForInit()) - Calls
waitForReady(true)— initialises adapters withinitial = true - Warms the candle cache for the configured symbol and date range
- Launches
Backtest.background()with the configured exchange, frame, and strategy names
Full Docker Deployment
The quick-start above runs Node.js on your host machine with only the infrastructure containers. For a fully containerised deployment — where the strategy runner itself is also a container — use the rootdocker-compose.yaml:
Full Docker deployment details, environment variable overrides (
MODE, SYMBOL, STRATEGY, EXCHANGE, FRAME, TELEGRAM, VERBOSE, NO_CACHE, NO_FLUSH), and the container healthcheck configuration are covered in the Full Docker Deployment guide.