Skip to main content
Percher is still being built and account creation is paused — get notified when it opens.
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 current Rust 1.x on 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.
  • Install the binary outside `/app` (the template uses `/usr/local/bin/app`). Percher mounts persistent data at `/app/data`, so an image with a file at `/app` cannot start. The fix is not yet in npm release 1.0.1: its template copies the binary to `/app` and fails with `APP_DATA_MOUNT_CONFLICT`. In that generated Dockerfile, change the binary destination and CMD to `/usr/local/bin/app` before publishing.
  • 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