Database options ServerlessWP supports MySQL or a SQLite database stored in Vercel Blob or an S3-compatible bucket. SQLite runs on demand, but some plugins are incompatible and competing database writes can fail. Use MySQL for sites with multiple active editors or frequent submissions. See how SQLite + S3…

Uncategorized2 min readUpdated

Database options

ServerlessWP supports MySQL or a SQLite database stored in Vercel Blob or an S3-compatible bucket. SQLite runs on demand, but some plugins are incompatible and competing database writes can fail. Use MySQL for sites with multiple active editors or frequent submissions. See how SQLite + S3 works.

Database selection follows this order:

  1. MySQL: all four connection variables below are set.
  2. SQLite + S3: SQLITE_S3_BUCKET is set.
  3. SQLite + Vercel Blob: BLOB_STORE_ID, SQLITE_BLOB_STORE_ID, or SQLITE_BLOB_READ_WRITE_TOKEN is set on Vercel.
  4. Otherwise, the setup page appears.

SQLite + Vercel Blob

Connect a private Blob store in your Vercel project’s Storage tab. Vercel supplies the store ID and OIDC authentication; each new git branch starts with its own fresh SQLite database. The deploy button handles this setup and shares the store with media uploads.

Environment variablePurpose / default
BLOB_STORE_IDConnected store ID; supplied by Vercel.
SQLITE_BLOB_STORE_IDOptional database-specific store ID; overrides BLOB_STORE_ID.
SQLITE_BLOB_READ_WRITE_TOKENOptional static token instead of OIDC. The database does not use BLOB_READ_WRITE_TOKEN.
SQLITE_BLOB_PATHNAMEDatabase base name; default: wp-sqlite.

For separate database and upload stores, connect the private database store with the SQLITE environment variable prefix and the upload store without a prefix.

SQLite + S3

Create a private S3-compatible bucket (including Cloudflare R2), preferably near your functions. Works on Netlify, AWS, and Vercel.

Environment variablePurpose
SQLITE_S3_BUCKETBucket name.
SQLITE_S3_API_KEYAPI access key.
SQLITE_S3_API_SECRETAPI secret key.
SQLITE_S3_REGIONBucket region.
SQLITE_S3_ENDPOINTOptional custom endpoint, e.g. for Cloudflare R2.

MySQL database option

Create a MySQL-compatible database and set the following; wp-config.php connects automatically. TiDB is one hosted option.

Environment variablePurpose
DATABASEDatabase name.
USERNAMEDatabase user.
PASSWORDDatabase password.
HOSTDatabase host.
TABLE_PREFIXOptional table prefix.

Media uploads on Vercel Blob

The stream wrapper persists uploads in object storage because local writes do not survive redeploys. The deploy button enables it; for an existing project, configure:

Previous article
Next article