Skip to content
Latchkey

spin build and spin up: Fermyon Spin Apps

spin build compiles the components of a Fermyon Spin application and spin up runs them locally.

Spin is Fermyon serverless wasm framework. Its CLI compiles each component (often Rust or JS) per the spin.toml manifest and serves them, a natural pair of CI steps: build then smoke-test.

What it does

spin build reads spin.toml and runs each component build command, producing the wasm each trigger points to. spin up starts the runtime, wiring HTTP or other triggers so you can hit the app. spin registry push publishes it as an OCI artifact.

Common usage

Terminal
spin build
spin up
spin up --listen 127.0.0.1:3000
spin build --up   # build then run in one step

Options

Command / flagWhat it does
spin buildRun each component build command from spin.toml
--upAfter building, start the app immediately
spin upRun the built application locally
--listen <addr:port>Address for the HTTP trigger to bind
-f <file>Use a specific manifest instead of ./spin.toml

In CI

Install the wasm targets each component needs (for Rust components, rustup target add wasm32-wasip1) before spin build. Run spin up --listen 127.0.0.1:PORT in the background, wait for the port, curl the endpoint, then stop it. Cache the toolchain and target directories.

Common errors in CI

"spin: command not found" means the CLI is not installed. "Error: Failed to build component ..." wraps the underlying compiler error, often a missing wasm target (rustup target add wasm32-wasip1). "Error: address already in use" means the --listen port is taken; pick another. A build without the right target fails inside the component build command.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →