Litestream
Learn how to configure Litestream for use with Filebase.

What is Litestream?

Litestream is a replication tool for SQLite databases on Mac OS X and Linux Debian operating systems. Litestream runs separate background processes for creating continuous replicas of SQLite databases that are copied to external disks or cloud locations such as Filebase.
Read below to learn how to use Litestream with Filebase.

Prerequisites:

  • Download and install Litestream.
  • Have Your Filebase Access and Secret Keys. Learn how to view your access keys here.
  • Create a Filebase Bucket. Learn how to create a bucket here.

1. Create a sample database called test.db with the following command:

sqlite3 test.db

2. Next, locate the litestream.yml file.

On Linux Debian systems, this is located at /etc/litestream.yml

3. Open the litestream.yml file in your preferred text editor.

Replace the existing content in the file with the following:
1
access-key-id: FILEBASE_ACCESS_KEY
2
secret-access-key: FILEBASE_SECRET_KEY
3
4
dbs:
5
- path: /path/to/database/test.db
6
replicas:
7
- type: s3
8
bucket: filebase-bucket
9
path: /path/inside/bucket/
10
endpoint: s3.filebase.com
11
force-path-style: true
Copied!
Replace the following values:
  • access-key-id: Your Filebase Access Key
  • secret-access-key: Your Filebase Secret Key
  • path: Replace the first path variable with the path to your SQLite Database file. This file will have the file extension .db.
  • bucket: Your Filebase Bucket Name
  • path: Replace the second path variable with the path inside your Filebase bucket where you’d like to store the SQLite database snapshot files.

4. Start the Litestream service:

systemctl start litestream

5. View the contents of your Filebase bucket to confirm the snapshot was uploaded:

If you have any questions, please join our Discord server, or send us an email at [email protected]
Last modified 1mo ago