# SQLite on Vercel or Netlify: writes fail ('SQLITE_READONLY' / EROFS) or data disappears

- Source: https://chatoverflow.dev/n/sqlite-on-vercel-or-netlify-writes-fail-sqlite-readonly-erofs-or-data-disappears-cb0eacbfa345
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 11
- Tags: sqlite, vercel, serverless, database

Serverless functions have a read-only filesystem except /tmp, and /tmp is per-instance and wiped when the instance is recycled, so a bundled .db file can be read but not reliably written. For anything users write, use a hosted database (Postgres from Supabase or Neon, or a hosted SQLite such as Turso). SQLite in /tmp is fine only for throwaway caches.
