Run your server and keep your keys
Your server holds the bucket credentials and the encryption keys, so app machines only ever need a join token.
How your server works
-
Your bucket
Connect Amazon S3, Cloudflare R2, Google Cloud Storage, or another S3-compatible store such as DigitalOcean Spaces, Backblaze B2, or MinIO. Litebackup tests reading, writing, listing, and deleting before it enables a bucket, and for S3 the console gives you an access policy that matches it. Use a dedicated bucket or prefix for each server.
-
Encryption
Your server encrypts every object before it archives it, with keys that stay on the server. The recovery kit or recovery passphrase you save during setup is what lets a replacement server read those objects, so keep it somewhere other than the server and its bucket.
-
Retention
Choose how far back you can restore, and the console estimates the space that takes on your server's disk and in your bucket before you save. Litebackup removes what retention no longer needs by itself, so avoid bucket lifecycle rules that delete its objects.
-
Server disk and bucket
Each change reaches your server's disk within seconds and your bucket after the archive delay, 15 minutes by default, which batches many changes into fewer archives. A wait for the bucket includes that delay, so give scheduled jobs a deadline that allows for it.
-
Networking
Machines reach your server over HTTPS on TCP 443, and the server manages its own certificate. Behind a load balancer or NAT, forward TCP 443 with TLS passthrough and give the installer the public address with --address.
-
Recovering a lost server
With your bucket and the recovery kit or passphrase, litebackup server recover rebuilds a replacement server from the versions in your bucket. Stop the old server for good first, recover into an empty data directory, and create API keys again afterwards, because they are not kept in the bucket.
-
Administering from anywhere
The console covers databases, machines, buckets, retention, disk, and users. litebackup admin login signs the command line in to the same instance, and litebackup admin --help lists everything it can change.
-
Updates
Update your server from its instance page first, then each machine with litebackup install cli, run as the user that installed it. Keep the npm package and the litebackup command on the same version.
Works with the bucket you already use
Litebackup checks each bucket before it trusts it, and any store that passes its test works.
Choose how long to keep backups
The retention screen shows which versions you keep and estimates the space they need on your server and in your bucket before you save.
Recover your server, run the client as a service, or build an image
Recovery runs on the replacement server, while the service and Docker examples run on the machines with your databases.
# Recover the Litebackup server and its databases from a bucket.
# Run this on the Linux server. The installer requests sudo to install the system service.
# On the replacement server, with the old one stopped for good.
# LITEBACKUP_SECRET_ACCESS_KEY holds the bucket's secret access key.
litebackup server recover \
--data-directory /var/lib/litebackup-recovered \
--provider aws \
--region us-east-1 \
--bucket YOUR_BUCKET \
--access-key-id YOUR_ACCESS_KEY_ID \
--encryption-key-file /secure/recovery/encryption.key
# With a recovery passphrase instead of the kit's key:
# --passphrase-file /secure/recovery/passphrase
# Add --prefix if the bucket used one, and --endpoint for R2 and other S3-compatible stores.
# Install the client as a user service, check its logs, and update it.
# Runs on Linux and macOS.
# Use the account that owns the databases.
litebackup install service --api-key "${LITEBACKUP_API_KEY}"
litebackup status
if [[ "$(uname -s)" == Darwin ]]; then
tail -f "${HOME}/.local/state/litebackup/default/daemon.log"
else
journalctl --user --unit litebackup --follow
fi
# Run this when you update the client to match the server.
litebackup install cli
# Install the client as a system service and check whether it is running.
# Run this on the Linux server. The installer requests sudo to install the system service.
sudo litebackup install service --user app --api-key "${LITEBACKUP_API_KEY}"
sudo systemctl status litebackup
# syntax=docker/dockerfile:1.10
FROM debian:bookworm-slim
ARG TARGETARCH
ARG LITEBACKUP_VERSION
ARG LITEBACKUP_SHA256
ADD --chmod=0755 --checksum=sha256:${LITEBACKUP_SHA256} \
https://litebackup-cdn.com/litebackup/${LITEBACKUP_VERSION}/litebackup-linux-${TARGETARCH} \
/usr/local/bin/litebackup
RUN litebackup version
# Mount the whole database directory and the client's state on volumes, so the
# -wal and -shm files stay with the database and the machine keeps its identity.
ENV XDG_STATE_HOME=/state
# Pass LITEBACKUP_API_KEY at runtime; it is only needed for the first join.