Skip to main content
PercherPercher

Deploy guide · runtime = "docker"

Deploy Rust (axum) on Percher

Axum on Tokio is the modern Rust web stack — async, type-safe, with the same routing ergonomics as web frameworks in other languages. The template builds on Rust 1.82 (Alpine) and ships a small runtime image.

Why Percher fits

  • Rust's release-build performance + Percher's long-running container model means very low p99 latency, even with cold starts.
  • Same multi-stage Docker pattern as the Go template — small final image, fast cold starts.

Quick start

bunx percher create my-app --template rust
cd my-app
bunx percher publish

The first command scaffolds a working Rust (axum) project plus a `percher.toml`. Publish builds and deploys it; the live URL prints on completion.

percher.toml

The canonical config for a Rust (axum) app on Percher. `bunx percher init` generates this automatically when it detects Rust (axum) in your project.

[app]
name = "my-api"
runtime = "docker"
framework = "rust"

[web]
port = 8080
health = "/health"

Common gotchas

  • Use `cargo build --release` in the Dockerfile; debug builds are too large and slow.
  • Cargo's build cache layer matters — copy `Cargo.toml` + `Cargo.lock` first, run an empty-source build to cache deps, then copy the real source. The bundled template already does this.
  • `axum::Server::bind(SocketAddr::from(([0, 0, 0, 0], 8080)))` — `127.0.0.1` won't work from inside the container.

Related docs

Ready to deploy Rust (axum)?

Free plan, no credit card. Live in under a minute.

Sign up free

← Browse all deploy guides