Volumes
On Zeabur, you can mount Volumes to persistently store your data within a service. Typically, services on Zeabur reset data to default values upon restarting (this is known as stateless), but if you need to persist data (making a service stateful), you can mount the directory that needs persistent storage onto Volumes. This way, even if the service restarts, the data will not be lost.
For pricing information on Volumes, please refer to our pricing page.
If you only want to upload configuration files, using the Config Editor is more convenient and incurs no additional cost.
Mounting Volumes
Open the service page where you want to mount Volumes, click on the “Volumes” tab, and you will see a “Mount Volumes” button. After clicking it, you will see two fields:
- Volume ID is a unique identifier for this Volume. You can use a simple name (such as
data
,cache
,photos
) to easily represent this Volume. This identifier is unrelated to the actual mounting result. - Mount Directory is the directory where the Volume will be mounted, essentially the “folder that needs persistent storage.” If you want to persistently store the
/data
directory in the service, enter/data
here.
Note that after mounting, the data in this directory will be completely cleared. If you already have important data inside, please download it before mounting and restarting the service to avoid loss, and then re-import the data after mounting.
Unmounting Volumes
If you want to stop billing for a particular Volume, click the “Delete” button next to the Volume. Deleting it will stop the billing for this space. Note that after deletion, the data in this directory will be completely cleared and cannot be recovered.
Using Volumes in Template YAML
You can use volumes
in the “Service Specification” to mount Volumes. For more information, please refer to the article, Creating Templates from YAML.