> For the complete documentation index, see [llms.txt](https://docs.zama.org/protocol/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zama.org/protocol/sdk/api-references/daemon-configuration.md).

# Daemon configuration

Environment variables that configure the Zama SDK daemon used by Go and Rust applications.

The daemon reads its process configuration from environment variables at startup. Chain, relayer, and storage choices belong to each SDK context and are set by your application; see [Configuration](https://docs.zama.org/protocol/sdk/guides/configuration.md).

## Process environment

| Variable                                     | Default              | Purpose                                                                                                                                          |
| -------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `ZAMA_SDK_DAEMON_SOCKET_PATH`                | Required; no default | Absolute path of the Unix socket the daemon listens on. Its parent directory must be private to the daemon UID.                                  |
| `ZAMA_SDK_DAEMON_STORAGE_DIR`                | Unset                | Absolute path of the directory holding daemon SQLite credential stores. Contexts that select named persistent storage fail while it is unset.    |
| `ZAMA_SDK_DAEMON_MAX_MESSAGE_BYTES`          | `4194304`            | Largest request or response message, in bytes. Set the matching limit in the client.                                                             |
| `ZAMA_SDK_DAEMON_MAX_CONCURRENT_STREAMS`     | Unset (no limit)     | Maximum concurrent gRPC streams per connection. Each attached signer, application storage, or event channel holds one stream.                    |
| `ZAMA_SDK_DAEMON_MAX_CONTEXTS`               | Unset (no limit)     | Maximum open SDK contexts. Creating another context fails with `CONTEXT_LIMIT`.                                                                  |
| `ZAMA_SDK_DAEMON_MAX_OPERATIONS_PER_CONTEXT` | Unset (no limit)     | Maximum in-flight operations per SDK context. Another operation fails with `OPERATION_LIMIT`.                                                    |
| `ZAMA_SDK_DAEMON_SHUTDOWN_TIMEOUT_MS`        | `120000`             | Longest wait, in milliseconds, for running SDK work after `SIGTERM` or `SIGINT`. Past it, the daemon removes its socket and exits with status 1. |

Numeric limits must be positive integers. The daemon exits at startup when a path is relative or a limit is invalid.

The client message limit is set with Go `DialOptions.MaxMessageBytes` or Rust `Client::with_message_limit`.

For the codes these limits and other daemon failures return, see [Daemon error codes](https://docs.zama.org/protocol/sdk/api-references/error-codes.md).


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.zama.org/protocol/sdk/api-references/daemon-configuration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
