Language Frankfurt, Germany

Deploy Rust on Nodion

Nodion recognizes Rust by Cargo.toml. The Rust buildpack runs cargo build --release with the newest stable toolchain, copies your binaries into the run image and starts the one named after your package; the toolchain itself stays out. The app runs in Frankfurt, next to a managed PostgreSQL database if you need one.

Deploy to Nodion ›

from 1 EUR / month

Up to 15 € credit when signing up

Detected by
Cargo.toml
Start
The binary named after the package, else server, api, web or app
Rust
Always the newest release (1.99.x)
Region
EU Central (Frankfurt)

Deploy Rust step by step

  1. Bind to 0.0.0.0:$PORT Nodion sets PORT for the web process. Read it and bind to 0.0.0.0, not 127.0.0.1, or the health check cannot reach the app. With Actix Web, parse the port as u16 and pass ("0.0.0.0", port) to HttpServer::bind. src/main.rs
    use axum::{routing::get, Router};
    
    #[tokio::main]
    async fn main() {
        let port = std::env::var("PORT").unwrap_or_else(|_| "8080".to_string());
        let app = Router::new().route("/", get(|| async { "ok" }));
        let listener = tokio::net::TcpListener::bind(format!("0.0.0.0:{port}"))
            .await
            .unwrap();
        axum::serve(listener, app).await.unwrap();
    }
  2. Commit Cargo.lock and keep [package] first With a Cargo.lock, Nodion builds with --locked, so a lock file that does not match Cargo.toml fails the build. Nodion takes the package name from the first name = line in Cargo.toml, so keep the [package] section at the top. Cargo.toml
    [package]
    name = "myapp"
    version = "0.1.0"
    edition = "2024"
    
    [dependencies]
    axum = "0.8"
    tokio = { version = "1", features = ["full"] }
  3. Extra binaries become process types Every executable in target/release ships in the image, for example one from src/bin/worker.rs. The web process runs the package's binary; each other binary becomes a process type of the same name. To run worker, add a process with that name and no port on the Processes tab and leave its command empty.
  4. Create the app In the dashboard, create an application from your GitHub, GitLab, Bitbucket or Gitea repository, pick the branch and the region EU Central. Keep the build strategy on Buildpacks; if the repository has a Dockerfile, the form picks Dockerfile instead.
  5. Attach PostgreSQL and run migrations Attach a database from the same region on the Environment tab; DATABASE_URL arrives on the next deploy, never during the build. With SQLx, run cargo sqlx prepare and commit the .sqlx folder so the query! macros compile without a database. Run migrations at startup with sqlx::migrate!(), or build a migrate binary and run it as the release step, once per build before the new version starts. Procfile
    release: migrate

Good to know

  • Newest stable Rust onlyrust-toolchain.toml and rust-version do not select an older toolchain: every build uses the newest stable Rust Nodion has built. Nightly toolchains are not available, so crates that need nightly features need a Dockerfile.
  • WorkspacesNodion runs cargo build --release in the base directory without --workspace. In a virtual workspace (a root Cargo.toml with only [workspace]) that builds all members; with a root package it builds only that package, so list every member you need in workspace.default-members. A virtual workspace has no package name, so name the web binary server, api, web or app.

What Nodion runs for you

  • Deploys without downtime Push to your branch and Nodion builds a new release. Traffic switches once the new instances answer their health check; a failed release leaves the running one in place. Apps with a local volume restart instead, because the disk belongs to one instance.
  • Databases next to the app Managed PostgreSQL, pgvector, MySQL, Valkey and ClickHouse in the same region. Attached databases arrive as DATABASE_URL, REDIS_URL or CLICKHOUSE_URL.
  • Previews per pull request Turn on previews and pull requests from your repository get their own app with its own URL and fresh, empty databases, created automatically or by hand. Forks and bot pull requests are skipped.
  • Workers, cron jobs and scaling Run workers as extra processes of the same app, schedule jobs on the Cron tab, and scale every process to up to 16 instances.
  • Release step With buildpacks, a Procfile release: line runs with every new build. Dockerfile apps, and redeploys or rollbacks to an earlier image, use a release command set on the app itself, which also takes precedence over the Procfile line. On static sites a release step runs in an image that holds only the built files.
  • Logs and metrics Build, release and runtime logs plus CPU, memory, disk and network metrics for every instance in the dashboard.
  • Domains and HTTPS A default hostname with HTTPS from the first deploy; your own domains get certificates automatically.

Further reading

Rust on Nodion: questions and answers

Does Actix Web work?

Yes, like Axum or any other server: bind to 0.0.0.0 on the PORT that Nodion sets. Nodion has no framework-specific settings for Rust; it builds and starts your binary.

Why does my Rust build fail with --locked?

Your Cargo.lock does not match Cargo.toml, and --locked stops Cargo from updating it during the build. Run cargo build locally and commit the updated lock file.

Which Rust version does Nodion use?

Always the newest stable Rust Nodion has built, currently 1.99.x. Pins in rust-toolchain.toml or rust-version do not select an older toolchain.

Where does my Rust app run?

In the EU Central region in Frankfurt, Germany. Build, registry, the app and its databases, volumes, buckets, logs and metrics stay in that region, and Nodion's API and control plane are hosted in Germany. Nodion GmbH is based in Stuttgart.

Can I use Rust in line with the GDPR?

Nodion provides the basis for it: Nodion GmbH is based in Stuttgart, Germany, in the Frankfurt region the app, its databases and volumes run in Germany, and you conclude the data processing agreement (DPA) under Art. 28 GDPR electronically in the dashboard. Whether your setup complies also depends on how you configure and use the app.

How much does it cost to run Rust on Nodion?

An app instance starts at 1 EUR per month. The setup in the cost box costs 2.50 EUR per month: App 1 EUR, PostgreSQL 1.50 EUR. Prices are net and billed per second, and you pick bigger sizes or more instances whenever you need them.

Can I use my own domain for my Rust app?

Yes. Every app gets a default hostname with HTTPS. Add your own domain on the app's Domains tab; the TLS certificate is issued and renewed automatically.

Give your agent a cloud.

Earn up to 15 € in credit when signing up.

Continue with GitHub

or with email

Stay in the loop.

Product news, no spam. Unsubscribe anytime.