Galaxy
Web Apps

Rust

Deploy a Rust web app on Galaxy and choose the Cargo binary and toolchain it builds with.

Galaxy builds a release binary from your Git repository and runs it as a web service. If your app uses Laravel Rust, start with the Laravel guide for its database and health check defaults.

Prerequisites


1. Prepare Your App

  • Put Cargo.toml in the directory Galaxy builds. If the app lives in a subdirectory, select that directory as the build root. A workspace manifest without a package at the build root isn't supported.
  • Listen on 0.0.0.0 and use the PORT environment variable. Galaxy defaults to port 3000.
  • If you commit Cargo.lock, Galaxy adds --locked to the release build. Commit the updated lockfile when you change dependencies.

2. Deploy

Choose your app type

In the Galaxy dashboard, click Create New > Deploy App, then select Rust.

Configure and deploy

Follow the Git deployment steps. Add any environment variables your app needs before clicking Deploy.

Galaxy fetches Cargo dependencies, runs cargo build --release for the selected binary, and starts it as /app/server. Open your app URL once the deploy completes.


3. Configure (Optional)

Binary: Galaxy uses [package].default-run first. Otherwise, it uses a single explicit [[bin]] target, or the package name when the app has a conventional src/main.rs. If your manifest declares multiple binaries, set default-run to the web server's binary name.

Toolchain: To override Galaxy's default Rust version, specify a version or channel in rust-toolchain.toml or rust-toolchain. Without a toolchain override, Galaxy uses [package].rust-version if it specifies a newer minimum.

Health check path: Set it to a route that returns a successful response if your app doesn't serve /.


4. Try It

Try the Axum example. Replace its fixed port with PORT before deploying.


Troubleshooting


What's Next?