Crescendo Lab

Rust (Axum) deploy guide · Agent Lab Deploy

Deploy Rust (Axum)
in one sentence.

Add the Dockerfile below to your Rust (Axum) project — or tell Claude Code, Codex or Cursor "deploy this". Agent Lab builds it into a web service, gives every version a preview URL with rollback, and checks uploads for leaked keys. Apps and databases run on Google Cloud in Taiwan.

Start freeSee the setup

Why deploy Rust (Axum) on Agent Lab

Rust (Axum) online without running a server yourself

Rust project, built from a Dockerfile, deployed as a web service.

A Dockerfile that fits

The Dockerfile below listens on $PORT, runs as non-root and writes only to /tmp, the rules the platform checks.

Preview, go live, roll back

Every upload is a new version with its own URL. Look first, then go live; switch back to any version in one click.

Leaked keys caught

Uploads are checked for API keys and credentials before they can go live. Secrets go in the console, never in the code.

PostgreSQL in one click

Create a database and connect it; the connection is written into the app's environment and the password is never shown.

Your options

Rust (Axum) on Agent Lab, or on your own VPS

Scroll the table sideways.

Deploying Rust (Axum) on Agent Lab compared with a self-managed VPS
What you care aboutAgent Lab DeployYour own VPS
SetupUpload with the Dockerfile below, or say one sentenceSSH, a runtime, a process manager, a reverse proxy
HTTPS and domainsAutomatic, custom domains on paid plansCertbot and DNS by hand
Preview and rollbackEvery version has its own URL; roll back in one clickWrite your own scripts
Before going liveUploads checked for leaked keysNothing unless you set it up
DatabasePostgreSQL in one click, connection written into the appInstall and back it up yourself
Cost to startFree plan: NT$0, one size-S app (sleeps when idle)A VPS at roughly NT$200–600 a month, plus your time

Steps

Deploy Rust (Axum) in four steps

  1. Prepare

    Add the Dockerfile below at the top of the project and replace the placeholder names.

  2. Upload or ask

    Drop the folder on a project's Deploy tab, push from GitHub, or ask your AI tool through Agent Lab MCP.

  3. Build and check

    The platform builds the version and checks it for leaked keys. Enter any secrets it lists in Settings.

  4. Preview and go live

    The first version goes live once it builds. Later ones get a preview URL; go live when you're happy.

Setup

A Rust (Axum) Dockerfile

Replace myapp with the package name in Cargo.toml; Actix Web and Rocket work the same way as long as they listen on 0.0.0.0:$PORT. Install ca-certificates in the second stage, or outbound HTTPS calls fail.

Copy

Dockerfile

FROM rust:1 AS build
WORKDIR /src
COPY . .
RUN cargo build --release

FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates \
 && rm -rf /var/lib/apt/lists/*
COPY --from=build /src/target/release/myapp /usr/local/bin/myapp
USER 10001
EXPOSE 8080
CMD ["myapp"]

// main.rs:監聽 0.0.0.0:$PORT / listen on 0.0.0.0:$PORT
// let port = std::env::var("PORT").unwrap_or("8080".into());
// let listener = tokio::net::TcpListener::bind(format!("0.0.0.0:{port}")).await?;
  • PORT the port the platform gives (8080 by default); the server must listen on it.
  • DATABASE_URL written for you when you connect an Agent Lab PostgreSQL.
Prompt

Or ask your AI tool

Read https://app.agentlab.cresclab.com/agent/deploy.md and deploy this Rust (Axum) project to Agent Lab using the Dockerfile at the top. Show me the build plan and the environment variables it needs first, tell me where to enter any secrets, and wait for my OK before it goes live.

FAQ

Deploying Rust (Axum): questions

Do I need a Dockerfile to deploy Rust (Axum)?
Yes. Agent Lab builds Rust (Axum) from the Dockerfile at the top of the project; the one on this page meets the platform's rules (listen on $PORT, linux/amd64, write only to /tmp). Docs →
Rust builds are slow; what helps?
Copy Cargo.toml and Cargo.lock first and build the dependencies, then copy the source, so dependencies are cached. Or build the image locally or in CI and push it to your organization's registry.
Where do API keys and other secrets go?
In the project's Settings, under Secrets; the code reads them as environment variables. Random values such as session secrets can be generated in the console without anybody seeing them. A key found in an upload stops it before it goes live.
Can I deploy Rust (Axum) from Claude Code or Codex?
Yes. Connect Agent Lab MCP once (one command, sign in in the browser, no API key), then say "deploy this Rust (Axum) app". The tool creates the project, uploads, waits for the build and asks before going live. Connect MCP →
Is there a free way to host Rust (Axum)?
The Free plan is NT$0: one size-S app that sleeps after 15 idle minutes, one size-S database, three static web pages, 100 build minutes and 5 GB of traffic a month, pausing at the limit instead of charging. Pro (US$29 a month before tax) keeps apps running and adds custom domains. Pricing →