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

# Volumes

> Demo: volumes

Source: `demo/volumes/app.py` in the repository.

Persistent, shared storage. A volume is mounted into every container that lists it; functions write
and read plain files, and you move files in and out with the CLI.

```bash theme={null}
cd demo/volumes

# 1. run: two functions write reports, a third lists them from another container
python app.py

# 2. upload a file from your laptop, then read it from a function
echo "hello from my laptop" > sample.txt
levers9 cp ./sample.txt demo-data/inputs/sample.txt
python app.py                      # read: {"exists": true, ...}

# 3. browse and manage
levers9 volume list
levers9 ls demo-data
levers9 ls demo-data/reports
levers9 cp demo-data/reports/daily.json ./daily.json      # download
levers9 mv demo-data/reports/daily.json demo-data/archive/daily.json
levers9 rm demo-data/archive/daily.json
levers9 volume delete demo-data    # when you are done (asks for confirmation)
```

Notes

* `Volume(name="demo-data", mount_path="./data")` creates the volume on first use. The mount path is
  relative to the container's working directory, or absolute, like `/data`. It has to name a folder: it
  can't be empty, `.`, `./` or `/`, and it can't contain `..`. A function that asks for one of those is
  turned down when it's deployed or run, with a message that says which mount path is wrong.
* A volume is always one of your own workspace's. A `CloudBucket`'s name has to be a bucket name, with
  no `/` in it.
* Several functions, or several running containers, can mount the same volume at once.
* The dashboard shows volumes under **Storage**, with a file browser and upload.


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