Skip to main content
This guide will get your app up and running with LiteFS on Fly.io as fast as possible. If you run into any issues with this guide, or you’d like some more details or a slower pace, check out the Getting Started doc instead. You can also take a look at the docs for your framework to see if LiteFS is supported by fly launch.
This guide assumes you already have a working Dockerfile for your app. If not, get that working (with regular sqlite), and then come back here!

Let’s do this!

1. Configure litefs.yml

Copy the sample litefs.yml file from the litefs-example repo, and make the following updates:
  • Update from 8081 in proxy.target to whatever port your app listens on
  • Update exec[0].cmd to the command that runs your app

2. Update your Dockerfile

Install LiteFS dependencies:
Copy in the LiteFS binary:
Update the ENTRYPOINT (or CMD):

  1. Set up & deploy to the Fly Platform

Create a volume:
Create your app config, but don’t deploy it (say no when it asks):
Configure consul (this sets the FLY_CONSUL_URL secret for your app, which is required for LitefS leases):
Update your fly.toml file to mount your volume:
Deploy your app:
TADA! You (hopefully) now have an app running with LiteFS! If you’re having trouble, you can ask for help in the Fly community.

4. Add some replicas in other regions

LiteFS isn’t super useful if you’re running only one node. So, add some more nodes in more regions!

Next steps

Back up your LiteFS cluster.