Skip to content

Unlink Command

The fastapi cloud unlink command removes the local FastAPI Cloud configuration from your project directory.

This is useful when you want to disconnect your local project from its cloud deployment, or when you need to start fresh with a new configuration.

Terminal window
fastapi cloud unlink

When successful, you’ll see:

FastAPI Cloud configuration has been unlinked successfully! 🚀

When you run fastapi cloud unlink, the CLI will delete the .fastapicloud directory from your current working directory.

This directory contains:

  • cloud.json - Your app ID and team ID mappings
  • README.md - Information about the configuration
  • .gitignore - Git ignore rules for the config directory
  • Any other files in the configuration directory

All of these will be removed.

After running fastapi cloud unlink:

  • Your local project remains unchanged (source code, dependencies, etc.)
  • The connection to your FastAPI Cloud deployment is removed
  • You can run fastapi deploy to create a new deployment and establish a new link
  • Your existing deployment on FastAPI Cloud remains active and unchanged
  • Environment variables and other cloud configurations are preserved on the cloud

This command is a local operation only. It does not delete or modify your deployment on FastAPI Cloud.

Once unlinked, you cannot restore the .fastapicloud directory. You’ll need to redeploy to recreate it.

The command must be executed from the directory where your FastAPI Cloud configuration exists.

You might want to unlink your project in these scenarios:

  • Switching deployments - When you want to link your local project to a different FastAPI Cloud app
  • Starting fresh - When you need to reconfigure your project’s cloud connection
  • Cleaning up - When removing FastAPI Cloud from your project entirely
  • Troubleshooting - When resolving configuration issues by starting with a clean slate
  • Deleted app - When your app was deleted from the dashboard and you want to deploy as a new app

To reconnect your project to FastAPI Cloud after unlinking, simply deploy your application again:

Terminal window
fastapi deploy

This will create a new .fastapicloud directory and link your project to a deployment. You’ll be able to choose whether to create a new app or link to an existing one.

It’s important to understand the difference:

  • fastapi cloud unlink - Removes the project-specific configuration only. You remain logged in and can deploy other projects.
  • fastapi cloud logout - Removes your authentication credentials system-wide. You’ll need to log in again to deploy any project.

Error: No FastAPI Cloud configuration found

Section titled “Error: No FastAPI Cloud configuration found”

This means there’s no .fastapicloud directory in your current location. Make sure you’re running the command from the correct project directory.

  • fastapi deploy - Deploy your app and create the .fastapicloud configuration
  • fastapi cloud whoami - Check your current authentication status
  • fastapi cloud logout - Log out from FastAPI Cloud (removes global authentication)