---
title: "Laravel Multi-SQLite: LiteFS"
layout: framework_docs
objective: Go LiteFS-global with your SQLite-backed Laravel Fly App!
status: beta
order: 2
---
This is a technology preview. ["LiteFS"](/docs/litefs/) is a `distributed file system` that enables you to sync SQLite data across instances of your application.
Read further on the official [LiteFS documentation](/docs/litefs/getting-started/) and follow along a LiteFS-configured [sample Laravel repository here](https://github.com/fly-apps/fly-laravel-litefs).
## Laravel Specific Configuration
Take note of the following important steps in configuring your [Laravel Fly App](/docs/laravel/) with `LiteFS`:
1) You'll have to configure SQLite connection in your [`fly.toml`](https://github.com/fly-apps/fly-laravel-litefs/blob/main/fly.toml) file:
```toml
[env]
...
DB_CONNECTION="sqlite"
DB_DATABASE="/var/www/html/storage/database/database.sqlite"
```
2) Since we're saving the SQLite database in the storage directory, make sure to mount a volume on it by following this [guide here](/docs/laravel/the-basics/laravel-volume-storage/).
3) Execute `litefs mount` instead of starting the server in [`.fly/entrypoint.sh`](https://github.com/fly-apps/fly-laravel-litefs/blob/main/.fly/entrypoint.sh):
```
exec litefs mount
```
4) Make sure to properly configure the configuration file( [etc/litefs.yml](https://github.com/fly-apps/fly-laravel-litefs/blob/main/etc/litefs.yml) ) [read](/docs/litefs/config/) by LiteFS:
```yml
fuse:
# Point to the directory containing your DB_DATABASE in fly.toml
dir: "/var/www/html/storage/database"
# Allow none-root access to the directory above--required for web access
allow-other:true
# Start the server, this was previously run in .fly/entrypoint.sh
exec: "supervisord -c /etc/supervisor/supervisord.conf"
```
5) Include a ( [etc/fuse.conf](https://github.com/fly-apps/fly-laravel-litefs/blob/main/etc/fuse.conf) ) file to enable `allow-other` option above to work.
6) Revise the generated [Dockerfile](https://github.com/fly-apps/fly-laravel-litefs#dockerfile) to include the `LiteFS` image, install required packages, and copy the configuration files `etc/litefs.yml` and `etc/fuse.conf` to a [proper location](/docs/litefs/config/#config-file-search-path) `LiteFS` can read.
7) Create a [middleware](https://github.com/fly-apps/fly-laravel-litefs/blob/main/app/Http/Middleware/FlyReplayLiteFSWrite.php) to forward write requests to the [primary node](/docs/litefs/primary/) using [fly-replay](/docs/reference/fly-replay/#fly-replay)
8) Use a non-file session driver to [allow fly-replay to work](https://github.com/fly-apps/fly-laravel-litefs#fly-replay-and-csrf-tokens) on Laravel CSRF protection.
Laravel Multi-SQLite: LiteFS
This is a technology preview. “LiteFS” is a distributed file system that enables you to sync SQLite data across instances of your application.
2) Since we’re saving the SQLite database in the storage directory, make sure to mount a volume on it by following this guide here.
3) Execute litefs mount instead of starting the server in .fly/entrypoint.sh:
exec litefs mount
4) Make sure to properly configure the configuration file( etc/litefs.yml ) read by LiteFS:
fuse:# Point to the directory containing your DB_DATABASE in fly.tomldir:"/var/www/html/storage/database"# Allow none-root access to the directory above--required for web accessallow-other:true# Start the server, this was previously run in .fly/entrypoint.shexec:"supervisord-c/etc/supervisor/supervisord.conf"
5) Include a ( etc/fuse.conf ) file to enable allow-other option above to work.
6) Revise the generated Dockerfile to include the LiteFS image, install required packages, and copy the configuration files etc/litefs.yml and etc/fuse.conf to a proper locationLiteFS can read.