---
title: "Fermyon Spin with Rust setup guide"
description: "A Rust HTTP component built from Spin's http-rust template is compiled to wasm32-wasi, deployed to Fermyon Cloud, and made to query a Turso database through the libsql-client crate's spin_backend feature."
url: "https://swe.quest/articles/fermyon-spin-with-rust-setup-guide-2c576226c3117826"
canonical: "https://turso.tech/blog/fermyon-spin-with-rust-setup-guide-223813d3"
source: "Turso"
published: "2023-06-27"
difficulty: "medium"
kind: "How-to"
reading_minutes: 8
tags: ["serverless","webassembly","rust","sqlite"]
---

# Fermyon Spin with Rust setup guide

A post on [Turso](https://swe.quest/sources/turso.md), published 2023-06-27, 8 min read, How-to. Original: [https://turso.tech/blog/fermyon-spin-with-rust-setup-guide-223813d3](https://turso.tech/blog/fermyon-spin-with-rust-setup-guide-223813d3)

## Summary

A Rust HTTP component built from Spin's http-rust template is compiled to wasm32-wasi, deployed to Fermyon Cloud, and made to query a Turso database through the libsql-client crate's spin\_backend feature. The crate must be installed from its GitHub URL with default features off, and the database hostname must be added to allowed\_http\_hosts because Spin blocks outbound network access by default. The database URL and auth token are passed in as Spin application variables (the token as a secret, set via SPIN\_CONFIG\_\* env vars locally and --variable on deploy). The synchronous SyncClient is used because Spin does not yet support async functions.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Serverless](https://swe.quest/tags/serverless.md) (Backend & APIs)
- [WebAssembly](https://swe.quest/tags/webassembly.md) (Languages)
- [Rust](https://swe.quest/tags/rust.md) (Languages)
- [SQLite](https://swe.quest/tags/sqlite.md) (Data & databases)

## Prerequisites

- Rust and Cargo basics ([easy posts on Rust](https://swe.quest/tags/rust.md?difficulty=easy))
- WebAssembly/WASI basics ([easy posts on WebAssembly](https://swe.quest/tags/webassembly.md?difficulty=easy))

## Keywords

Fermyon Spin, Turso, libSQL, libsql-client, Fermyon Cloud, wasm32-wasi

## Related posts

- [How We Built the Turso Shell in the Browser](https://swe.quest/articles/how-we-built-the-turso-shell-in-the-browser-3b4c7642ce66be0b.md): Turso · 2025-10-14 · Medium · 9 min read · WebAssembly, SQLite, React, Frontend, Browsers
  Turso's SQLite-compatible database can run entirely in the browser via WebAssembly, persisting data to OPFS with no backend.
- [Introducing Turso in the Browser](https://swe.quest/articles/introducing-turso-in-the-browser-111a711a5e4d489d.md): Turso · 2025-10-08 · Medium · 3 min read · SQLite, WebAssembly, Browsers, Local-first & sync, JavaScript
  Turso, a from-scratch SQLite rewrite, now runs in the browser via WebAssembly as the npm package @tursodatabase/database-wasm, with a better-sqlite3-like API whose methods are all async because of OPFS.
- [Postgres Foreign Data Wrappers with Wasm](https://swe.quest/articles/postgres-foreign-data-wrappers-with-wasm-121e854eab291417.md): Supabase · 2024-08-16 · Medium · 5 min read · PostgreSQL, WebAssembly, Rust, Sandboxing & isolation
  Supabase Wrappers, a Rust framework for building Postgres Foreign Data Wrappers, now supports WebAssembly FDWs that are downloaded from URLs like GitHub or S3, checksum-verified, cached and run in a sandboxed Wasm runtime inside the Postgres extension.
- [WebAssembly functions for your SQLite-compatible database](https://swe.quest/articles/webassembly-functions-for-your-sqlite-compatible-database-e23432782d9473c3.md): Turso · 2022-11-23 · Medium · 6 min read · SQLite, WebAssembly, Rust, Databases
  libSQL, Turso's open-contribution fork of SQLite, adds user-defined functions written in WebAssembly and registered directly from SQL with a CREATE FUNCTION ...
- [Bringing SQLite to Vercel Functions with Turso](https://swe.quest/articles/bringing-sqlite-to-vercel-functions-with-turso-afed2a49c7b44020.md): Turso · 2026-02-19 · Medium · 8 min read · SQLite, Serverless, Replication, Multi-tenancy, JavaScript
  Turso's partial sync replicates a subset of SQLite database pages into Vercel Functions so reads run in-process with no network round-trip, while writes go to the remote Turso database for durability and consistency.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
