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
- A Galaxy account
- Your app in a Git repo with a
Cargo.toml - A payment method added for identity verification
1. Prepare Your App
- Put
Cargo.tomlin 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.0and use thePORTenvironment variable. Galaxy defaults to port3000. - If you commit
Cargo.lock, Galaxy adds--lockedto 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.

