DEV Community

Alex Spinov
Alex Spinov

Posted on

Shuttle Has a Free API: The Rust Cloud Platform That Deploys Your Backend With Zero Infrastructure Config

Deploying Rust web apps usually means Docker, reverse proxies, and cloud configs. Shuttle skips all of that — annotate your Rust code, run one command, and get a deployed backend with a database, secrets, and a URL.

What Is Shuttle?

Shuttle is a cloud platform designed for Rust. It provisions infrastructure from annotations in your code. Need a database? Add a macro. Need secrets? Add an attribute. Shuttle reads your code and deploys everything you need.

The Free Platform

Shuttle offers a free tier:

  • Free plan: 3 projects, shared resources
  • Annotation-driven: Infrastructure from code annotations
  • Built-in databases: PostgreSQL, shared databases
  • Secrets management: Built-in secret store
  • Custom domains: HTTPS included
  • Frameworks: Axum, Actix, Rocket, Poem, Warp, Tide

Quick Start

Install Shuttle:

cargo install cargo-shuttle
cargo shuttle login
Enter fullscreen mode Exit fullscreen mode

Create a project:

cargo shuttle init my-app --template axum
cd my-app
Enter fullscreen mode Exit fullscreen mode

Write your backend:

use axum::{routing::get, Router, Json};
use serde::{Deserialize, Serialize};
use shuttle_runtime::ShuttleAxum;
use shuttle_shared_db::Postgres;
use sqlx::PgPool;

#[derive(Serialize, Deserialize)]
struct Todo {
    id: i32,
    title: String,
    completed: bool,
}

async fn list_todos(pool: axum::Extension<PgPool>) -> Json<Vec<Todo>> {
    let todos = sqlx::query_as!(Todo, "SELECT id, title, completed FROM todos")
        .fetch_all(&*pool)
        .await
        .unwrap();
    Json(todos)
}

#[shuttle_runtime::main]
async fn main(
    #[Postgres] pool: PgPool,  // Database provisioned automatically!
) -> ShuttleAxum {
    sqlx::migrate!().run(&pool).await.unwrap();

    let router = Router::new()
        .route("/todos", get(list_todos))
        .layer(axum::Extension(pool));

    Ok(router.into())
}
Enter fullscreen mode Exit fullscreen mode

Deploy:

cargo shuttle deploy
# Deployed to https://my-app.shuttleapp.rs
Enter fullscreen mode Exit fullscreen mode

Why Developers Choose Shuttle

A developer wanted to build a side project API in Rust. Setting up Docker, a managed database, environment variables, and deployment scripts took longer than writing the actual application. With Shuttle, they added #[Postgres] pool: PgPool to their main function and had a deployed API with a database in 5 minutes.

Who Is This For?

  • Rust developers wanting the easiest path to deployment
  • Backend developers who love Rust but hate DevOps
  • Side project builders wanting free hosting for Rust APIs
  • Teams evaluating Rust for production backend services

Start Deploying Rust

Shuttle removes the infrastructure barrier from Rust development. Write Rust, annotate resources, deploy with one command.

Need help building Rust backends? I build custom backend solutions — reach out to discuss your project.


Found this useful? I publish daily deep-dives into developer tools and APIs. Follow for more.

Top comments (0)