Rust web app hosting: how to deploy an axum or Actix Web app
A Rust web app is one release binary that binds 0.0.0.0 on the port it is given and shuts down on SIGTERM. The hard part is the build: a first release build takes minutes, so the host must keep its cache. On Livops you push a repository with Cargo.toml, it is built with cargo build --release and runs as a web app for 39 credits a month (39,000 so'm).
By Livops team, the people who build and run LivopsUpdated
A Rust web server is small and fast once it is running; getting it running is where hosting differs. The release build of a real axum or Actix Web app takes minutes, most of it compiling dependencies, so a host that throws its cache away makes every deploy that slow. This page covers what a Rust web app needs in production — binding, shutdown, build profile, binary size — compares where to run one with each provider’s own prices, and ends with exactly what Livops does with a Cargo.toml.
What does a Rust web app need in production?
An address of 0.0.0.0 and the port from the environment
Read PORT and bind 0.0.0.0 on it. Actix Web’s own example binds 127.0.0.1, and bind fails if the socket is already in use by another program[2]; in a container, 127.0.0.1 means nobody outside can reach you.
A shutdown that finishes requests
axum’s with_graceful_shutdown takes a future you write and starts the shutdown when it completes[1]: catching SIGTERM is your code’s job. Actix Web handles signals itself: SIGTERM shuts its workers down gracefully, SIGINT and SIGQUIT force them, and the workers have 30 seconds by default, changed with shutdown_timeout()[2]. Keep that shorter than the host’s own stop window.
An axum 0.8 server[1], with both:
use axum::{routing::get, Router};
use tokio::signal::unix::{signal, SignalKind};
#[tokio::main]
async fn main() {
let app = Router::new().route("/healthz", get(|| async { "ok" }));
let port: u16 = std::env::var("PORT").ok().and_then(|p| p.parse().ok()).unwrap_or(3000);
let listener = tokio::net::TcpListener::bind(("0.0.0.0", port)).await.unwrap();
axum::serve(listener, app)
.with_graceful_shutdown(async {
let mut term = signal(SignalKind::terminate()).unwrap();
tokio::select! {
_ = term.recv() => {},
_ = tokio::signal::ctrl_c() => {},
}
})
.await
.unwrap();
}
The same in Actix Web, with the shutdown window shortened:
HttpServer::new(|| App::new().route("/healthz", web::get().to(|| async { "ok" })))
.bind(("0.0.0.0", port))?
.shutdown_timeout(20)
.run()
.await
The right number of workers
Actix Web starts one worker per physical CPU in the system unless workers() says otherwise[2]. On a server you share, that may be more workers than the share of the machine you are given; set it.
A release build, and a smaller binary
cargo build --release uses the release profile: opt-level = 3, no debug info, strip = "none", lto = false, codegen-units = 16[3]. Three settings make the binary smaller or faster in exchange for build time: strip = true removes symbols[3]; lto optimises across crates at the cost of longer linking[3]; fewer codegen-units means less of a crate is compiled in parallel, which may make the code faster and the build slower[3].
[profile.release]
strip = true
lto = "thin"
A small image, if you build one
In a Docker image, a multi-stage build compiles in the Rust image and copies only the binary into the final one, leaving every build tool behind[4]. The final image needs whatever the binary links at run time — the C library it was built against, and CA certificates for an app that calls HTTPS APIs.
Configuration and a database
Secrets and settings belong in environment variables; data that must outlive a restart belongs in a database, whose address is best read from a variable such as DATABASE_URL.
The options at a glance
| Option | What it is | Smallest paid always-on process | What you still maintain |
|---|---|---|---|
| Livops | A platform; servers in Uzbekistan | 39 credits (39,000 so’m) a month | Your code |
| A VPS in Uzbekistan | A virtual machine with root | 82,000 so’m a month: 1 vCPU, 2 GB, 30 GB HDD (SmartCloud)[5] | The system, the build, a systemd unit, a reverse proxy, HTTPS |
| Render | A platform with native Rust builds | $7 a month: 0.5 CPU, 512 MB[6] | Your code |
| Railway | A platform billed by usage | Hobby: $5 a month, including $5 of usage[8] | Your code |
| Fly.io | Virtual machines billed by the second | $2.19 a month: shared-cpu-1x, 256 MB[9] | Your code, and its Docker image |
| DigitalOcean App Platform | A platform with container instances | $5 a month: 1 shared vCPU, 512 MiB[10] | Your code |
Other providers’ prices are from each provider’s own page, read on 20 November 2026; the dates are in Sources below. Livops prices are the ones the cabinet bills today.
Each option
Livops
A Cargo.toml is enough: the release build runs on Livops’s servers with the compiled dependencies cached per project, and the binary runs as a web app with an address and HTTPS. Payment is in so’m through Payme or Click, Uzbekistan’s payment services; the servers are in Uzbekistan, close to users there and farther from users elsewhere. You get no root, one app’s memory stops at 2 GB, and a single build may not run longer than ten minutes.
A VPS
82,000 so’m a month buys SmartCloud’s cheapest 2 GB machine[5]. Either the server compiles, and needs the toolchain and the memory for it, or you build elsewhere and copy the binary up — and then it has to match the server’s system. After that it is one systemd unit, plus HTTPS, a proxy and the updates.
Render
Render lists Rust among its native runtimes, beside custom Docker containers[6]. The smallest paid web service is $7 a month for 0.5 CPU and 512 MB[6], and web services have a free instance type[7].
Railway
The Hobby plan is $5 a month, with $5 of usage included and always-on services; memory is about $10 per GB a month and CPU about $20 per vCPU a month, billed by the second[8]. Plans are paid by card[8].
Fly.io
The smallest machine is $2.19 a month for shared-cpu-1x and 256 MB, billed by the second[9] — the lowest dollar price in this table. A personal organisation’s bill under $5 a month is waived[9].
DigitalOcean App Platform
$5 a month buys a fixed shared instance with 1 vCPU, 512 MiB and 50 GiB of outbound transfer, limited to one container instance[10].
Build where, run where?
The real trade-off for Rust is where the compile happens. Building on the server needs memory and a cache that survives between deploys; building in CI needs a binary, or an image, that matches the machine it will run on — which is what exec format error is about when it does not. A platform that builds from your repository and keeps the cache, as Livops does, removes both problems at the cost of the build minutes. A VPS keeps everything in your hands, including the toolchain updates.
Where can you host a Rust app for free?
- Livops has no free tier for apps. On an account that has not paid yet, the first bot or app runs for 15 minutes on a zero balance, once. Static sites are free.
- Render gives each workspace 750 free instance hours a month; a free web service spins down after 15 minutes without inbound traffic and takes about a minute to start again[7].
- Railway has a Free plan with $1 of usage a month, up to 1 vCPU and 0.5 GB per service, that sleeps after 5 to 10 minutes without outbound traffic; a trial gives $5 for 30 days with no card[8].
- Fly.io has no free tier for new organisations: a $1 trial for 7 days, and a personal bill under $5 a month is waived[9].
- DigitalOcean App Platform is free for up to 3 static sites only[10].
Rust hosting on Livops
- In the cabinet, create a project from a GitHub repository, or upload the folder or a
.zip(target/is left out of uploads). For a monorepo, set the folder the crate is in. - Put settings and secrets under Variables. For a database, add PostgreSQL under Databases;
DATABASE_URLis written into the app’s variables by itself. - Deploy. The log shows
cargo fetch, the compile and the start.
What Livops does with a repository that has Cargo.toml at its root and no Dockerfile:
- Install:
cargo fetch. - Build:
cargo build --release, into the project’s cache, which keeps the compiled dependencies for the next build. A Rust web app takes 8 to 9 minutes on its first build and about a minute after a code change. If cargo fails, its error is the last thing in the log. - The binary: the one named after the package in
Cargo.toml, or the one executable the release build left. It is copied to.livops/bin/appandtarget/is removed, so the release is the program alone. A crate that builds no binary says “no binary”. - Run: the binary starts on its own, without the Rust toolchain beside it. After the first build it is a web app, which must answer HTTP on
PORT; a program that opens no port should be created as a worker instead.
With a Dockerfile in the repository, the Dockerfile builds it; see Docker hosting. To name a health path or a size, put livops.json in the root:
{
"kind": "web",
"healthPath": "/healthz",
"memory": 256
}
When it runs:
- The environment has
PORT(3000 unless you change it). - On a new push, the new binary has a minute to answer on
PORT— onhealthPathwith 2xx or 3xx, if you set one — before traffic moves to it. The old one keeps running 15 seconds for requests in flight, then gets SIGTERM and 30 seconds. If the new one never answers, the old one keeps serving. - If it crashes it is started again; ten crashes inside 15 minutes and it is stopped, and you are told with its last lines.
- Builds may run for ten minutes. One that runs out continues from the cache on the next deploy.
- Memory: one CPU and 384 MB by default, or 256, 512, 1024 or 2048 MB; the size is part of what you pay for.
- Files written to
/app/data(theDATA_DIRvariable) survive deploys;/tmpdoes not.
A web app is 39 credits a month (39,000 so’m). One credit is 1,000 so’m; see Pricing.
Questions
Do I need a Dockerfile to deploy Rust on Livops?
No. A Cargo.toml at the root is enough: Livops runs cargo fetch and cargo build --release and starts the binary. If the repository has a Dockerfile, that builds it instead.
Which binary does Livops start?
The one named after the package in Cargo.toml. If there is none by that name, the one executable the release build left. It is copied out of target/, which is then removed, so the release is the program alone.
How long does a Rust build take on Livops?
A Rust web app takes 8 to 9 minutes on its first build and about a minute after a code change, because the compiled dependencies stay in the project's cache. A build may run for ten minutes; if one runs out of time, deploy again and it continues where it stopped.
Which address should an axum or Actix app bind?
0.0.0.0 and the port in the PORT variable, 3000 unless you change it. 127.0.0.1, which many examples use, is reachable only from inside the container.
Does Actix Web's graceful shutdown work on Livops?
Yes. A replaced version gets SIGTERM, which Actix treats as a graceful shutdown, and then 30 seconds. Actix waits 30 seconds by default too, so set shutdown_timeout a little lower, for example 20.
How much does a Rust app cost on Livops?
39 credits a month, 39,000 so'm at 1,000 so'm a credit. There is no free tier for apps; the first app on an account that has not paid runs for 15 minutes on a zero balance, once.
Sources
- axum — Serve (docs.rs) (docs.rs). Checked .
- Actix Web — HTTP server (actix.rs). Checked .
- Cargo — Profiles (doc.rust-lang.org). Checked .
- Docker — Multi-stage builds (docs.docker.com). Checked .
- SmartCloud — VDS plans (smartcloud.uz). Checked .
- Render — Pricing (render.com). Checked .
- Render — Deploy for free (render.com). Checked .
- Railway — Pricing (railway.com). Checked .
- Fly.io — Pricing (docs.fly.io). Checked .
- DigitalOcean — App Platform pricing (digitalocean.com). Checked .
Put your project online today
Connect GitHub or drop a folder. No card is asked for.
Deploy your Rust appRelated
- Go hosting in 2026: how to deploy a Go appA Go web app compiles to one binary, so hosting it means building that binary, running it on the port it is given and shutting it down with http.Server.Shutdown. On Livops you push a repository with go.mod: it is built with CGO off into a static binary and runs as a web app for 39 credits a month (39,000 so'm). Here is what Go needs, and how a VPS, Render, Railway, Fly.io and DigitalOcean compare.
- Docker hosting: how to deploy a Docker container or a DockerfileTo host a container you need a host that builds or pulls the image, starts its CMD, sends traffic to the port it listens on and stops it with SIGTERM. On Livops a Dockerfile at the root of the repository is built on Livops's servers and runs for 39 credits a month (39,000 so'm); a public image from Docker Hub, GHCR or Quay runs without a build. Here is what a container needs, and how a VPS, Render, Railway, Fly.io, DigitalOcean and Heroku compare.
- The best Heroku alternative in 2026: six options comparedHeroku moved to a sustaining engineering model in February 2026 and no longer sells Enterprise contracts to new customers, but card-paying customers keep the same service and prices. If you are moving anyway: Render is the closest like-for-like, Railway bills by usage, Fly.io is the cheapest in dollars, DigitalOcean is the simplest flat price, Coolify runs on your own servers, and Livops fits apps whose users are in Uzbekistan, at 39 credits a month (39,000 so'm) for an app.
- App not listening on $PORT: why the health check failed after deployThe platform started your app, tried the port it gave it, and nothing answered in time. Almost always the app listens on its own fixed port instead of the PORT variable, listens on localhost (127.0.0.1) instead of 0.0.0.0, or crashed or was still starting when the check gave up. Listen on 0.0.0.0 and the port in PORT, and it passes.
- exec format error in Docker: the image was built for another CPUThe kernel refused to run the container's program because it is not an executable for this machine: almost always a binary or image built for arm64 (an Apple Silicon Mac) running on an amd64 server, or the reverse. Build for the server's platform with --platform linux/amd64, or as a multi-platform image; if the file is a script, give it a #! line.