Cargo.toml at the top level and listens on 0.0.0.0:8080. It works with frameworks like Axum, Actix Web and Rocket. Laravel Rust is supported too and gets extra setup. Your project is built on the pod in release mode, and the program runs as a systemd service.
The Rust preset is in beta. It needs the Build plan (2 GB of memory) or higher, because compiling Rust takes more memory than Launch has. It isn’t available on a free trial pod.
What’s Included
How Your App Runs
- App root:
/home/instapod/app. YourCargo.tomlmust be here, at the top level. - App port: 8080
- Program:
/home/instapod/.app-bin/app, copied there after each successful build - Runs as the
instapoduser, starts on boot, restarts on a crash
PORT=8080, HOST=0.0.0.0, ROCKET_PORT=8080 and ROCKET_ADDRESS=0.0.0.0.
The Build Step
Every deploy (git,instapods deploy, ZIP upload, pods reload) runs these steps:
- Front end. When
package.jsonhas abuildscript, its packages are installed and the script runs. npm, pnpm, Yarn and Bun are supported. - Compile.
cargo build --release. - Install. The new program is copied into place and the service restarts.
If any step fails, the deploy fails with the error and your previous program keeps running.
How long it takes
A first build compiles every crate you use. On the Build plan, a small Axum app takes about 35 seconds. Laravel Rust takes about 5 minutes, and can take up to 10. Later deploys reuse thetarget/ folder and usually finish in under a minute. One build may take up to 30 minutes.
target/ is kept between deploys. It is left out of backups, and it is emptied before a build when it passes 6 GB.
Which program runs
The program is read fromCargo.toml. If your project builds several, name the one to run:
default-members.
Custom build command
You can replace the build in the pod’s Git settings. End your command by copying the program to/home/instapod/.app-bin/app.new. InstaPods then puts it in place and restarts the app:
Deploying Your App
Cargo.toml at its top level is detected as Rust. A repo that also has a package.json or composer.json is Rust when it depends on a web framework such as Axum, or has a program to run (src/main.rs, [[bin]] or default-run). A Node package with a Rust add-on (napi-rs, Neon) and a Tauri app stay Node.js, and a Python package built with maturin stays Python. Pass --preset to override.
instapods deploy from a folder detects Rust from CLI v1.19.0. On an older CLI, pass --preset rust.Example App
Laravel Rust
An app that depends on thelaravel-rust crate gets its settings written to .env on each deploy:
When
Cargo.toml turns on database-postgres or database-mysql and the pod has no such database, it is installed on the first deploy. migrate --force runs after each build when DATABASE_URL is set, but not on a rollback. If a migration fails, the deploy fails and the old program keeps running. Set your own release command in the pod’s Git settings to replace it.
Queue worker
A worker runs your queued jobs. It is a systemd service calledapp-worker that runs queue:work. Your next deploy or reload sets it up, and it restarts whenever the app does.
schedule:work) are not started for you.
Adding a Database
Limits
- The Cargo project must be at the top level of the repo. The subdirectory setting (
--subdir) doesn’t change that. - A
Dockerfilein the repo is not used. - Crates that need a system library other than OpenSSL don’t build until you install it in the pod with
apt-get.