---
topic: data
---

[← Guide home](https://embarko.ai/docs)

# Saving data

**On this page:** Steps, Limits

> Plain words unless the person is a developer. Never invent a link, name or code. [Rules](https://embarko.ai/docs/prerequisites)

Each server app gets a folder at the DATA_DIR environment variable. It survives redeploys and restarts. Everything else on disk is wiped on every redeploy.

**Done when:** Something you saved is still there after a redeploy.

**Steps**

1. Write anything that must last under DATA_DIR, creating folders on startup. Node: path.join(process.env.DATA_DIR, "app.db"). Python: os.path.join(os.environ["DATA_DIR"], "app.db").
2. For a database use SQLite with its file under DATA_DIR (including the -wal and -shm files).

**Limits**

- Data is not backed up. Tell the person.
- No managed database. window.storage (Claude Artifacts) is rejected at deploy time: use SQLite.
- Static sites have no DATA_DIR. PORT, APP_NAME, APP_VERSION and DATA_DIR are set by Embarko and cannot be overridden.

**Next:** Point the app's storage at DATA_DIR before deploying.

**Related:** [deploy](https://embarko.ai/docs/deploy)

---

[Guide home](https://embarko.ai/docs) · JSON: add .json