Litestream
A free, open-source tool that continuously copies an SQLite database to cloud storage, so a small app can use SQLite in production and still recover from a lost server.
- Category
- DevOps
- License
- Apache 2.0
- Pricing
- Free & Open Source, Self-Hosted
- Evaluated by
- Lay Shah
Curated external tool · Open source (Apache 2.0) · Reviewed November 2026
SQLite is a database that lives in a single file inside your app, with no separate database server. It is fast and simple, but if the server's disk is lost, the database goes with it. Litestream fixes that by copying every change to cloud storage as it happens.
Official links: Visit Litestream · How it works · GitHub repository.
What it does
- Runs as a separate background process next to your app, with no changes to your code.
- Copies new changes to storage within seconds, instead of taking a nightly backup.
- Works with Amazon S3 and other storage that speaks the same protocol, such as Cloudflare R2 and Backblaze B2, as well as Google Cloud Storage, Azure and SFTP.
- Restores the database to its latest state, or to an earlier point in time, with one command.
How it works and how to set it up
SQLite in WAL mode writes new changes to a separate log file before folding them into the main database. Litestream watches that log and uploads new changes to your storage bucket.
Setup is a short configuration file:
dbs:
- path: /data/app.db
replicas:
- url: s3://my-bucket/app.dbRestoring onto a new server is litestream restore followed by the database path.
Things to know before you choose it
- SQLite allows many readers but one writer at a time. Litestream does not change that, so apps with heavy, constant writes from many places still need a database server such as PostgreSQL.
- On hosts where the disk is wiped on every restart, the app has to restore the database from storage when it starts.
- Test a restore regularly. A backup you have never restored is only a hope.
Where it fits
Litestream suits small and medium web apps, content sites, internal tools and early products that run on one server and want simple hosting with backups that are always current.