From Installing WordPress on SQLite — Fractolog, June 24, 2024.
The local installation section has been omitted; technical details were re-verified in November 2026 against plugin version 3.1.3, and the differences are listed at the bottom.
Why Put WordPress on SQLite
WordPress was built with MySQL, and for most websites that works just fine. However, there is an entire category of use cases where dragging around a database server is an overhead with zero upside: the personal blog getting fifty visits a day, the local club’s website, the staging environment you spin up once a month, the client demo, or the portfolio you wish you could back up with a simple cp.
SQLite solves exactly this. It is a database that lives in a single file: no daemon to start, no username and password to configure, no port 3306 to expose, and no separate dumps and restores detached from the rest of your files. Your website becomes a folder. You move it, zip it, commit it to a repository, and the data travels right alongside the code.
The limitations are equally clear: SQLite supports concurrent reads, but only one writer at a time. On a low-traffic blog you won’t notice it; on an e-commerce store processing hundreds of orders per minute, you will. The plugin is officially maintained by WordPress.org as a feature plugin, with the stated goal of eventually bringing SQLite support into WordPress core. It is used in production by small sites, though the documentation itself recommends reliable backups and load-testing your workload before making the switch.
One thing to clarify right away, as it is the most common source of confusion: the plugin does not migrate an existing site. Activating it creates a separate, empty SQLite database, and WordPress prompts you to run the installation again. Deactivating it brings you back to your previous MySQL database—untouched—while any content created on SQLite in the meantime stays there.
The Documentation Problem
WordPress has a plugin that lets it run on SQLite instead of MySQL. The issue is that setting it up isn’t entirely intuitive: the documented workflow instructs you to install WordPress on MySQL, install and activate the plugin, and then switch to SQLite—which resets the site back to its initial state anyway.
If the whole point of using the plugin was to avoid the MySQL dependency in the first place, the official instructions aren’t much help. In reality, getting it working from scratch without MySQL is easy—it’s just poorly documented.
The Procedure
Start with a freshly extracted WordPress ZIP archive. Download the sqlite-database-integration plugin and unpack it inside wp-content/plugins.
Next, there are two less obvious steps:
- Copy
wp-content/plugins/sqlite-database-integration/db.copytowp-content/db.php. That file contains a few placeholders that the standard installation routine replaces with strings, but it isn’t actually required: a straight copy works fine as-is. - Copy
wp-config-sample.phptowp-config.phpand regenerate the salts. You can use the API URL linked in the file’s comments, or runwp config shuffle-saltsvia WP-CLI.
Now visit your site: you should be greeted by the WordPress setup screen, skipping the database configuration step altogether. The database file is created inside wp-content/database/ (see the update section below: starting with version 3.1, the exact path is no longer fixed).
Bonus: Converting from MySQL to SQLite
It comes up in several places, so to keep everything together: the plugin that enables SQLite support is not meant for migrating data. There doesn’t seem to be an official tool for this, though there is one path almost everyone has used without much trouble: mysql2sqlite. Its README covers all the instructions you need.
Verification: What Still Holds Up in November 2026
The method still works, though the plugin has been rewritten in the meantime. Here is what I checked in the source code of version 3.1.3 (released November 3, 2026) and what has changed since the original article.
What still holds up
- The
db.copyfile still exists in the plugin’s root directory: copying it towp-content/db.phpremains the way to bootstrap without MySQL. - In fact, it is now more robust: the file includes an explicit comment (“Tweak to allow copy-pasting the file without having to run string-replacements”) and, if the plugin path hasn’t been replaced, falls back to
__DIR__ . '/plugins/sqlite-database-integration'. Copying the file verbatim now works by design, not by accident. wp config shuffle-saltsis still the fastest way to generate salts.- Migrating from MySQL remains unofficial, and
mysql2sqliteis still the only practical option (last commit in 2023, 59 open issues: it works, just don’t expect active maintenance).
What needs updating
- The plugin is now on version 3.x, no longer 2.x. The engine was rewritten from scratch with a pure-PHP MySQL lexer and parser: it supports complex joins, subqueries, CTEs, an emulated
INFORMATION_SCHEMA, andSHOW/DESCRIBEclauses. This exists to keep third-party plugins working properly, and it’s the reason the plugin is far more reliable today than it was two years ago. - Stricter requirements: WordPress 6.4+, PHP 7.2+, the
pdo_sqliteextension, and SQLite 3.37.0 or higher. If you’re running an older distro, check this first. DB_NAMEmust be defined and non-empty inwp-config.php. You don’t need an actual MySQL database, but the constant cannot be left undefined.wp-config-sample.phpalready works out of the box.- The database path is no longer
wp-content/database/.ht.sqlite. Since version 3.1, the path is randomized—for example:wp-content/database/.ht.020a33c5d9e5407e8e93b43e55abf62e/.ht.sqlite. The actual path is written towp-content/database/db-path.phpand exposed at runtime via theDB_PATHconstant. If any custom or backup script of yours relied on the old filename, it won’t find it anymore. - The default journal mode is WAL, meaning
-waland-shmfiles appear alongside the main database file. Any hot backup must include them, otherwise the copied database may end up inconsistent. The safest approach is stopping PHP before copying, or runningsqlite3 file.sqlite ".backup out.sqlite". - Setting an explicit
DB_PATHinwp-config.phpis recommended, pointing to a file outside the document root:PHPdefine( 'DB_PATH', '/srv/wordpress-data/sito.sqlite' );An explicit path is not randomized, and its parent directory must be writable by PHP. Note: changingDB_PATHpoints WordPress to a different database—it does not move the existing one.
About the official workflow: The documented path today is to install the plugin from wp-admin, then go to Settings → SQLite integration → Install SQLite database. That screen runs checks for the PDO extension, write permissions, and conflicting drop-ins. Still, getting there requires an already working WordPress instance, so the drop-in copy trick remains the legitimate shortcut if you want to skip MySQL right from the start.