BlogDatabase

My SQLite database resets after every deploy.

SQLite stores your data in a file on the app's disk. That disk is replaced on every deploy, so the data is gone. Use Postgres.

How the Agent API works
  • What happenedThe file was on a temporary disk
  • The fixUse Postgres
  • It survives deploysThe database belongs to the app
  • Flagged before buildAntideploy warns about SQLite

The short answer

SQLite keeps its whole database in a file next to your app. On Antideploy, the disk that file lands on is temporary: it is wiped whenever the app restarts, redeploys or scales to zero. Nothing errors, and the data is simply gone. Move to Postgres. Antideploy creates one beside your app, and it survives every deploy.

How to tell

  • A .db or .sqlite file, or better-sqlite3 or sqlite3 in your code. Antideploy flags SQLite before it builds, because the app deploys fine, reports healthy and loses data.
  • Your data is back to the starting state after a deploy. Users, rows or settings reset.

How to fix it

  1. Ask your agent to switch to Postgres

    Say: "Replace SQLite with Postgres." Your agent creates the database, sets DATABASE_URL and changes the code. Antideploy can create the database for you, but the code has to be changed to use it.

  2. Move any existing data

    Export the rows you want to keep from the SQLite file, and import them into Postgres.

  3. Deploy

    The database belongs to the application and every deploy reuses it. Only the container's disk is replaced.

See how to add a Postgres database to your app.

01Before you commit

Here's where it stops.

A platform that only tells you what it is good at is one you find the edges of in production. These are the ones to know before your first deploy.

  1. The disk forgets

    Anything written to local disk is gone on the next deploy. Apps that speak S3 get a bucket instead.

  2. Postgres only

    Antideploy creates Postgres databases. Redis, MySQL and MongoDB are not provided today, so an app that needs one brings its own.

02Questions

SQLite questions, answered.

Anything else? Write to us and a person answers.

support@antideploy.com
Can I keep SQLite and save the file somewhere safe?

Not on Antideploy's disk. A file in a bucket is not a database that a running app can use directly, so Postgres is the better choice.

Is SQLite fine for a demo?

It deploys, and it works until the next restart or deploy. For anything you want to keep, use Postgres.

Does it cost extra to use Postgres?

No. The databases in your plan are included: 1 on Free and Go, 3 on Pro and 5 on Scale.

Deploy something. Start with one sentence.

Paste one sentence into your coding agent, click Approve once, and get a live link. No card, no trial clock.

Start from GitHub or a folder
Prompt copied Paste it into Claude Code, Codex or Cursor and press Enter.