Application Directory
By default, FastAPI Cloud expects your application at the root of your repository. But if your FastAPI app lives in a subdirectory, you can configure an application directory to tell FastAPI Cloud where to find it.
This is useful for monorepos, uv workspaces, and projects where the application code is nested inside the repository.
Setting the Application Directory
Section titled “Setting the Application Directory”Using the Dashboard
Section titled “Using the Dashboard”- Navigate to your App in the dashboard
- Click Settings in the sidebar
- In the Application Directory section, enter the relative path to your app directory (e.g.,
backendorpackages/api) - Click Update
To reset back to the repository root, clear the field and click Update.
Path Rules
Section titled “Path Rules”The directory must be a simple relative path. Here are the rules:
- Relative paths only — absolute paths like
/app/backendare not allowed - No path traversal — paths containing
..are rejected - Allowed characters — letters, numbers, spaces,
/,.,_,-
Valid Examples
Section titled “Valid Examples”| Path | Description |
|---|---|
backend | Single directory |
packages/api | Nested directory |
apps/web/python | Deeper nesting |
my-app | Hyphens are fine |
my_app | Underscores are fine |
How It Affects Builds
Section titled “How It Affects Builds”When you set an application directory, FastAPI Cloud uses it during the build process:
- Dependencies are installed from the specified directory.
- Your app runs from that directory so relative imports and file paths resolve correctly.
Monorepo and Workspace Support
Section titled “Monorepo and Workspace Support”The application directory works with uv workspaces. If you have a uv.lock file at the root of your repository and your app is in a subdirectory, FastAPI Cloud will:
- Resolve dependencies using the root
uv.lock - Install dependencies for the workspace member in your app directory
- Install any workspace members your app depends on