{
  "manifest_version": "1",
  "slug": "sqlite",
  "title": "SQLite",
  "headline": "SQLite in production",
  "description": "Run SQLite in production on an exe.dev VM: the right settings, Litestream streaming every change to your S3 bucket, nightly snapshots, and a private web UI.",
  "category": "databases",
  "tags": [
    "sqlite",
    "litestream",
    "sqlite backup",
    "wal mode",
    "s3",
    "sqlite-web",
    "point-in-time recovery",
    "turso alternative"
  ],
  "url": "https://exe.dev/deploy/sqlite",
  "markdown_url": "https://exe.dev/deploy/sqlite.md",
  "upstream": {
    "website": "https://sqlite.org",
    "source": "https://sqlite.org/src/",
    "docs": "https://sqlite.org/docs.html",
    "license": "Public domain (Litestream Apache-2.0, sqlite-web MIT)"
  },
  "example_vm_name": "my-sqlite",
  "time": "10 minutes",
  "stack": [
    {
      "name": "SQLite 3.45",
      "detail": "Ubuntu 24.04's sqlite3; your app brings its own library",
      "data": "~/data/app.db"
    },
    {
      "name": "Litestream 0.5.18",
      "detail": "Streams every change to your S3-compatible bucket, keeps a week"
    },
    {
      "name": "Nightly snapshots",
      "detail": "Every database in ~/data, checked, 14 nights kept",
      "data": "~/sqlite/backups"
    },
    {
      "name": "sqlite-web 0.8.2",
      "detail": "Browse and edit in the browser, behind exe.dev login and an email allowlist",
      "port": 8001
    }
  ],
  "access": [
    {
      "url": "https://my-sqlite.exe.xyz:8001/",
      "who": "private",
      "what": "sqlite-web, for the emails in ~/sqlite/web/allowed-emails"
    },
    {
      "url": "https://my-sqlite.exe.xyz/",
      "who": "private",
      "what": "Port 8000, left free for your app"
    }
  ],
  "inputs": [
    {
      "name": "LITESTREAM_BUCKET",
      "description": "an empty bucket for Litestream's copy ([get one](#get-a-bucket)), or `none` to set up everything else and add the bucket later"
    },
    {
      "name": "LITESTREAM_ENDPOINT",
      "description": "R2: `https://\u003cACCOUNT_ID\u003e.r2.cloudflarestorage.com`; Backblaze B2: `https://s3.\u003cregion\u003e.backblazeb2.com`; Tigris: `https://t3.storage.dev`; Amazon S3: leave empty"
    },
    {
      "name": "LITESTREAM_REGION",
      "description": "`auto` for R2 and Tigris, the bucket's region for B2, empty for Amazon S3"
    },
    {
      "name": "LITESTREAM_ACCESS_KEY_ID",
      "description": "a key that can read and write that bucket, and nothing else"
    },
    {
      "name": "LITESTREAM_SECRET_ACCESS_KEY",
      "description": "the key's secret"
    }
  ],
  "delivers": [
    "A SQLite database at `~/data/app.db` in WAL mode, readable only by `exedev`, and a `sqlite3` set to wait for locks.",
    "Litestream 0.5.18 streaming it to your bucket as litestream.service, started at boot on this VM only, with a copy restored from the bucket and checked.",
    "Nightly snapshots of every database in `~/data` into `~/sqlite/backups`, 14 kept, one restored and checked.",
    "sqlite-web at `https://\u003cvm\u003e.exe.xyz:8001/`, open only to the owner's exe.dev email."
  ],
  "deployable": true,
  "deploy": {
    "new_vm_url": "https://exe.dev/new?prompt=LITESTREAM_BUCKET%3D%3Cfill-this-in%3E%0ALITESTREAM_ENDPOINT%3D%3Cfill-this-in%3E%0ALITESTREAM_REGION%3D%3Cfill-this-in%3E%0ALITESTREAM_ACCESS_KEY_ID%3D%3Cfill-this-in%3E%0ALITESTREAM_SECRET_ACCESS_KEY%3D%3Cfill-this-in%3E%0A%0ASet%20up%20SQLite%20on%20this%20VM%20by%20following%20the%20exe.dev%20recipe%20at%20https%3A%2F%2Fexe.dev%2Fdeploy%2Fsqlite.md%20from%20top%20to%20bottom.%0A%0AThe%20values%20at%20the%20top%20of%20this%20message%20are%20mine%3A%0A-%20LITESTREAM_BUCKET%3A%20an%20empty%20bucket%20for%20Litestream%27s%20copy%20%28%5Bget%20one%5D%28%23get-a-bucket%29%29%2C%20or%20%60none%60%20to%20set%20up%20everything%20else%20and%20add%20the%20bucket%20later%0A-%20LITESTREAM_ENDPOINT%3A%20R2%3A%20%60https%3A%2F%2F%3CACCOUNT_ID%3E.r2.cloudflarestorage.com%60%3B%20Backblaze%20B2%3A%20%60https%3A%2F%2Fs3.%3Cregion%3E.backblazeb2.com%60%3B%20Tigris%3A%20%60https%3A%2F%2Ft3.storage.dev%60%3B%20Amazon%20S3%3A%20leave%20empty%0A-%20LITESTREAM_REGION%3A%20%60auto%60%20for%20R2%20and%20Tigris%2C%20the%20bucket%27s%20region%20for%20B2%2C%20empty%20for%20Amazon%20S3%0A-%20LITESTREAM_ACCESS_KEY_ID%3A%20a%20key%20that%20can%20read%20and%20write%20that%20bucket%2C%20and%20nothing%20else%0A-%20LITESTREAM_SECRET_ACCESS_KEY%3A%20the%20key%27s%20secret%0AAsk%20me%20for%20any%20that%20still%20say%20%3Cfill-this-in%3E%20before%20you%20need%20them.%0A%0AThe%20recipe%27s%20example%20VM%20name%20is%20my-sqlite.%20This%20VM%27s%20name%20is%20the%20output%20of%20%60hostname%60%3A%20use%20it%20wherever%20the%20recipe%20writes%20my-sqlite.%20Skip%20the%20step%20that%20creates%20the%20VM%3B%20you%20are%20on%20it.%0A%0AYou%20are%20done%20when%20all%20of%20these%20are%20true.%20Check%20each%20one%20yourself%3A%0A-%20A%20SQLite%20database%20at%20%60~%2Fdata%2Fapp.db%60%20in%20WAL%20mode%2C%20readable%20only%20by%20%60exedev%60%2C%20and%20a%20%60sqlite3%60%20set%20to%20wait%20for%20locks.%0A-%20Litestream%200.5.18%20streaming%20it%20to%20your%20bucket%20as%20litestream.service%2C%20started%20at%20boot%20on%20this%20VM%20only%2C%20with%20a%20copy%20restored%20from%20the%20bucket%20and%20checked.%0A-%20Nightly%20snapshots%20of%20every%20database%20in%20%60~%2Fdata%60%20into%20%60~%2Fsqlite%2Fbackups%60%2C%2014%20kept%2C%20one%20restored%20and%20checked.%0A-%20sqlite-web%20at%20%60https%3A%2F%2F%3Cvm%3E.exe.xyz%3A8001%2F%60%2C%20open%20only%20to%20the%20owner%27s%20exe.dev%20email.%0A%0ARead%20the%20whole%20recipe%2C%20including%20the%20closed%20details.%20For%20initial%20setup%2C%0Afollow%20%22Install%20by%20hand%22%20from%20top%20to%20bottom%2C%20skipping%20%22Create%20a%20VM%22.%20The%0Awalkthrough%20sections%20are%20for%20the%20owner%20afterwards%3A%20don%27t%20run%20the%20Back%20up%0Aand%20restore%20or%20Update%20instructions%2C%20and%20don%27t%20install%20an%20app.%0AIf%20LITESTREAM_BUCKET%20is%20%60none%60%20or%20the%20owner%20has%20no%20bucket%20yet%2C%20skip%0A%22Give%20Litestream%20your%20bucket%22%2C%20%22Start%20Litestream%22%2C%20and%20%22Test%20a%20restore%0Afrom%20the%20bucket%22%2C%20run%20the%20plain%20%60sqlite3%60%20line%20of%20%22Create%20the%20database%22%2C%0Aand%20tell%20the%20owner%20how%20to%20add%20a%20bucket%20later.%20Otherwise%20write%20the%20owner%27s%0Avalues%20into%20~%2Fsqlite%2Flitestream.env%20without%20printing%20the%20secret%2C%20and%20never%0Aoverwrite%20an%20existing%20litestream.env.%20If%20%60~%2Fsqlite%2Flitestream%20ltx%0A~%2Fdata%2Fapp.db%60%20lists%20files%20before%20~%2Fdata%2Fapp.db%20exists%2C%20the%20bucket%0Aalready%20holds%20a%20database%3A%20ask%20the%20owner%20whether%20to%20restore%20it%20%28only%20if%20no%0Aother%20VM%20is%20still%20replicating%20to%20it%29%20or%20to%20use%20an%20empty%20bucket.%0AAllow%20only%20the%20owner%27s%20email%20in%20sqlite-web%2C%20read%20from%20the%20reflection%0Aintegration%3B%20if%20that%20fails%2C%20ask%20the%20owner%20for%20it.%20Check%20sqlite-web%20on%0Alocalhost%20with%20no%20email%2C%20a%20wrong%20email%2C%20and%20the%20owner%27s%20email.%0ALeave%20the%20VM%20private%20and%20do%20not%20reboot.%20Finish%20with%20the%20sqlite-web%20URL%2C%0Athe%20database%20path%2C%20and%20the%20connection%20settings%20for%20the%20owner%27s%20language%0Afrom%20%22Connect%20your%20app%22.%0A%0AFinish%20with%20the%20URLs%20I%20should%20open.%0A",
    "terminal": "curl -fsSL https://exe.dev/deploy/sqlite/prompt.txt | ssh exe.dev new --prompt=/dev/stdin",
    "prompt": "LITESTREAM_BUCKET=\u003cfill-this-in\u003e\nLITESTREAM_ENDPOINT=\u003cfill-this-in\u003e\nLITESTREAM_REGION=\u003cfill-this-in\u003e\nLITESTREAM_ACCESS_KEY_ID=\u003cfill-this-in\u003e\nLITESTREAM_SECRET_ACCESS_KEY=\u003cfill-this-in\u003e\n\nSet up SQLite on this VM by following the exe.dev recipe at https://exe.dev/deploy/sqlite.md from top to bottom.\n\nThe values at the top of this message are mine:\n- LITESTREAM_BUCKET: an empty bucket for Litestream's copy ([get one](#get-a-bucket)), or `none` to set up everything else and add the bucket later\n- LITESTREAM_ENDPOINT: R2: `https://\u003cACCOUNT_ID\u003e.r2.cloudflarestorage.com`; Backblaze B2: `https://s3.\u003cregion\u003e.backblazeb2.com`; Tigris: `https://t3.storage.dev`; Amazon S3: leave empty\n- LITESTREAM_REGION: `auto` for R2 and Tigris, the bucket's region for B2, empty for Amazon S3\n- LITESTREAM_ACCESS_KEY_ID: a key that can read and write that bucket, and nothing else\n- LITESTREAM_SECRET_ACCESS_KEY: the key's secret\nAsk me for any that still say \u003cfill-this-in\u003e before you need them.\n\nThe recipe's example VM name is my-sqlite. This VM's name is the output of `hostname`: use it wherever the recipe writes my-sqlite. Skip the step that creates the VM; you are on it.\n\nYou are done when all of these are true. Check each one yourself:\n- A SQLite database at `~/data/app.db` in WAL mode, readable only by `exedev`, and a `sqlite3` set to wait for locks.\n- Litestream 0.5.18 streaming it to your bucket as litestream.service, started at boot on this VM only, with a copy restored from the bucket and checked.\n- Nightly snapshots of every database in `~/data` into `~/sqlite/backups`, 14 kept, one restored and checked.\n- sqlite-web at `https://\u003cvm\u003e.exe.xyz:8001/`, open only to the owner's exe.dev email.\n\nRead the whole recipe, including the closed details. For initial setup,\nfollow \"Install by hand\" from top to bottom, skipping \"Create a VM\". The\nwalkthrough sections are for the owner afterwards: don't run the Back up\nand restore or Update instructions, and don't install an app.\nIf LITESTREAM_BUCKET is `none` or the owner has no bucket yet, skip\n\"Give Litestream your bucket\", \"Start Litestream\", and \"Test a restore\nfrom the bucket\", run the plain `sqlite3` line of \"Create the database\",\nand tell the owner how to add a bucket later. Otherwise write the owner's\nvalues into ~/sqlite/litestream.env without printing the secret, and never\noverwrite an existing litestream.env. If `~/sqlite/litestream ltx\n~/data/app.db` lists files before ~/data/app.db exists, the bucket\nalready holds a database: ask the owner whether to restore it (only if no\nother VM is still replicating to it) or to use an empty bucket.\nAllow only the owner's email in sqlite-web, read from the reflection\nintegration; if that fails, ask the owner for it. Check sqlite-web on\nlocalhost with no email, a wrong email, and the owner's email.\nLeave the VM private and do not reboot. Finish with the sqlite-web URL,\nthe database path, and the connection settings for the owner's language\nfrom \"Connect your app\".\n\nFinish with the URLs I should open.\n",
    "prompt_url": "https://exe.dev/deploy/sqlite/prompt.txt"
  },
  "updated": "2026-11-16",
  "verified": "2026-11-16",
  "related": [
    "postgres",
    "go",
    "fastapi",
    "django",
    "nodejs",
    "dev-test-prod"
  ],
  "alternatives": [
    "Turso",
    "Cloudflare D1",
    "PostgreSQL"
  ]
}
