Persistent Storage
RunxBuild web services run on stateless containers. By default, files written to the container filesystem are temporary and will be lost if the service restarts. Persistent storage allows your application to store files that survive restarts and deployments.
How Persistent Storage Works
When persistent storage is enabled for your service, RunxBuild mounts a storage volume inside the container at the path /data.
Any files written inside this directory will remain available even if your service restarts or redeploys.
Persistent Path: Files written to /data are stored on persistent disk and will survive container restarts.
Where to Store Files
To make sure files persist, your application should write files inside the /data directory.
/data/uploads/data/cache/data/files/data/database.db
Any path that starts with /data will be stored on persistent storage.
Recommended Structure: Organize your files inside subfolders like /data/uploads or /data/storage for easier management.
Example: Writing Files
Node.js Example:
- Create folder:
/data/uploads - Write uploaded files inside that folder
- Example path:
/data/uploads/profile-image.png
Python Example:
- Save generated files to
/data - Store application caches inside
/data/cache
What Does Not Persist
Files written outside the /data directory will be temporary and may be lost if the service restarts.
/tmp./relative-paths
Common Use Cases
- User file uploads
- Local SQLite databases
- Application caches
- Generated reports or exports
If your application needs to store files long term, enable persistent storage and use the /data directory.