Skip to main content
A Rust web server runs on Sevalla as an application: Sevalla builds an image from your Git repository, compiles your crate with Cargo in release mode, and runs the binary as processes. The web process runs the binary that serves HTTP, background workers and cron jobs can run other binaries of the same crate or workspace, and jobs run migrations before each deployment.

Framework guides

Axum

Deploy an Axum JSON API on Tokio, with a graceful shutdown on SIGTERM.

Actix Web

Deploy Actix Web 4, with its request logger and built-in graceful shutdown.

Rocket

Deploy Rocket 0.5, with the address and PORT set from code.

How Rust applications run on Sevalla

Every process (web, worker, cron job and job) runs from the same image, each with its own start command. See Processes for every process type and its settings.

Pin the Rust version

Ingot builds on Rust 1.99, its default line, unless the project sets a version. Pin the line you develop with in rust-toolchain.toml, which rustup also reads on your computer, so the build doesn’t change when a new Ingot release moves its default line:
rust-toolchain.toml
Ingot takes the version from the first of these that’s set:
  1. The INGOT_RUST_VERSION environment variable, marked Available during buildtime, such as 1.98.
  2. versions.rust in ingot.json.
  3. The channel of rust-toolchain, or of rust-toolchain.toml when there’s no rust-toolchain file.
  4. The highest rust-version of the packages the build compiles, from Cargo.toml. It’s a minimum: Ingot builds on its default line when that satisfies it.
How Ingot reads the channel:
  • A line, such as 1.99, builds on that line’s newest release, and every new build picks up its patch releases.
  • An exact release, such as 1.99.1, stays on that release, and the build log warns Rust is pinned to exactly 1.99.1, so its image won't receive security rebuilds; require 1.99.x to follow the line.
  • stable builds on Ingot’s default line.
  • nightly or beta fails the build with rust-toolchain.toml asks for the "nightly" toolchain: Ingot builds with stable releases only.
Ingot installs the targets and components the file lists, except the ones for development such as clippy and rustfmt, then leaves the file out of the build, so rustup doesn’t download the toolchain it names. The build plan’s Rust row shows the version and where it came from. See Set the language version.

Build with a Dockerfile

Ingot needs no Dockerfile, but you can write your own for full control of the image. A Dockerfile for Rust on Sevalla builds in a rust image of the line rust-toolchain.toml pins, compiles the dependencies from Cargo.toml and Cargo.lock in a layer of their own, so a code change doesn’t compile them again, and builds with --locked. The binary links to the GNU C library, so the final stage runs on the Debian release it was built on, such as debian:trixie-slim for rust:1.99-slim-trixie, with CA certificates and a user other than root. A server that handles SIGTERM needs no init process; one that doesn’t ignores it as process 1. Each guide has one: see Deploy an Axum application.