> For the complete documentation index, see [llms.txt](https://docs.tonic.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tonic.ai/app/admin/configuring-a-self-hosted-instance/setting-a-custom-certificate.md).

# Setting a custom certificate

Tonic Structural provides a certificate for https traffic, but can also use a user-provided certificate. The certificate must:

* Use the the PFX format.
* Be named `tonic.pfx`.

To use your own certificate, you must:

* Add the `TONIC_PFX_PASSWORD` environment setting.
* Use a volume mount to provide the certificate file. Structural uses volume mounting to give the Structural containers access to the certificate.

You must apply the changes to both the Structural web server and Structural worker containers.

## Docker

To use your own certificate, you make the following changes to the **docker-compose.yml** file.&#x20;

### Environment setting

You must [add the environment setting](/app/admin/environment-variables-setting.md#environment-variables-set-docker) `TONIC_PFX_PASSWORD`, which contains the certificate password.

### **Volume mount**

You place the certificate on the host machine, then share it to the containers as a volume.

You must map the certificate to `/certificates` on the containers.

```
volumes:
        ...
        - /my-host-path:/certificates
```

## Kubernetes

### Environment setting

You must [add the environment setting](/app/admin/environment-variables-setting.md#environment-variable-set-kubernetes) `TONIC_PFX_PASSWORD`, which contains the certificate password.

### **Volume mount**

You can use any volume type that is allowed within your environment. It must provide at least [`ReadOnlyMany`](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes) access.

You must map the certificate to `/certificates` on the containers. Within your web server and worker deployment YAML files, the entry should be similar to the following:

```yaml
    volumeMounts:
    - name: <my-volume-name>
      mountPath: /certificates
```


---

# 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.tonic.ai/app/admin/configuring-a-self-hosted-instance/setting-a-custom-certificate.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.
