Skip to content

Commit 6aa467b

Browse files
committed
chore: Refreshed running chroma docs
- Added example of custom persist dir in the docker example.
1 parent 5f882fc commit 6aa467b

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

docs/running/running-chroma.md

+22-11
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ pip install chromadb
1919
chroma run --host localhost --port 8000 --path ./my_chroma_data
2020
```
2121

22-
`--host` The host to which to listen to, by default it is `[localhost](http://localhost:8000/docs)` , but if you want to expose it to your entire network then you can specify `0.0.0.0``
22+
`--host` The host to which to listen to, by default it is `[localhost](http://localhost:8000/docs)` , but if you want to
23+
expose it to your entire network then you can specify `0.0.0.0``
2324

2425
`--port` The port on which to listen to, by default this is `8000`.
2526

@@ -39,14 +40,20 @@ docker run -d --rm --name chromadb -v ./chroma:/chroma/chroma -e IS_PERSISTENT=T
3940

4041
Options:
4142

42-
- `-v` specifies a local dir which is where Chroma will store its data so when the container is destroyed the data remains
43+
- `-v` specifies a local dir which is where Chroma will store its data so when the container is destroyed the data
44+
remains. Note: If you are using `-e PERSIST_DIRECTORY` then you need to point the volume to that directory.
4345
- `-e` `IS_PERSISTENT=TRUE` let’s Chroma know to persist data
44-
- `-e ANONYMIZED_TELEMETRY=TRUE` allows you to turn on (`TRUE`) or off (`FALSE`) anonymous product telemetry which helps the Chroma team in making informed decisions about Chroma OSS and commercial direction.
45-
- `chromadb/chroma:latest` indicates the latest Chroma version but can be replaced with any valid tag if a prior version is needed (e.g. `chroma:0.4.18`)
46+
- `-e` `PERSIST_DIRECTORY=/path/in/container` specifies the path in the container where the data will be stored, by
47+
default it is `/chroma/chroma`
48+
- `-e ANONYMIZED_TELEMETRY=TRUE` allows you to turn on (`TRUE`) or off (`FALSE`) anonymous product telemetry which helps
49+
the Chroma team in making informed decisions about Chroma OSS and commercial direction.
50+
- `chromadb/chroma:latest` indicates the latest Chroma version but can be replaced with any valid tag if a prior version
51+
is needed (e.g. `chroma:0.4.24`)
4652

4753
### Docker Compose (Cloned Repo)
4854

49-
If you are feeling adventurous you can also use the Chroma `main` branch to run a local Chroma server with the latest changes:
55+
If you are feeling adventurous you can also use the Chroma `main` branch to run a local Chroma server with the latest
56+
changes:
5057

5158
Prerequisites:
5259

@@ -61,12 +68,13 @@ docker compose up -d --build
6168
If you want to run a specific version of Chroma you can checkout the version tag you need:
6269

6370
```shell
64-
git checkout release/0.4.20
71+
git checkout release/0.4.24
6572
```
6673

6774
### Docker Compose (Without Cloning the Repo)
6875

69-
If you do not wish or are able to clone the repo locally, Chroma server can also be run with docker compose by creating (or using a gist) a `docker-compose.yaml`
76+
If you do not wish or are able to clone the repo locally, Chroma server can also be run with docker compose by
77+
creating (or using a gist) a `docker-compose.yaml`
7078

7179
Prerequisites:
7280

@@ -86,14 +94,16 @@ services:
8694
- ./chromadb:/chroma/chroma
8795
environment:
8896
- IS_PERSISTENT=TRUE
97+
- PERSIST_DIRECTORY=/chroma/chroma # this is the default path, change it as needed
8998
- ANONYMIZED_TELEMETRY=${ANONYMIZED_TELEMETRY:-TRUE}
9099
ports:
91100
- 8000:8000
92101
networks:
93102
- net
94103
```
95104
96-
The above will create a container with the latest Chroma (`chromadb/chroma:latest`), will expose it to port `8000` on the local machine and will persist data in `./chromadb` relative path from where the `docker-compose.yaml` has been ran.
105+
The above will create a container with the latest Chroma (`chromadb/chroma:latest`), will expose it to port `8000` on
106+
the local machine and will persist data in `./chromadb` relative path from where the `docker-compose.yaml` has been ran.
97107

98108
We have also created a small gist with the above file for convenience:
99109

@@ -130,7 +140,7 @@ Get and install the chart:
130140
```bash
131141
helm repo add chroma https://amikos-tech.github.io/chromadb-chart/
132142
helm repo update
133-
helm install chroma chroma/chromadb --set chromadb.apiVersion="0.4.20"
143+
helm install chroma chroma/chromadb --set chromadb.apiVersion="0.4.24"
134144
```
135145

136146
By default the chart will enable authentication in Chroma. To get the token run the following:
@@ -163,8 +173,9 @@ import chromadb
163173
from chromadb.config import Settings
164174
165175
client = chromadb.HttpClient(host="http://127.0.0.1:61892",
166-
settings=Settings(chroma_client_auth_provider="chromadb.auth.token.TokenAuthClientProvider",
167-
chroma_client_auth_credentials="<your_chroma_token>"))
176+
settings=Settings(
177+
chroma_client_auth_provider="chromadb.auth.token.TokenAuthClientProvider",
178+
chroma_client_auth_credentials="<your_chroma_token>"))
168179
client.heartbeat() # this should work with or without authentication - it is a public endpoint
169180
170181
client.get_version() # this should work with or without authentication - it is a public endpoint

0 commit comments

Comments
 (0)