> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zenith.hosting/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Start with https://docs.zenith.hosting/content/quickstart.md. Use NO_COLOR=1 for plain CLI output in non-interactive agent sessions. Run without a TTY and supply explicit template and publishing inputs; NO_COLOR does not bypass prompts or authorization.
> For temporary deployments, read https://docs.zenith.hosting/content/up.md. For publishing and review, read https://docs.zenith.hosting/content/publish.md. A preview uploads local files; publishing uses a pinned public GitHub commit.
> Before creating, changing, or approving zenith-compose.yml, read https://docs.zenith.hosting/llms.txt, then read https://docs.zenith.hosting/content/zenith-compose.md and the complete public schema at https://docs.zenith.hosting/content/zenith-compose-reference.md. Generate only documented fields and follow their validation and completion checks.
> Before creating, changing, publishing, or verifying a container image for Zenith, read https://docs.zenith.hosting/content/containerise.md.
> Treat these live Markdown pages as the source of truth instead of relying on memory or a copied Zenith Compose specification.
> Do not push commits, submit an app, merge pull requests, publish container images, or change registry visibility unless the user explicitly authorizes that external action. Do not bypass browser OAuth, GitHub connection, or Developer Agreement acceptance.

# Expose configuration files

> Let users edit your app's configuration files in Zenith.

Add a file to `x-zenith.configs` so users can edit it in Zenith. When they apply a change, Zenith saves the file and restarts the app.

## Create the file in your app

> [!WARNING]
>
> Do not replace the file with default settings every time your app starts. That would erase the user's edits after a restart. Add comments that identify settings users must keep unchanged.

Your app must create its starting configuration when the file is missing. Store it in a volume so it survives restarts.

For example, your app could read its settings from `/config/app.yml`. On first launch, create that file with your default settings. On later launches, use the existing file so you keep the user's changes.

## Add the file to `zenith-compose.yml`

Add the following fields to your existing file. Replace `app` with your service name and use the folder and filename your app reads. Keep your existing image, catalogue, endpoint, and other settings.

```yaml zenith-compose.yml theme={"theme":{"light":"github-light-default","dark":"vitesse-black"}}
services:
  app:
    volumes:
      - settings:/config

volumes:
  settings:

x-zenith:
  storage:
    settings:
      volume: settings
      label: App settings
  configs:
    - storage: settings
      path: /app.yml
      label: App configuration
      type: yaml
```

The example uses these paths:

* `settings:/config` puts the volume at `/config` inside your app.
* `storage: settings` chooses that volume through its `x-zenith.storage` entry.
* `path: /app.yml` points to `/config/app.yml` inside your app. The path starts at the volume's root, so leave out `/config`.

The volume stays private by default. Users can edit the file you declare without browsing the rest of the volume. You do not need `public: true`.

Set `type` to your file format, such as `yaml`, `json`, `ini`, or `toml`, for syntax highlighting. You can also leave it out and let Zenith use the filename extension.

## Check that changes work

Check that your app uses the new setting after restarting. Restart it again and check that the change is still there.

If the app fails to start, correct the saved settings and retry the restart. Zenith saves text files without validating the app's configuration format.

For all fields and file restrictions, see the [`configs` reference](https://docs.zenith.hosting/content/zenith-compose-reference#configs).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.