Skip to content

Deploy Command

The fastapi deploy command deploys your FastAPI application to FastAPI Cloud. 🚀

This is the main command you’ll use to get your application running in the cloud.

Terminal window
fastapi deploy [PATH]

Arguments:

  • [PATH] - Optional. A path to the folder containing the app you want to deploy. If not provided, it will deploy the current directory.

Options:

  • --no-wait - Skip waiting for deployment status and return immediately after upload
  • --app-id - Application ID to deploy to, useful for CI/CD or deploying without a local .fastapicloud configuration. Can also be set via the FASTAPI_CLOUD_APP_ID environment variable.

When you run fastapi deploy, the CLI will:

  • Package and upload your application code to FastAPI Cloud
  • Your app is installed and built in the cloud
  • Your app is deployed with zero downtime
  • The deployment is verified

You can read more about how this works in the How It Works documentation.

The first time you run fastapi deploy, if you’re not logged in yet, the CLI will prompt you with the following options:

  • Login to my existing account: Starts the login flow directly (opens your browser to authenticate)
  • Join the waiting list: If you don’t have an account yet, you can join the waiting list

After logging in, the CLI will help you set up your deployment:

  • Select or create a team
  • Choose to create a new app or link to an existing one

After your first deployment, a .fastapicloud directory will be created in your project. This will contain your app configuration and link your local project to the cloud deployment.

Once you’ve deployed your app for the first time, the subsequent deployments are simple.

Just run fastapi deploy again from the same directory.

The CLI will:

  • Use the existing configuration in .fastapicloud
  • Package and upload your updated code

Then, the cloud will handle the rest.

By default, the command respects .gitignore files when packaging your application.

You can customize what gets uploaded with a .fastapicloudignore file. Read more in the Ignore or Un-ignore Files documentation.

If you see this error during deployment:

App not found. Make sure you're logged in the correct account.

This usually means:

  • You’re logged in with a different account than the one that created the app
  • The app was deleted from the dashboard

If you deleted the app, you can run fastapi unlink to remove the local configuration and deploy as a new app. You can read more in the Unlink Command documentation.

  • fastapi login - Log in to FastAPI Cloud
  • fastapi cloud unlink - Remove the local .fastapicloud configuration
  • fastapi cloud env set - Set environment variables for your app