Framework
Rust
Rust applications compiled in release mode and served from Debian Slim.
8080Requirements
Cargo.toml in the repo root
DropDeploy runs cargo build --release.
Cargo.lock committed to the repo
For reproducible builds.
App listens on port 8080
Bind to 0.0.0.0:8080.
Demo app
A minimal app that is ready to push and deploy. Copy the files below into a new repository, commit, and deploy — it should go live without any changes.
Quickstart
cargo new my-rust-app && cd my-rust-app
[package] name = "my-rust-app" version = "0.1.0" edition = "2021" [dependencies] actix-web = "4"
use actix_web::{web, App, HttpServer, HttpResponse, Responder};
async fn hello() -> impl Responder {
HttpResponse::Ok()
.content_type("text/html")
.body(r#"
<html>
<body style="font-family:system-ui;display:flex;justify-content:center;
align-items:center;min-height:100vh;margin:0;
background:#0f172a;color:#f1f5f9">
<div style="text-align:center">
<h1 style="color:#f97316">Hello from DropDeploy!</h1>
<p style="color:#94a3b8">Rust + Actix-Web server is live.</p>
</div>
</body>
</html>"#)
}
async fn health() -> impl Responder {
web::Json(serde_json::json!({ "status": "ok" }))
}
#[actix_web::main]
async fn main() -> std::io::Result<()> {
let port: u16 = std::env::var("PORT")
.unwrap_or_else(|_| "8080".to_string())
.parse()
.unwrap_or(8080);
println!("Server running on port {port}");
HttpServer::new(|| {
App::new()
.route("/", web::get().to(hello))
.route("/health", web::get().to(health))
})
.bind(("0.0.0.0", port))?
.run()
.await
}Build & start commands
DropDeploy runs these steps inside the container when you click Deploy.
cargo build --release ./target/release/<your-binary-name>
Environment variables
Set these in Project → Env Vars in the dashboard. Never commit secrets.
| Variable | Required | Description |
|---|---|---|
| PORT | No | Read with std::env::var("PORT"). Defaults to 8080. |
| DATABASE_URL | No | Pass to sqlx or diesel for DB connections. |
Common issues
Build takes 5–15 minutes
Rust compilation is slow on first build. Docker layer caching makes later deploys faster. This is normal.
Multiple binaries in the workspace
DropDeploy picks the first executable in target/release/. Make sure your server binary is the only one, or it is the first alphabetically.