39 breaking releases

new 0.51.0 Jan 10, 2025
0.49.0 Nov 12, 2024
0.47.0 Jul 23, 2024
0.42.0 Mar 18, 2024
0.13.0 Mar 27, 2023

#166 in Web programming

Download history 2275/week @ 2024-09-22 2656/week @ 2024-09-29 1283/week @ 2024-10-06 1971/week @ 2024-10-13 2707/week @ 2024-10-20 4120/week @ 2024-10-27 3650/week @ 2024-11-03 3069/week @ 2024-11-10 3676/week @ 2024-11-17 4290/week @ 2024-11-24 5127/week @ 2024-12-01 5903/week @ 2024-12-08 5806/week @ 2024-12-15 3619/week @ 2024-12-22 3185/week @ 2024-12-29 5480/week @ 2025-01-05

18,892 downloads per month
Used in 26 crates

Apache-2.0

345KB
7.5K SLoC

Shuttle - Deploy Rust apps with a single Cargo subcommand

Shuttle is a Rust-native cloud development platform that lets you deploy your Rust apps for free.

📖 Check out our documentation to get started quickly: docs.shuttle.dev

🙋‍♂️ If you have any questions, join our Discord server.

Usage

Start by installing the cargo shuttle subcommand by running the following in a terminal:

cargo install cargo-shuttle

Now that Shuttle is installed, you can initialize a project with Axum boilerplate:

shuttle init --template axum my-axum-app

By looking at the Cargo.toml file of the generated my-axum-app project you will see it has been made to be a binary crate with a few dependencies including shuttle-runtime and shuttle-axum.

axum = "0.7.3"
shuttle-axum = "0.51.0"
shuttle-runtime = "0.51.0"
tokio = "1.28.2"

A boilerplate code for your axum project can also be found in src/main.rs:

use axum::{routing::get, Router};

async fn hello_world() -> &'static str {
    "Hello, world!"
}

#[shuttle_runtime::main]
async fn main() -> shuttle_axum::ShuttleAxum {
    let router = Router::new().route("/", get(hello_world));

    Ok(router.into())
}

Check out our docs to see all the frameworks we support, or our examples if you prefer that format.

Running locally

To test your app locally before deploying, use:

shuttle run

You should see your app build and start on the default port 8000. You can test this using;

curl http://localhost:8000/
# Hello, world!

Deploying

Deploy the service with:

shuttle deploy

Your service will then be made available under a subdomain of *.shuttle.app. For example:

curl https://my-axum-app-0000.shuttle.app/
# Hello, world!

Dependencies

~18–32MB
~475K SLoC