# How to deploy a SQLite app

Each guide shows a platform's startup and shutdown with Litebackup, so the database moves to the next instance with every write it took.

## Choose the guide for your platform.

- **Autoscaled machines**. Run instances that come and go with an ephemeral token and litebackup run.
- **Fly.io**. Make litebackup run the entrypoint of a Machine with a volume.
- **DigitalOcean**. Run the app as a systemd user unit on Droplets with Spaces as the bucket.
- **Rails**. Acquire and drain from the Railtie inside Puma.

Each guide starts from zero. You install your Litebackup server, join the machine that runs your app, start backing up its database, and then set up the platform's own startup and shutdown, so a new instance acquires the database and the old one hands it back before it stops.

| Guide | What it covers |
| --- | --- |
| [SQLite on autoscaled machines](/sqlite-autoscaling) | Ephemeral join tokens, `litebackup run`, draining, and what a crash costs |
| [Run a SQLite app on Fly.io](/sqlite-app-fly-io) | `litebackup run` as the entrypoint, a volume, `kill_signal`, and `kill_timeout` |
| [Run a SQLite app on DigitalOcean](/sqlite-app-digitalocean) | Droplets with systemd user units and a Spaces bucket for the server |
| [Back up a Rails SQLite database](/rails-sqlite-backup) | The Railtie's `acquire` and `drain_on_shutdown` with Puma and Rails 8 |

Every guide ends with the same test. The app writes a row when the platform stops it, and the next instance reads that row after it acquires the database, which proves the drain finished in time.

For a single machine that keeps its disk, [how to back up SQLite](/sqlite-backup) is the place to start, and [SQLite in production](/sqlite-in-production) covers deploys and restores in general. The [command line](/cli) and the [SDKs](/sdk) document every command and option the guides use.

## Install

[Install your Litebackup server](/install) on a Linux machine you control, then join your first machine with the [command line](/cli) or an [SDK](/sdk). The [deployment guides](/sqlite-deployment-guides) cover each platform. Keep a second, independent backup of data you cannot lose, so no single system holds the only copy.
