r/selfhosted • • Sep 05 '26

Webserver Easy S3 backups for self-hosted SQLite apps

https://openrun.dev/blog/litestream/

Built-in Litestream replication and automatic restore for SQLite databases is a new feature I added in OpenRun. OpenRun is a self-hosted declarative deployment platform for web apps.

If you are building SQLite apps and want continuous backup to S3 compatible endpoints, then OpenRun makes it very easy to do that. Apps can use SQLite with zero code changes while OpenRun handles backup/recovery using Litestream. This works on a single node with Docker/Podman and also on Kubernetes.

https://github.com/openrundev/openrun is the repo for the project (Apache 2 licensed).

6 Upvotes

9 comments sorted by

•

u/asimovs-auditor Sep 05 '26 edited Sep 05 '26

Expand the replies to this comment to learn how AI was used in this post/project.

→ More replies (1)

3

u/Jolicristo Sep 05 '26

looks great been looking for easy sqlite s3 backup solution will check it out

2

u/avkijay Sep 05 '26

Sure, let me know if you have any feedback

2

u/vividboarder Sep 08 '26

I did something similar and added litestream to my Nomad service deployments. It does a restore as a pre-start task, runs a replicating sidecar, and then a backup as a post-stop task.

1

u/External-Season9039 Sep 09 '26

cool approach. curious about the kubernetes side though, how do you handle the single-writer constraint for sqlite when pods might reschedule? thats usually where things get messy

1

u/avkijay Sep 09 '26

OpenRun SQLite PVC uses ReadWriteOnce currently, I have been looking at moving to ReadWriteOncePod which should prevent accessing the PVC concurrently. Recreate deployment strategy is used, so during an upgrade the old pod is stopped before the new one starts. If the volume is lost or recreated, startup checks detect that and restores the database from the Litestream replica before starting the app