> ## 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.

# Store app data and expose files

> Mount durable app data and choose which volumes owners can access through the file manager.

Mount a named volume where your app writes data that must survive restarts. Add `x-zenith.storage` metadata to describe that volume to Zenith.

## Declare and mount the volume

Add these blocks to your existing manifest. Replace `app` with your service name and `/app/uploads` with its data directory.

> [!WARNING]
>
> Keep database files, indexes, and credentials private. The following example enables owner file-manager access for uploaded files.

```yaml theme={"theme":{"light":"github-light-default","dark":"vitesse-black"}}
x-zenith:
  storage:
    uploads:
      volume: app_uploads
      label: Uploaded files
      description: Images and documents uploaded by app users.
      public: true

services:
  app:
    volumes:
      - app_uploads:/app/uploads

volumes:
  app_uploads:
```

## Keep app data across restarts

Configure your app to write uploads to the mounted directory. Preserve existing files when the app starts.

Create a test upload, restart the app, and confirm that the app can still read the file.

## Choose which files owners can access

Set `public: true` for a volume that the owner can browse through the file manager. Omit `public` or set it to `false` to keep the volume private.

The `public` field controls owner file-manager access. It does not publish files to the internet.

For a specific editable settings file, use [configuration files](https://docs.zenith.hosting/content/configuration-files.md). You can expose that editor while keeping the volume private.

See the [`storage` reference](https://docs.zenith.hosting/content/zenith-compose-reference#storage) for field and volume validation rules.


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