Skip to main content
Percher is still being built, but you can try it out with a free account right now!
← All deploy guides
Deploy guide · runtime = "docker"

Ship Rust (axum) in ~2 minutes.

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, then prints the live URL.

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)?

Start on the Free plan. No credit card, live in ~2 minutes.

Sign up free →