# Best way to host pocketbase?

**URL:** <https://community.fly.io/t/best-way-to-host-pocketbase/12911>\
**Category:** General\
**Tags:** databases, login-only\
**Created:** [May 15, 2023, 9:04pm UTC](https://community.fly.io/t/best-way-to-host-pocketbase/12911 "2023-05-15T21:04:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![thewalruswaspaul](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/thewalruswaspaul/32/12295_2.png) [@thewalruswaspaul](https://community.fly.io/u/thewalruswaspaul)\
**Post date:** [May 15, 2023, 9:04pm UTC](https://community.fly.io/t/best-way-to-host-pocketbase/12911/1 "2023-05-15T21:04:42Z")

</div>

Hello,

I am trying to host a pocketbase session ([https://pocketbase.io/](https://pocketbase.io/)) on [fly.io](http://fly.io). I was able to do it pretty easily following a guide provided by the pocketbase team ([https://github.com/pocketbase/pocketbase/discussions/537](https://github.com/pocketbase/pocketbase/discussions/537)), but I noticed an message about requiring two volumes per app. I noticed this in the docs as well:

`Always run at least two volumes per app. We usually recommend running at least two Machines per app to increase availability, and if you're using volumes, then each machine should have an attached volume. If you only have one Machine and volume, you'll have downtime if there's a host or network failure, and whenever you deploy your app.`

Does anyone have experience with the best way to host pocketbase here?

---

<div class="post-metadata">

**Author:** ![Alex21](https://avatars.discourse-cdn.com/v4/letter/a/5e9695/32.png) [@Alex21](https://community.fly.io/u/Alex21)\
**Post date:** [May 16, 2023, 7:00pm UTC](https://community.fly.io/t/best-way-to-host-pocketbase/12911/2 "2023-05-16T19:00:43Z")

</div>

One option is you can decide that having occasional downtime during host or network failure or whenever you deploy your app is okay. In that case, just one machine and volume is fine. As long as you backup your database off of that volume (for example, onto an S3 account) periodically in case there’s an unrecoverable hardware failure with the disk drive that the volume is on. See [Basics - Going to production - Docs - PocketBase](https://pocketbase.io/docs/going-to-production/#backup-and-restore) and [VACUUM](https://www.sqlite.org/lang_vacuum.html#vacuum_with_an_into_clause) for more info about backups.

If occasional downtime is not okay, then yes you’ll want at least two machines and volumes. In that case, you can use [LiteFS - Distributed SQLite · Fly Docs](https://fly.io/docs/litefs/) to keep the copies of the database synchronized.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/fly1/original/3X/6/e/6e8955d00cb218e186ebbe3a6ab06fefdce15290.svg) [@system](https://community.fly.io/u/system)\
**Post date:** [May 23, 2023, 7:01pm UTC](https://community.fly.io/t/best-way-to-host-pocketbase/12911/3 "2023-05-23T19:01:09Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
