Skip to content
New Project

ServerlessWP

Host your WordPress site on serverless — more affordable and more performant when optimized with edge caching.

DeployView Demo
No thumbnail was provided for the template. This is a screenshot of the landing page, serverlesswp.com.

ServerlessWP

WordPress hosting is silly.

Why should a small WordPress site need a server running around the clock?

ServerlessWP [github.com/mitchmac/serverlesswp] enables low maintenance and low cost/free WordPress hosting on Vercel, Netlify, or AWS Lambda.

WordPress runs on demand in serverless functions, with a SQLite database stored in S3 or Vercel Blob. No always-on server or separate database hosting to manage.

Just want to try? Deploy on Vercel with a private Vercel Blob store for your SQLite database and media uploads. No separate database hosting or credentials to copy.

Leave the two pre-filled deploy settings as they are to enable media uploads. Once deployed, open your site’s URL and complete the WordPress setup.

Use cases

Use the familiar WordPress admin to write posts, edit pages, and upload media.

This is an experimental project, best suited to blogs, portfolios, documentation, marketing and small business sites, and dev or staging sites.

SQLite keeps setup simple for sites with light database activity, but some plugins are incompatible and competing database writes can fail. For multiple active editors, frequent form submissions, ecommerce, membership sites, or forums, use MySQL/MariaDB.

Why serverless WordPress?

  • Less to maintain: no server to manage; WordPress updates arrive as pull requests you can review and merge.
  • On-demand compute: run WordPress when requests need it, without keeping your own server running around the clock.
  • No database server required: store SQLite in S3 or Vercel Blob.
  • Branch previews: try changes with a fresh SQLite database per branch, configured automatically on Vercel.

The deploy button uses Vercel for the simplest setup, with Blob storage, CDN delivery and automatic HTTPS, and DDoS protection and firewall tools in one place. Optional Web Analytics adds visitor insights once enabled with a tracking script in WordPress. Features and usage limits vary by plan; the free Hobby plan is for personal, non-commercial projects. You can also deploy on Netlify or AWS Lambda.

Other deployment options

  • Vercel with an S3 demo database: try SQLite + S3 with a temporary database that expires after a few days.
  • Netlify: bring your own SQLite + S3 or MySQL database.
  • AWS Lambda: deploy with the Serverless Framework using npm install && serverless deploy.

Customization

  • Plugins and themes: WordPress lives in wp/. Add plugins to wp/wp-content/plugins/ or themes to wp/wp-content/themes/, then commit and push to redeploy. See Keeping WordPress updated for updates through pull requests.
  • Uploads and generated files: media uploads and supported plugin-generated files persist in S3 or Vercel Blob. See the stream wrapper reference for file-storage limitations.
  • Caching: use cache headers such as s-maxage to enable CDN caching. See Vercel Edge Caching or Netlify Cache Headers.
  • Request handling: api/index.js imports the WordPress handler from serverlesswp-node. The package owns runtime behavior and request hooks. Routing is configured in vercel.json or netlify.toml.

Getting help

Start a discussion for setup help or to share your successes and ideas.

Contributing

Try ServerlessWP, report problems, and spread the word!

License

GNU General Public License v3.0

Reference

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:

Environment variablePurpose / default
SERVERLESSWP_STREAM_PROVIDERvercel-blob for Vercel Blob, or s3 for a bucket.
SERVERLESSWP_STREAM_VERCEL_ACCESSprivate or public; must match the store's access setting.
SERVERLESSWP_STREAM_VERCEL_STORE_IDOptional store ID; falls back to BLOB_STORE_ID, then SQLITE_BLOB_STORE_ID.
SERVERLESSWP_STREAM_CACHE_CONTROLServed-file cache header; default: public, max-age=3600, s-maxage=86400.
SERVERLESSWP_STREAM_CDN_BASE_URLOptional public Blob CDN URL to serve files directly.

Vercel OIDC authenticates writes without manually added credentials. Private uploads are served through the function and cached at the edge. Plugins, themes, mu-plugins, and languages stay local; .php, .log, .sqlite, and .htaccess files are never routed. See the stream wrapper README for all settings, S3 configuration, and limitations.

Keeping WordPress updated

The Update WordPress GitHub Action checks daily and opens pull requests; merging them redeploys your site. Enable it in your repository:

  1. Settings → Actions → General → Workflow permissions → Allow GitHub Actions to create and approve pull requests. Without this, the action still pushes a branch for you to open a PR manually.
  2. Actions → Update WordPress → Enable workflow, if disabled. GitHub disables scheduled workflows after 60 days without a push. Run workflow starts a check manually.
ComponentUpdate behavior
WordPress coreReplaces files verified against wordpress.org checksums; skips edited or deleted files and preserves your plugins, themes, uploads, and wp-config.php. The PR lists skipped and modified core files.
Bundled pluginsSeparate PR; updates only plugins whose entire installed release matches wordpress.org checksums. Modified, premium, custom, and other unverified plugins are skipped and listed.
SQLite Database IntegrationMirrors its GitHub default branch; review the PR diff. Updates remove files you add inside this plugin's directory, so keep custom code in a separate plugin.
ThemesReports available updates for manual installation; no automatic updates because wordpress.org provides no theme checksums. Themes bundled with WordPress are excluded from the report and covered by core updates.

Check without changing files:

npm run wp:update -- --dry-run
npm run wp:update -- --plugins --dry-run
npm run wp:update -- --themes

Keeping the framework updated

Framework code and PHP implementations ship in the serverlesswp npm dependency. Your wp/ files remain site-owned: add plugins, MU plugins and themes normally. The committed ServerlessWP MU-plugin loaders explicitly import the installed package. wp-config.php remains complete and editable in your site, with no package import. Installation and builds do not generate or replace files under wp/; wp-config.php stays entirely site-owned.

This repository is the source of truth for the handlers, MU-plugin loaders, deployment configuration and workflows. Bring changes to those files into your site through Git. The npm package contains the framework implementation, without scaffold templates or configuration migration tooling.

Update the package and lockfile, test and deploy.

GitHub
Ownermitchmac
Repositoryserverlesswp
Use Cases
CMS
Blog
Stack
Other
None
Database
PlanetScale
CMS
WordPress

Related Templates

ISR Blog with Next.js and WordPress

An Incremental Static Regeneration Blog Example Using Next.js and WordPress
ISR Blog with Next.js and WordPress thumbnail

Next.js Starter for WordPress Headless CMS

next-wp is a Next.js application for Headless WordPress. Includes functions for fetching posts, categories, tags, pages, and featured media.
Next.js Starter for WordPress Headless CMS thumbnail
DeployView Demo