
WordPress hosting is silly.
Low maintenance and low cost/free WordPress hosting on Vercel, Netlify, or AWS Lambda.
ServerlessWP puts WordPress in serverless functions and the database in a file. Deploy this repository to give it a try.
Stay up-to-date at the ServerlessWP repository: github.com/mitchmac/serverlesswp
Is it a good fit?
This is currently an experimental project. It's built for content sites rather than applications:
✅ Great fit: personal blogs, documentation, portfolios, marketing and small business sites, dev and staging sites — anything mostly read, edited by one or two people.
✅ Also great: headless/decoupled WordPress. Run WordPress here purely as the editing backend and content API (REST or GraphQL) for a separate frontend.
⚠️ Use MySQL, not SQLite when: sites with several people publishing at once, take a lot of form submissions, ecommerce, membership sites, forums. SQLite+S3 and SQLite+Blob have limited write concurrency.
Quick Deploy
The easiest way to run WordPress with ServerlessWP is entirely on Vercel. This button creates a private Vercel Blob store during setup, and WordPress runs on a SQLite database kept in it. No database to host, no credentials to copy, no other accounts to sign up for — and each git branch gets its own database.
More on how SQLite + Vercel Blob works and when to use MySQL instead.
Other ways to deploy:
- Just kicking the tires? Deploy on Vercel with a temporary SQLite database on S3 that expires after a few days.
- Netlify with your own database (SQLite+S3 or MySQL). Trade-offs vs. Vercel: 10 second max request duration instead of 60, manual branch config, and analytics/firewall are paid add-ons.
- AWS Lambda with the Serverless Framework:
npm install && serverless deploy
Project goals
🌴 WordPress hosting made easy. Lower maintenance with serverless functions instead of servers.
💲 Small WordPress sites shouldn't cost much to host. Vercel, Netlify, & AWS have free tiers.
🔓 WordPress plugins and themes are extensively supported. No arbitrary limitations here.
⚡ Blazing fast websites that take advantage of caching and content delivery networks.
🌎 Lower the carbon footprint of WordPress websites.
🤝 A helpful community. Share your successes, ideas, or struggles in the discussions.
Deploy ServerlessWP
1. Deploy this repository to Vercel, Netlify, or AWS.
One of the links above will get you started. You'll just need a GitHub account.
2. Setup a database.
These docs lead with SQLite on object storage — Vercel Blob or S3 — because it's the quickest to get running and the least to maintain: nothing to provision, nothing running 24/7, and on Vercel no credentials to copy at all. MySQL is equally supported and stays the better choice for the sites called out above — see MySQL.
If you used the Vercel button above, you're already done: the Blob store it created is your database. Skip to step 3.
Otherwise, pick your database below — SQLite + object storage or MySQL — then come back for uploads.
Whichever you choose, you set it up with environment variables. See here for Vercel and here for Netlify for how to manage them. Remember to redeploy your project if you change environment variables after the initial deploy.
3. File and media uploads with S3 (optional, can be done later)
File and media uploads can be enabled using the included WP Offload Media Lite for Amazon S3 plugin. S3 setup details can be found here. The wp-config.php file is setup to use the following environment variables for use by the plugin:
- S3_KEY_ID
- S3_ACCESS_KEY
SQLite + object storage
WordPress usually runs with a MySQL (or MariaDB) database. That means hosting a database that runs 24/7.
A SQLite database option has been developed by members of the WordPress community. With the recent ability to conditionally write to object storage - Vercel Blob, or S3 and S3-compatible buckets - a decentralized and serverless data layer for ServerlessWP is possible.
Check out the diagram of the SQLite+S3 logic if you're interested in how it works.
ServerlessWP supports both SQLite and MySQL as database options. Some of the trade-offs:
| SQLite + object storage | MySQL |
|---|---|
| 🕑 on demand | 24/7 hosting |
| 💲 usage based (free tiers) | monthly fees (some limited free tiers) |
| 🧩 some plugin incompatibility | full plugin compatibility |
| ♾️ limited database update concurrency | few concurrency limitations |
| ✔️ blogs, dev sites, documentation, single editor sites | any site |
The main trade-off of using SQLite with ServerlessWP is:
- if requests are handled by multiple underlying serverless functions at the same time and make a change to the database, the competing requests may fail. Sites with multiple editors working at the same time or receiving many form submissions aren't a great fit for SQLite.
SQLite + Vercel Blob
The easiest option. On Vercel, the deploy button above creates a private Vercel Blob store for you during setup - no bucket or IAM credentials to create. The git branch is added to the name, so preview deployments each get their own database.
| SQLite+Vercel Blob | |
|---|---|
| SQLITE_BLOB_READ_WRITE_TOKEN | token for the store holding the database |
| SQLITE_BLOB_PATHNAME | optional: base name for the database - defaults to wp-sqlite |
SQLITE_BLOB_READ_WRITE_TOKEN is what Vercel injects for a store created with an env var prefix of SQLITE, which is what the deploy button asks for. To set one up on an existing project, create the store from the Storage tab with private access, then copy its BLOB_READ_WRITE_TOKEN into a SQLITE_BLOB_READ_WRITE_TOKEN environment variable.
The database store is deliberately separate from any store you use for media uploads: the database has to stay private and uncached, while uploads want public reads and CDN caching. That's why the unprefixed BLOB_READ_WRITE_TOKEN isn't used here - a store connected for uploads would otherwise be picked up as the database and fail on the first write.
SQLite + S3
Works anywhere - Netlify, AWS, or Vercel - with any S3-compatible bucket, including Cloudflare R2. Setup a private bucket and use these environment variables:
| SQLite+S3 | |
|---|---|
| SQLITE_S3_BUCKET | bucket name you created |
| SQLITE_S3_API_KEY | API key to access the bucket |
| SQLITE_S3_API_SECRET | API secret key to access the bucket |
| SQLITE_S3_REGION | region where the bucket lives - create it near your serverless functions |
| SQLITE_S3_ENDPOINT | optional: to update where the bucket is, like a Cloudflare R2 address |
MySQL database option
The right call when you need full plugin compatibility or more than a couple of people writing at once. TiDB provides a cloud MySQL database with a generous free tier.
After creating your database, set these environment variables with the credentials. wp-config.php is automatically configured to use them to connect.
| DATABASE | database name you created |
| USERNAME | database user to access the database |
| PASSWORD | database user's password |
| HOST | address to access the database |
| TABLE_PREFIX | optional: to use a prefix on the database tables |
Which database gets used
The most explicitly configured option wins, so adding a Blob store for media won't take over an existing database:
- MySQL -
DATABASE,USERNAME,PASSWORD, andHOSTall set - SQLite + S3 -
SQLITE_S3_BUCKETset - SQLite + Vercel Blob -
SQLITE_BLOB_READ_WRITE_TOKENset on Vercel - otherwise the setup page is shown
Customizing WordPress
- WordPress and its files are in the
/wpdirectory. You can add plugins or themes there in their respective directories inwp-contentthen commit the files to your repository so it will re-deploy. - Plugins like Cache-Control can enable CDN caching with the s-maxage directive and make your site super fast. Refer to Vercel Edge Caching or Netlfiy Cache Headers
Customizing ServerlessWP
netlify.tomlorvercel.jsonare where we configure/api/index.jsto handle all requests- mitchmac/serverlesswp-node is used to run PHP and handle the request
- You can modify the incoming request through the
eventobject in api/index.js. You can also modify the WordPressresponseobject there. ServerlessWP has a basic plugin system to do this. Checkout out/api/index.jsfor hints.
Getting help
Need help getting ServerlessWP installed? Start a discussion or send me a chat.
Contributing
- Using ServerlessWP and reporting any problems you experience is a great way to help.
- Spread the word!
License
GNU General Public License v3.0

