Skip to content

Database

Kiosk Admin uses Prisma as its ORM and supports three database backends. SQLite requires no external service and is the default for development and small deployments.

SQLite (default)

No setup required. A dev.db file is created automatically in kiosk-admin/ when you first run migrations.

DATABASE_PROVIDER=sqlite
DATABASE_URL=file:./dev.db
Terminal window
npx prisma migrate dev

PostgreSQL

DATABASE_PROVIDER=postgresql
DATABASE_URL=postgresql://user:password@localhost:5432/kiosk_admin
Terminal window
npx prisma migrate dev

MongoDB

DATABASE_PROVIDER=mongodb
DATABASE_URL=mongodb://localhost:27017/kiosk_admin
Terminal window
npx prisma db push # MongoDB uses db push, not migrate

Switching backends

To switch from SQLite to PostgreSQL on an existing installation:

  1. Export any important data first (there is no built-in migration tool between backends).
  2. Update DATABASE_PROVIDER and DATABASE_URL in .env.
  3. Run npx prisma migrate dev to create the schema in the new database.
  4. Re-add devices and re-create users.