Docs menu

Rust

Deploy Rust apps on Primcloud: Cargo-driven release builds, toolchain pinning with rust-toolchain, one process per compiled binary.

On this page

Primcloud deploys Rust apps built with Cargo. Detection triggers when Primcloud finds a Cargo.toml at the root of your repo. The Rust toolchain is resolved from rust-toolchain or rust-toolchain.toml, defaulting to the current stable release.

Every binary in the package or workspace is compiled in release mode. If no Procfile exists, process types are inferred from those binaries: each binary is its own process, and the one named web, or the first when none is, becomes the default web process.

A Rust app with a package.json gets its frontend installed and built before Cargo runs, and the Rust binary still serves the app.

What's in this section#

  • Getting started with Rust: deploy a minimal Rust web app end-to-end.
  • Rust on Primcloud: detection, toolchain install, cargo build, caching, frontend builds, and automatic process type inference.
  • Runtime versions: supported toolchain channels, rust-toolchain and rust-toolchain.toml resolution, and upgrade path.
  • Package managers: Cargo, Cargo.lock, workspaces, private registries, and the JavaScript package managers used for frontend builds.
  • Customizing the build: choosing which binaries ship, release profile settings, native dependencies, and Debian packages via project.toml.
  • Troubleshooting Rust: common build and runtime errors with fixes.