Run an Actix Web App

Getting an application running on is essentially working out how to package it as a deployable image. Once packaged, it can be deployed to the platform.

In this guide we’ll learn how to deploy an Actix Web application on

Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust

Deploying an Actix Web app on is easy-peasy! With the help of the cargo chef, we get great build times and small images.


First, install flyctl, the CLI, and sign up to if you haven’t already.

The fastest way to get a basic Actix Web server on is to use our actix-web template:

git clone --single-branch --branch actix-web actix-web-app
cd actix-web-app
fly launch --generate-name

Deploy an Actix Web App from scratch

If you don’t already have an existing Axum application, you can create one with cargo:

cargo new actix-web-on-fly
cd actix-web-on-fly

Then we have to add the actix-web dependency to the project:

cargo add actix-web

Now, let’s create a simple app in src/

use actix_web::{get, App, HttpServer, Responder};

async fn hello() -> impl Responder {
    format!("Hello from!")

#[actix_web::main] // or #[tokio::main]
async fn main() -> std::io::Result<()> {
    HttpServer::new(|| {
    .bind(("", 8080))?

This will display a “Hello from!” message when you visit the root URL. Take note that we serve the app on port 8080.

We can confirm everything works fine by running cargo run and checking out http://localhost:8080.

And with that you can deploy the app!

fly launch
Scanning source code
Detected a Actix Web app
Warning: This organization has no payment method, turning off high availability
Creating app in [redacted]/actix-web-on-fly
We're about to launch your app on Here's what you're getting:

Organization: Your Name              (fly launch defaults to the personal org)
Name:         [app-name]             (derived from your directory name)
Region:       Amsterdam, Netherlands (this is the fastest region for you)
App Machines: shared-cpu-1x, 1GB RAM (most apps need about 1GB of RAM)
Postgres:     <none>                 (not requested)
Redis:        <none>                 (not requested)
Sentry:       false                  (not requested)


==> Building image
==> Building image with Docker

Watch your deployment at[app-name]/monitoring

Visit your newly deployed app at https://[app-name]

This will generate a fly.toml file with the configuration for your app and a Dockerfile that uses cargo chef. Refer to the fly.toml docs for more configuration options.

To deploy a new version of your app, simply run fly deploy in the project directory.

You can check out the full (yet minimal) example in this GitHub repository for a reference.