---
title: Using LiteFS Cloud for Backups
layout: docs
nav: litefs
toc: true
---
<%= partial "/docs/partials/docs/litefs_sunset" %>
The simplest way to implement disaster recovery for your LiteFS cluster is
to use Fly.io's LiteFS Cloud for backups. LiteFS Cloud provides reliable backup
and restore functionality, which reduces the risk of data loss in the event
that your cluster is lost. You'll also be able to restore your cluster to any
point in time (not just the most recent snapshot), in case you need to revert
your state.
In this doc, we'll show you how to add LiteFS Cloud to an existing LiteFS
cluster. If you're not using LiteFS yet, take a look at the
[getting started guide](/docs/litefs/getting-started-fly), which walks you
through setting LiteFS up for your app, including LiteFS Cloud.
If you'd rather implement your own backups, take a look at the
[Backing up your LiteFS cluster](/docs/litefs/backup) docs.
## Creating a LiteFS Cloud cluster
If you want to back up your database using LiteFS Cloud, you'll need to create
a LiteFS Cloud cluster. You can do this in the Fly.io dashboard. First,
[sign up for an account](/docs/hands-on/sign-up-sign-in/) if you haven't already. After you're signed in,
navigate to the LiteFS Cloud section on the left navbar, and then use the Create
button to create a new cluster.
[Here's a handy link to the LiteFS Cloud dashboard](https://fly.io/dashboard/personal/litefs) if you prefer!
When you create your LiteFS Cloud cluster, you'll be asked to save an auth token.
Keep this handy - you'll use it below.
## Configuring LiteFS to use LiteFS Cloud
### Update LiteFS
Before configuring LiteFS Cloud, you must update your LiteFS to a version that supports
LiteFS Cloud. Update to `v0.5.0` or greater. You can do this by
[installing the latest version](/docs/litefs/getting-started-fly/#installing-litefs).
### LiteFS Cloud Configuration
When you created your LiteFS Cloud cluster, you got a LiteFS Cloud API authentication
token. (If you lost it, you can create a new one in
[the LiteFS Cloud dashboard](https://fly.io/dashboard/personal/litefs).)
This token should be made available to LiteFS via the `LITEFS_CLOUD_TOKEN` environment
variable. If you're running on Fly.io, you can add a secret for it with:
```cmd
fly secrets set LITEFS_CLOUD_TOKEN="litefs cloud auth token from dashboard"
```
Previous non-cloud litefs databases will automatically be synched to the litefs cloud cluster.
If you're not running on Fly.io, you need to set the `LITEFS_CLOUD_TOKEN` environment
variable, and then restart LiteFS on each node. How you do this depends on how you have configured
LiteFS. If you're running LiteFS separately from your app, then for each node, you should:
* Update your configuration with the new environment variable
* Stop your app (so that it's not reading/writing data anymore)
* Restart litefs
* Start your app again!
If you're running LiteFS via `systemd`, you can restart it with:
```cmd
systemctl restart litefs
```
Remember that this needs to be run for every LiteFS node.
Using LiteFS Cloud for Backups
The documentation in this section is deprecated and refers to a product that was retired on October 15, 2024.LiteFS itself is not affected by the retirement of the LiteFS Cloud service. Learn more about how to disconnect from LiteFS Cloud and other options for disaster recovery in our community post: Sunsetting LiteFS Cloud.
The simplest way to implement disaster recovery for your LiteFS cluster is
to use Fly.io’s LiteFS Cloud for backups. LiteFS Cloud provides reliable backup
and restore functionality, which reduces the risk of data loss in the event
that your cluster is lost. You’ll also be able to restore your cluster to any
point in time (not just the most recent snapshot), in case you need to revert
your state.
In this doc, we’ll show you how to add LiteFS Cloud to an existing LiteFS
cluster. If you’re not using LiteFS yet, take a look at the
getting started guide, which walks you
through setting LiteFS up for your app, including LiteFS Cloud.
If you want to back up your database using LiteFS Cloud, you’ll need to create
a LiteFS Cloud cluster. You can do this in the Fly.io dashboard. First,
sign up for an account if you haven’t already. After you’re signed in,
navigate to the LiteFS Cloud section on the left navbar, and then use the Create
button to create a new cluster.
Here’s a handy link to the LiteFS Cloud dashboard if you prefer!
When you create your LiteFS Cloud cluster, you’ll be asked to save an auth token.
Keep this handy - you’ll use it below.
Configuring LiteFS to use LiteFS Cloud
Update LiteFS
Before configuring LiteFS Cloud, you must update your LiteFS to a version that supports
LiteFS Cloud. Update to v0.5.0 or greater. You can do this by
installing the latest version.
LiteFS Cloud Configuration
When you created your LiteFS Cloud cluster, you got a LiteFS Cloud API authentication
token. (If you lost it, you can create a new one in
the LiteFS Cloud dashboard.)
This token should be made available to LiteFS via the LITEFS_CLOUD_TOKEN environment
variable. If you’re running on Fly.io, you can add a secret for it with:
fly secrets set LITEFS_CLOUD_TOKEN="litefs cloud auth token from dashboard"
Previous non-cloud litefs databases will automatically be synched to the litefs cloud cluster.
If you’re not running on Fly.io, you need to set the LITEFS_CLOUD_TOKEN environment
variable, and then restart LiteFS on each node. How you do this depends on how you have configured
LiteFS. If you’re running LiteFS separately from your app, then for each node, you should:
Update your configuration with the new environment variable
Stop your app (so that it’s not reading/writing data anymore)
Restart litefs
Start your app again!
If you’re running LiteFS via systemd, you can restart it with:
systemctl restart litefs
Remember that this needs to be run for every LiteFS node.