SQLite for development
This page is for developers who want a DXP project running on a laptop, in a test pipeline or on a demo server without installing a database server. SQLite support is one of the things the DXP adds over the upstream line (Who is the Exponential Foundation?).
Contents
Five steps
Check the extensions.
php -m | grep -i sqlite # expect SQLite3 and pdo_sqliteSet the DSN in
.env.local, and remove theDATABASE_DRIVER,DATABASE_HOSTand other parts:DATABASE_URL="sqlite:///%kernel.project_dir%/var/data_%kernel.environment%.db" MESSENGER_TRANSPORT_DSN=sync://The messenger line matters: the default Doctrine transport needs a second database connection, which SQLite may not give it;
sync://handles messages in the same request (Messenger and notifications).Install. The command creates
var/data_dev.db(orvar/data_prod.db), imports the seed content and creates the Doctrine tables.php bin/console exponential:install exponential-ossLet the web server write the file. SQLite writes to the file on every edit:
chmod 664 var/data_dev.db chown "$USER":www-data var/data_dev.db # your web server's groupClear the cache:
php bin/console cache:clear.
Two errors you will meet
| Error | Cause | Fix |
|---|---|---|
no such table: ibexa_section | The database file was never initialized | Run the install command; if an empty file exists, remove it first and install again |
attempt to write a readonly database | The install ran as another user than the web server | Fix the owner and mode as in step 4 |
Limits
From the skeleton's guide:
| Limit | Impact |
|---|---|
| No concurrent write transactions | Writes queue up under load and can time out |
| No replication or clustering | One server only |
| No FULLTEXT index | Full-text search falls back to LIKE queries |
| File-level locking | The file must be on a local file system, not NFS or CIFS |
SQLite is right for development, automated tests, demos and air-gapped installations. Use MySQL 8.0, MariaDB 10.6 or PostgreSQL 14 or newer for any public or multi-user site.
Moving to a server database later
The skeleton's guide converts a SQLite project to MySQL with sqlite3-to-mysql or to PostgreSQL with pgloader.
Afterwards remove the SQLite DSN and the sync:// transport from .env.local
(Databases, Converting between engines).
Related pages
- SQLite for Exponential Platform
- Platform SQLite installer
- Database support in Exponential 6
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.