---
title: "Volumes"
description: "Persist and serve files for StackMachine apps."
---

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

# Volumes

Cloud Storage is managed through app volumes. Volumes give a running app persistent file storage at a mount path, and can expose S3-compatible access when you need direct object workflows.

## Features

### Persistent volumes

Create a volume for an app, choose the mount path, and set a maximum size. The volume stays with the app across deployments.

### S3-enabled access

Turn on `s3Enabled` when the same storage should be reachable from S3-compatible tooling or object workflows.

### Explorer and storage URLs

Volume records expose `s3Url` and `explorerUrl` when available, so dashboards and tools can deep-link into stored files.

### Redeploy after storage changes

Use `redeployApp` when changing volume settings should immediately roll the app onto a version with the updated storage mount.

## Common workflow

1. Create the volume with an app ID and mount path.
2. Update the volume to enable S3 access or adjust settings.
3. Redeploy the app when the runtime needs the new mount.
4. List volumes to audit storage attached to the app.

## SDK examples

### Create an S3-enabled app volume

Create persistent app storage, enable S3 access, print explorer URLs, and list attached volumes.

```javascript
const volume = await client.apps.volumes.create({
  app: "da_XYZ",
  mountPath: "/uploads",
  maxSizeBytes: 1_073_741_824,
});

const updated = await client.apps.volumes.update(volume.id, {
  mountPath: "/uploads",
  s3Enabled: true,
  redeployApp: true,
});

console.log(updated.mountPath, updated.s3Enabled, updated.s3Url);
console.log(updated.explorerUrl);

const volumes = await client.apps.volumes
  .list({ app: "da_XYZ", limit: 10 })
  .autoPagingToArray({ limit: 25 });
console.log(volumes.map((item) => item.mountPath));
```

```python
from itertools import islice

volume = client.apps.volumes.create(
    app="da_XYZ", mount_path="/uploads", max_size_bytes=1_073_741_824,
)
updated = client.apps.volumes.update(
    volume.id, mount_path="/uploads", s3_enabled=True, redeploy_app=True,
)
print(updated.mount_path, updated.s3_enabled, updated.s3_url)
print(updated.explorer_url)

volumes = list(islice(client.apps.volumes.list(app="da_XYZ", limit=10), 25))
print([item.mount_path for item in volumes])
```

## Related docs

- [Get app by ID](/apps/get-by-id)
- [Redeploy](/apps/deployments/redeploy)

> Source: [stackmachine/sdks](https://github.com/stackmachine/sdks/tree/main/js) JavaScript examples.

Source: https://docs.stackmachine.com/volumes/index.mdx
