> For the complete documentation index, see [llms.txt](https://cayley.gitbook.io/cayley/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cayley.gitbook.io/cayley/deployment/container.md).

# Running in Docker

## Running in Kubernetes

To run Cayley in K8S check [this docs section](/cayley/deployment/k8s-1.md).

## Running in a container

A container exposing the HTTP API of Cayley is available.

### Running with default configuration

Container is configured to use BoltDB as a backend by default.

```
docker run -p 64210:64210 -d ghcr.io/cayleygraph/cayley
```

New database will be available at <http://localhost:64210>.

### Custom configuration

To run the container one must first setup a data directory that contains the configuration file and optionally contains persistent files (i.e. a boltdb database file).

```
mkdir data
cp cayley_example.yml data/cayley.yml
cp data/testdata.nq data/my_data.nq
# initialize and serve database
docker run -v $PWD/data:/data -p 64210:64210 -d ghcr.io/cayleygraph/cayley -c /data/cayley.yml --init -i /data/my_data.nq
# serve existing database
docker run -v $PWD/data:/data -p 64210:64210 -d ghcr.io/cayleygraph/cayley -c /data/cayley.yml
```

### Other commands

Container runs `cayley http` command by default. To run any other Cayley command reset the entry point for container:

```
docker run -v $PWD/data:/data ghcr.io/cayleygraph/cayley --entrypoint=cayley version
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cayley.gitbook.io/cayley/deployment/container.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
