Milvus Lite 3.x as a standalone gRPC server — multi-arch, non-root, ~470 MB
948
Milvus Lite is the lightweight, embedded edition of Milvus. Upstream ships it as a Python library only — there is no official server. This image wraps it into a standalone gRPC server that any Milvus SDK can talk to, exactly like a remote Milvus instance.
Source code, issues and the release pipeline: https://github.com/Kennytian/milvus-lite
docker run -d --name milvus-lite \
-p 127.0.0.1:19530:19530 \
-v milvus-data:/data \
--restart unless-stopped \
kennytian/milvus-lite:latest
linux/amd64 and linux/arm64 (native on Apple Silicon, AWS Graviton, ARM servers)10001, tini as PID 1SIGINT drains in-flight RPCs and releases the data-dir lock/data — mount a volume or a bind mountdocker run -d --name milvus-lite \
-p 127.0.0.1:19530:19530 \
-v milvus-data:/data \
--restart unless-stopped \
kennytian/milvus-lite:latest
docker logs -f milvus-lite
# MilvusLite gRPC server listening on 0.0.0.0:19530 (data_dir='/data')
The server starts unauthenticated by default. To set a password, pass one of the auth environment variables — either a single token, or a username + password pair:
# token form
docker run -d --name milvus-lite \
-e MILVUS_LITE_TOKEN=s3cr3t \
-p 127.0.0.1:19530:19530 \
-v milvus-data:/data \
--restart unless-stopped \
kennytian/milvus-lite:latest
# username + password form
docker run -d --name milvus-lite \
-e MILVUS_LITE_USERNAME=alice \
-e MILVUS_LITE_PASSWORD=w0nder \
-p 127.0.0.1:19530:19530 \
-v milvus-data:/data \
--restart unless-stopped \
kennytian/milvus-lite:latest
Once any of the three is set, every RPC must carry matching credentials. See Authentication below for how clients pass them.
services:
milvus-lite:
image: kennytian/milvus-lite:latest
container_name: milvus-lite
environment:
# Set a password — either a token, or a username + password pair.
# Leave all three empty to run unauthenticated.
MILVUS_LITE_TOKEN: "s3cr3t"
# MILVUS_LITE_USERNAME: alice
# MILVUS_LITE_PASSWORD: w0nder
ports:
- "127.0.0.1:19530:19530"
volumes:
- ./data:/data
restart: unless-stopped
stop_signal: SIGINT
deploy:
resources:
limits:
memory: 1G
A ready-to-use docker-compose.yml with .env overrides lives in the repository. It wires
MILVUS_LITE_TOKEN / MILVUS_LITE_USERNAME / MILVUS_LITE_PASSWORD through from a .env
file (copy .env.example
to .env and fill them in):
# .env
MILVUS_LITE_TOKEN=s3cr3t
docker compose pull && docker compose up -d
The server speaks gRPC on port 19530. Any official Milvus SDK works — Python, Go, Java, C#,
Node.js — just point it at host:19530. The repository ships two ready-to-run, end-to-end examples
(create → insert → load → search, with auth) so you can verify a deployment in seconds:
| Language | SDK | Run |
|---|---|---|
| Bun / Node.js | @zilliz/milvus2-sdk-node (3.x) | bun run demo.ts |
| Python | pymilvus (3.x) | python demo.py |
Both live under examples/ and
read the same environment variables, so the auth story is identical across languages:
# Bun.js
cd examples/bunjs
bun install
MILVUS_LITE_TOKEN=s3cr3t bun run demo.ts
# Python
cd examples/python
pip install -r requirements.txt
MILVUS_LITE_TOKEN=s3cr3t python demo.py
A minimal Bun.js example, inlined for reference (full source in
examples/bunjs/demo.ts):
import { MilvusClient, DataType, MetricType } from '@zilliz/milvus2-sdk-node';
const client = new MilvusClient({ address: '127.0.0.1:19530', token: 's3cr3t' });
await client.connectPromise;
await client.createCollection({
collection_name: 'demo',
fields: [
{ name: 'id', data_type: DataType.Int64, is_primary_key: true, autoID: true },
{ name: 'text', data_type: DataType.VarChar, max_length: 512 },
{ name: 'vector', data_type: DataType.FloatVector, dim: 8 },
],
index_params: [{ field_name: 'vector', index_type: 'FLAT', metric_type: MetricType.IP, params: {} }],
});
await client.loadCollectionSync({ collection_name: 'demo' });
await client.insert({
collection_name: 'demo',
data: [
{ vector: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8], text: 'hello world' },
{ vector: [0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2], text: 'another doc' },
],
});
const res = await client.search({
collection_name: 'demo',
data: [[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]],
limit: 2,
consistency_level: 'Strong',
output_fields: ['text'],
});
console.log(res.results);
await client.closeConnection();
The Node.js SDK has no embedded mode — it always needs a reachable server, which is exactly what this image provides. The Python SDK does have one (
MilvusClient("./x.db")), but never point it at the container's data directory: the file lock allows a single process only. Use the URL.
| Variable | Default | Description |
|---|---|---|
MILVUS_LITE_DATA_DIR | /data | Data directory (a directory, not a single file) |
MILVUS_LITE_HOST | 0.0.0.0 | Listen address inside the container |
MILVUS_LITE_PORT | 19530 | gRPC port inside the container |
MILVUS_LITE_BIND_ADDR | 127.0.0.1 (compose only) | Host address the port is published on |
MILVUS_LITE_HOST_PORT | 19530 (compose only) | Host port |
MILVUS_LITE_TOKEN | (empty) | Optional: accept a single API token |
MILVUS_LITE_USERNAME | (empty) | Optional: accept username:password (paired with MILVUS_LITE_PASSWORD) |
MILVUS_LITE_PASSWORD | (empty) | Optional: paired with MILVUS_LITE_USERNAME |
Publish to 0.0.0.0 only on a trusted network — see Security below.
Milvus Lite itself ships no auth, so this image adds a thin, optional gate in front of the gRPC
server. When at least one of MILVUS_LITE_TOKEN / MILVUS_LITE_USERNAME+MILVUS_LITE_PASSWORD is
set, every RPC must carry matching credentials in the authorization metadata — exactly what the
official SDKs already send. Leave all three empty and the server is unauthenticated, as before.
# token form
docker run -e MILVUS_LITE_TOKEN=s3cr3t -p 127.0.0.1:19530:19530 kennytian/milvus-lite
# username + password form
docker run -e MILVUS_LITE_USERNAME=alice -e MILVUS_LITE_PASSWORD=w0nder -p 127.0.0.1:19530:19530 kennytian/milvus-lite
Clients pass the same value through their normal SDK auth field — no custom code:
# token
MilvusClient(uri, token="s3cr3t")
# username + password
MilvusClient(uri, user="alice", password="w0nder")
new MilvusClient({ address: '127.0.0.1:19530', token: 's3cr3t' });
What this is not: it is a single shared credential, not per-user RBAC, and it does not add TLS. It only keeps the port from being trivially open to anyone who can reach it. Pair it with a TLS terminating proxy (or a private network) when the service leaves the loopback.
Everything is under /data (collections/, databases/, LOCK):
docker compose stop # stop first: the LOCK must be released
tar czf milvus-data-$(date +%F).tgz data/
docker compose start
Restore by unpacking the archive back into the same directory. The on-disk format is
Milvus Lite 3.x; 2.x .db files are not readable by 3.x (the storage engine changed).
Export a collection to BulkWriter JSON (for importing into Milvus Standalone / Zilliz Cloud):
docker compose run --rm --entrypoint sh milvus-lite -c \
'milvus-lite dump -d /data -c demo -p /data/export'
| Tag | Meaning |
|---|---|
latest | newest published version |
3, 3.2 | newest patch of that major / minor line |
3.2.2 | exact milvus-lite version baked into the image |
A GitHub Actions workflow keeps the image in lockstep with upstream:
Dockerfile, entrypoint.sh, requirements.txt or scripts/ rebuilds and republishes;milvus-lite. If that is newer than the pin, it builds,
smoke-tests, pushes the new tags and commits the bump back to requirements.txt;workflow_dispatch) can rebuild any specific version.The version lives in exactly one place — requirements.txt:
pymilvus==3.0.2 # bumped automatically to the newest 3.x on every build
milvus-lite==3.2.2 # <- change this line to publish 3.2.3
You never have to watch pymilvus. Whenever the workflow builds a new milvus-lite version it
also resolves the newest pymilvus release of the same major from PyPI, installs that, and commits
the pin back to requirements.txt. Already published tags are never rebuilt, so a tag keeps
pointing at the exact bytes it was published with.
If you want a pymilvus-only refresh between milvus-lite releases, run the workflow manually
(Actions → Release → Run workflow) — a manual run always rebuilds, even for an existing tag.
Images are built for both architectures, smoke-tested on linux/amd64, and published as a
multi-arch manifest list.
# single architecture, for your machine
docker build -t my/milvus-lite:dev .
# both architectures
docker buildx build --platform linux/amd64,linux/arm64 -t my/milvus-lite:dev .
Run the same smoke test the CI uses:
./scripts/smoke-test.sh my/milvus-lite:dev
Milvus Lite has no users, no RBAC and no TLS — upstream explicitly warns against exposing it to
an untrusted network. This image adds an optional single-credential gate (see Authentication),
but that is not a substitute for TLS or per-user access control. Keep the published port bound to
127.0.0.1, or put a TLS-terminating proxy in front of it. The container runs unprivileged, but that
does not make the service safe to expose.
UNIMPLEMENTED; schema changes and partition-level load/release are unavailable.BINARY/FLOAT16/BFLOAT16/INT8 vectors, no PQ-family indexes.Good fit: local development, CI, edge devices, small single-node workloads. For production scale use Milvus Standalone/Distributed or Zilliz Cloud.
The workflow needs two repository secrets:
| Secret | Value |
|---|---|
DOCKERHUB_USERNAME | Docker Hub account that owns the repository |
DOCKERHUB_TOKEN | Docker Hub access token with Read, Write, Delete scope (not the password) |
The token needs the delete permission only because the workflow also keeps the Docker Hub
description in sync with README.md (Account settings → Personal access tokens).
GITHUB_TOKEN with contents: write is used to commit automatic version bumps — check
Settings → Actions → General → Workflow permissions.
MIT. Source, issues and the release pipeline live at https://github.com/Kennytian/milvus-lite.
Milvus and Milvus Lite are Apache-2.0 licensed projects of the LF AI & Data Foundation; this image is an unofficial packaging of the upstream package and comes with no warranty.
Content type
Image
Digest
sha256:d6d12cae6…
Size
154.6 MB
Last updated
18 days ago
docker pull kennytian/milvus-lite