---
title: "Volumes for sandboxes: disks that outlive them · Pethost"
description: "A Pethost volume is a disk that outlives sandboxes, mounted at a path: read-write by one sandbox or read-only by many, on one server. $0.20 per GiB-month."
---

[Agent Sandboxes](https://pethost.dev/sandboxes/) Volumes that outlive sandboxes

# Volumes: a disk that outlives its sandboxes

Some data should outlast a sandbox, or be read by many: a dataset, a package cache, a model’s weights. A volume holds it: a disk outside every sandbox, mounted at a path when a sandbox is created, and kept when the sandbox is deleted.

A 50 GiB volume on one server: a sandbox writes files to it at /data and is deleted; the volume and its files stay, and two new sandboxes mount it read-only.

## How sandbox volumes work

A volume is a disk of 1 to 1,000 GiB on one of our servers, a sparse ext4 image outside every sandbox. You make one with `create_volume` and mount it when you create a sandbox, at an absolute path such as `/data`. A sandbox mounts up to 4 volumes, and runs on the server that holds them.

One sandbox mounts a volume read-write, or any number of sandboxes mount it read-only, never both at once. A sandbox holds its mount until it is deleted: pausing or stopping it keeps the mount. So to hand a volume from the sandbox that filled it to its readers, delete the writer, then create the readers with read-only mounts. A fork of a sandbox that mounts volumes read-only mounts them too.

When a sandbox is deleted, the volume stays with its files, and the next sandbox that mounts it finds them as they were left. Each volume reports the bytes it uses and the sandboxes that mount it, and deleting it is refused while a sandbox mounts it. The [volumes guide](https://pethost.dev/docs/sandboxes/volumes/) has every call and field.

Python

CLI

```
from pethost.sandboxes import Mount, Sandboxes

sandboxes = Sandboxes()  # reads PETHOST_TOKEN
volume = sandboxes.create_volume("datasets", size_gib=50)

writer = sandboxes.create_sandbox(mounts=[Mount(volume_id=volume.volume_id, path="/data")])
sandboxes.run_command(writer.sandbox_id, command="seq 1 1000000 > /data/numbers.txt")
sandboxes.delete_sandbox(writer.sandbox_id)  # the volume stays

readers = [
    sandboxes.create_sandbox(mounts=[Mount(volume_id=volume.volume_id, path="/data", read_only=True)])
    for _ in range(3)
]
print(sandboxes.run_command(readers[0].sandbox_id, command="wc -l /data/numbers.txt").stdout)
# 1000000 /data/numbers.txt
```

```
vol=$(pethost sandbox volume new datasets --size 50)
pethost sandbox new --name writer --mount "$vol:/data"
pethost sandbox run writer -- 'seq 1 1000000 > /data/numbers.txt'
pethost sandbox rm writer -y                 # the volume stays
pethost sandbox new --mount "$vol:/data:ro"  # a reader
```

## What to know before you rely on a volume

A volume lives on one server’s disk and is not copied anywhere else. If that server is lost, the volume is lost with it, and the sandboxes that mounted it lose it too. Keep a copy elsewhere of anything you cannot lose. A sandbox’s own disk, by contrast, is copied to object storage a minute after the sandbox stops.

A volume also ties its sandboxes to its server. A stopped sandbox that mounts one starts again only there, where a sandbox without volumes may start on another server with room. A fork is refused while the sandbox mounts a volume read-write. A volume cannot be resized or mounted into a running sandbox yet, and one larger than half a server’s disk is refused. If a writer ended without unmounting it, because it crashed or was deleted while paused, mount the volume read-write once, which replays its journal, before any read-only mount.

A volume adds no disk speed. A sandbox’s volumes share its size’s disk rate with its own disk: 64 MiB/s and 1,500 operations a second per vCPU, so 128 MiB/s and 3,000 for a SMALL.

## What a volume costs

A volume is billed by its whole size, used or not, at $0.20 per GiB a month, counted by the second. Your plan bounds the GiB your volumes hold together:

| Plan | Volumes, all together |
| --- | --- |
| The trial | 10 GiB |
| $20 a month | 100 GiB |
| $100 a month | 600 GiB |
| $500 a month | 3,500 GiB |
| $2,000 a month | 16,000 GiB |

For files that belong to one sandbox, its own disk costs less: a stopped sandbox pays $0.03 per GiB a month of the data it holds, and a [template](https://pethost.dev/sandboxes/templates/) carries files to new sandboxes for nothing within your plan’s template room. A [fork](https://pethost.dev/sandboxes/fork/) copies a sandbox’s own disk along with its memory; a volume is never copied.

## How it compares

Volumes cost more at Pethost than at the vendors we read on 21 November 2026. Modal charged $0.09 per GiB a month, Blaxel $0.12 per GB, and Daytona included volumes at no cost, up to 100 an organization; E2B’s volumes were in private beta. Use a volume where several sandboxes read the same data, or where data must outlive the sandbox that made it; keep the rest on a sandbox’s own disk.

[Read the docs](https://pethost.dev/docs/sandboxes/volumes/)

## Questions

**Is a sandbox volume backed up?**

No. It lives on one server’s disk and is not copied. Keep a copy elsewhere of what you cannot lose. A stopped sandbox’s own disk is copied to object storage.

**Can two sandboxes write to a volume?**

Not at once. One sandbox mounts it read-write, or any number mount it read-only, and a sandbox keeps its mount until it is deleted.

**Can I mount a volume into a running sandbox?**

Not yet. Mounts are set when a sandbox is created, up to 4 of them.

**What does a volume cost?**

$0.20 per GiB a month of its whole size, used or not, counted by the second.

## Related

- [A sandbox with its packages and Docker images is saved as the template my-app@3 in 1.2 s, and three new sandboxes start from it on two servers. Save a sandbox as a template Save a sandbox’s disk, packages and Docker images included, as a template version, and start new sandboxes from it on any server. How it works](https://pethost.dev/sandboxes/templates/)
- [One running sandbox at step 41 of a task is forked into three copies in 0.25 s; each carries on from step 41 on its own. Fork, memory and all Copy a running sandbox, its memory, processes and disk, into new sandboxes in one call. Three copies take about a quarter of a second. How it works](https://pethost.dev/sandboxes/fork/)

## Give your agent a computer in 0.15 s

[Start the free trial](https://console.pethost.dev/welcome?kind=sandboxes)

Pethost · Stephan Gomer · NIP 1133096755

Pethost

- [Templates](https://pethost.dev/templates/)
- [About](https://pethost.dev/about/)
- [Docs](https://pethost.dev/docs/)
- [Blog](https://pethost.dev/blog/)
- [API](https://pethost.dev/docs/api/)
- [CLI](https://pethost.dev/docs/cli/)
- [Plugin](https://github.com/pethost-dev/plugin)
- [Terms](https://pethost.dev/terms/)
- [Privacy](https://pethost.dev/privacy/)
- [Refunds](https://pethost.dev/refunds/)
- [support@pethost.dev](mailto:support@pethost.dev)

Databases

- [Postgres](https://pethost.dev/postgres/)
- [Valkey](https://pethost.dev/valkey/)

Agent Sandboxes

- [Sandboxes](https://pethost.dev/sandboxes/)
- [Pricing](https://pethost.dev/sandboxes/#pricing)
- [Docs](https://pethost.dev/docs/sandboxes/)
- [API](https://pethost.dev/docs/sandboxes/api/)

Comparisons

- [Coolify vs Dokploy vs CapRover vs Dokku](https://pethost.dev/blog/coolify-vs-dokploy-vs-caprover-vs-dokku/)
- [Coolify Cloud vs Dokploy Cloud](https://pethost.dev/blog/coolify-cloud-vs-dokploy-cloud/)
- [Railway vs Render vs Fly.io pricing](https://pethost.dev/blog/railway-vs-render-vs-fly-io-pricing/)
- [Managed Docker Compose hosting](https://pethost.dev/blog/managed-docker-compose-hosting/)

Alternatives

- [Railway alternatives](https://pethost.dev/blog/railway-alternatives/)
- [Heroku alternatives](https://pethost.dev/blog/heroku-alternatives/)
- [Dokploy alternatives](https://pethost.dev/blog/dokploy-alternatives/)
- [Coolify alternatives](https://pethost.dev/blog/coolify-alternatives/)
- [Render alternatives](https://pethost.dev/blog/render-alternatives/)
- [Sliplane alternatives](https://pethost.dev/blog/sliplane-alternatives/)
