A service's filesystem resets on every deployment. A volume is persistent storage that keeps its data across deploys and restarts. Use one for uploads, an embedded database such as SQLite, caches you do not want to rebuild, or any file you need to keep.
Create and attach
Add a volume from the project canvas with New → Volume, or from a service's Settings → Storage with Attach volume. Give it a mount path, the directory inside the container where it appears, such as /data.
A volume belongs to the environment, not to a single service. You can detach it, attach it to another service, or swap the volume a service uses for another one. Its data stays the same through all of that.
Size
A new volume gets the size your plan allows per volume, and the plan caps the total size of your volumes. The service's storage panel shows how much of the volume is in use.
Replicas
A service with a volume can run more than one replica, but the replicas do not coordinate their writes. Keep services that write to a volume at one replica unless the software is built for shared storage.
Backups
Open a volume's backups to protect it. Every backup is a snapshot taken while the service keeps running, and it is stored away from the server the volume lives on.
- Scheduled backups. Turn on daily, weekly or monthly snapshots. Daily ones are kept for 7 days, weekly ones for 4 weeks and monthly ones for 3 months. You can also take a backup right away.
- Continuous backup. Where your plan includes it, a snapshot every 15 minutes, kept for your plan's history window. Only what changed since the last one is sent. You can then recover the volume as it was at a chosen moment.
Restoring never overwrites the volume you have. The backup goes into a new volume in the same environment; once it is ready, attach it or swap it in.
Volumes created before backups existed cannot be backed up. Create a new volume and move the data to it.
What you pay for
Volumes are billed by the space used, in GiB per month, measured over time. Backups and continuous backup history are billed as backup storage, by the space they take. See Pricing for the rates and Backups and recovery for databases.