Command: replicate

The replicate command starts a server to monitor & continuously replicate SQLite databases. You can specify your database & replicas in a configuration file or you can replicate a single database file by specifying its path and its replicas in the command line arguments.


Using a configuration file

This command format will read all options from the configuration file. This is the recommended approach for production systems.

litestream replicate [arguments]

Replicate a single file

This command format sets up replication for a single database file DB_PATH and replicates it to one or more replica URLs. This is useful for testing Litestream but is not recommended for production use.

litestream replicate [arguments] DB_PATH REPLICA_URL [REPLICA_URL...]


-config PATH
    Specifies the configuration file.
    Defaults to /etc/litestream.yml

    Disables environment variable expansion in configuration file.

-exec CMD
    Executes a subcommand. Litestream will exit when the child
    process exits. Useful for simple process management.

    Starts an HTTP server that reports prometheus metrics and provides
    an endpoint for live read replication. (e.g. ":9090")

When using the -exec flag, Litestream will pass the path of the first database in your configuration to the child process as the LITESTREAM_DB_PATH environment variable.