Deploy a Rust application on onesubnet
Compile a Rust binary (cargo) and run it: build, port via env, environment variables.
Deploy a Rust application on onesubnet
onesubnet compiles your Rust binaries (Actix, Axum, Rocket…) and runs them. Deploy via Git.
1. Prepare the project
- A
Cargo.tomlat the root. - Make your server listen on the port from the
PORTvariable:
let port: u16 = std::env::var("PORT").unwrap_or("8080".into()).parse().unwrap();
axum::serve(listener, app).await.unwrap();
2. Deploy
- Connect your Git repository in the panel.
- Build command:
cargo build --release - Start command:
./target/release/<binary_name>
3. Environment variables
DATABASE_URL, secrets, etc. in Settings → Environment.
4. Logs
Live console in the panel. Use the tracing crate for structured logs.