Single binary deploy

Swift Rust compiles your app into a single statically-linked binary. The output is portable across Linux distributions — no glibc version compatibility issues, no Node.js, no npm at runtime.

Build

terminal
cargo build --release
# → target/release/swift-rust-app
# A single 12-20MB binary, no runtime dependencies

Run

terminal
PORT=3000 ./target/release/swift-rust-app

What gets bundled

  • The Swift Rust runtime (the framework's core, powered with Rust)
  • Your application code (compiled to WASM)
  • The Bun runtime (statically linked)
  • All your static assets (images, fonts, CSS, JS)
  • Your PDF templates and font files

Cross-compilation

The build system supports cross-compilation to any target that Rust supports. Add the target with rustup target add and pass --target to cargo build.

terminal
# Build for aarch64 Linux from an x86_64 host
rustup target add aarch64-unknown-linux-musl
cargo build --release --target aarch64-unknown-linux-musl

Deployment targets

The single binary deploys to any environment that can run Linux ELF binaries:

  • AWS EC2, GCP Compute Engine, Azure VMs
  • DigitalOcean, Linode, Vultr, Hetzner
  • Fly.io, Render, Railway
  • Kubernetes, Docker Swarm, Nomad
  • Bare metal

Systemd unit

/etc/systemd/system/swift-rust-app.service
[Unit]
Description=Swift Rust App
After=network.target

[Service]
Type=simple
User=app
WorkingDirectory=/opt/swift-rust-app
ExecStart=/opt/swift-rust-app/swift-rust-app
Restart=on-failure
Environment=PORT=3000

[Install]
WantedBy=multi-user.target