Skip to content

Troubleshooting

App storage full or files disappearing after deploy

Got 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.

Updated 3 min read

Storage problems on DployHub come in two flavours: the persistent disk is filling up, or files you wrote vanish after a deploy or restart. Both come down to one rule: only files under /data persist. This guide covers both symptoms and how to fix them.

How storage works

Each live environment gets persistent storage of the size you chose (1 to 500 GB), mounted at /data inside the container. Staging gets 1 GB. Everything outside /data, including your app folder and /tmp, is part of the container and is thrown away on every deploy and restart. See persistent storage for the full picture.

Symptom: "App storage almost full"

You receive the "App storage almost full" alert, the usage shown on the app is near the limit, or your app logs errors such as ENOSPC: no space left on device when writing files.

Common causes:

  • User uploads that keep growing.
  • A SQLite database that has grown, including its write-ahead log files.
  • Log files written to /data instead of stdout.
  • Old exports, backups or temporary files that are never cleaned up.

Fix: increase storage

  1. 1

    Open Settings → Resources

    Choose a larger storage size, in whole GB up to 500.

  2. 2

    Check the price

    Storage costs ₹6 per GB per month, billed by the hour. The new monthly price is shown before you save.

  3. 3

    Save

    Live restarts on the current version. Your files in /data are kept.

Fix: clean up what you store

  • Print logs to stdout and stderr instead of files. They appear in the Logs tab and are rotated for you.
  • Delete temporary exports once they have been downloaded.
  • Move large media to an object storage service and keep only references in your app.
  • For important or fast-growing data, use a managed database rather than files on disk.

Symptom: files disappear after a deploy

Uploads, a SQLite file or generated content are gone after you deploy or restart. Cause: the app wrote them somewhere other than /data. Point your app at the persistent folder:

js
// Node.js: store uploads under /data
const path = require('path');
const UPLOAD_DIR = process.env.UPLOAD_DIR || '/data/uploads';
require('fs').mkdirSync(UPLOAD_DIR, { recursive: true });
python
# Django settings.py: keep SQLite and media on /data
DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.sqlite3",
        "NAME": "/data/db.sqlite3",
    }
}
MEDIA_ROOT = "/data/media"

Keep an eye on it

Storage usage is shown on the app, and the "App storage almost full" event can be sent by email, Telegram or WhatsApp. Set it up in alerts. If usage looks wrong compared with what your app stores, raise a ticket.

Frequently asked questions

Which folder is persistent?

Only `/data`. Everything else in the container is reset on each deploy and restart.

Do I lose data when I increase storage?

No. Live restarts on the same version and the contents of `/data` are kept.

How much storage does staging get?

Staging has a fixed 1 GB, so keep large test data small there.