Resources & billing
Persistent storage: keep files safe under /data
Each live app gets persistent storage mounted at /data. Learn what survives deploys, how to store uploads and SQLite files, and how to add more space.
Updated 2 min read
Your app runs in a container that is replaced on every deploy and restart. Anything written inside the container is lost when that happens, except for one place: /data. Each live app gets persistent storage of the size you chose, mounted at /data, and it survives deploys, restarts, go-lives and rollbacks.
What to store under /data
- User uploads such as images and documents.
- SQLite database files.
- Caches or generated files you want to keep between deploys.
Anything written elsewhere, for example ./uploads inside your app folder or /tmp, disappears on the next deploy or restart.
Examples
// Node.js with multer
const multer = require('multer');
const upload = multer({ dest: '/data/uploads' });
// SQLite with better-sqlite3
const Database = require('better-sqlite3');
const db = new Database('/data/app.db');# Django settings.py
MEDIA_ROOT = "/data/media"
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "/data/db.sqlite3",
}
}A handy pattern is to read the path from an environment variable, such as DATA_DIR=/data, so the same code works on your laptop with a local folder. See Environment variables.
Size and price
Live storage can be any whole number from 1 to 500 GB, at ₹6 per GB per month. For example, 10 GB costs ₹60 per month and 50 GB costs ₹300 per month, before GST. Staging gets its own 1 GB for free, separate from live, so testing never touches live data.
When storage fills up
Storage usage is shown on the app. When it is almost full you get an "App storage almost full" alert, so you have time to act before writes start failing.
- 1
Open Settings, then Resources
Open the app and go to Settings, then Resources.
- 2
Increase storage
Pick a larger size. The new monthly price is shown.
- 3
Save
Live restarts quickly with the current version and the extra space. Your existing files stay in place.
You can also free space by deleting old files your app no longer needs. See Storage full for more.
Backups and databases
Back up important data yourself, for example with a scheduled job in your app that copies /data files to object storage. For critical data, use a managed database and connect to it with a DATABASE_URL environment variable instead of keeping everything in a local file.
Frequently asked questions
Does /data survive a deploy?
Yes. Files under /data survive deploys, restarts, go-lives and rollbacks. Files anywhere else do not.
Do staging and live share storage?
No. Staging has its own free 1 GB, separate from live storage.
Are my files backed up?
Back up important data yourself, and use a managed database for critical data.
Related articles
- App storage full or files disappearing after deployGot an "App storage almost full" alert or lost uploads after a deploy? Learn how /data persistent storage works on DployHub and how to increase it safely.
- Choose vCPU, memory and storage for your appPick vCPU, memory and storage for your live environment, see the monthly price before you commit, and change resources later with a quick restart.
- How billing works: hourly pricing with GST examplesDployHub bills live apps by the hour from simple monthly rates, adds 18% GST, and sends one invoice a month. Worked examples show exactly what you pay.
- Set environment variables for staging and liveAdd API keys, database URLs and other settings as environment variables on DployHub, separately for staging and live, and apply them with a redeploy.