Skip to main content
Build and deploy your Flash application to Runpod Serverless endpoints in one step. This is the primary command for getting your application running in the cloud.
flash deploy [OPTIONS]

Examples

Build and deploy a Flash app from the current directory (auto-selects environment if only one exists):
flash deploy
Deploy to a specific environment:
flash deploy --env production
Deploy with additional excluded packages:
flash deploy --exclude scipy,pandas
Build and test locally before deploying:
flash deploy --preview

Flags

--env, -e
string
Target environment name (e.g., dev, staging, production). Auto-selected if only one exists. Creates the environment if it doesn’t exist.
--app, -a
string
Flash app name. Auto-detected from the current directory if not specified.
--no-deps
Skip transitive dependencies during pip install. Useful when the base image already includes dependencies.
--exclude
string
Comma-separated packages to exclude (e.g., torch,torchvision). Use this to stay under the 500MB deployment limit.
--output, -o
string
default:"artifact.tar.gz"
Custom archive name for the build artifact.
--preview
Build and launch a local Docker-based preview environment instead of deploying to Runpod.

What happens during deployment

  1. Build phase: Creates the deployment artifact (same as flash build).
  2. Environment resolution: Detects or creates the target environment.
  3. Upload: Sends the artifact to Runpod storage.
  4. Provisioning: Creates or updates Serverless endpoints.
  5. Configuration: Sets up environment variables and service discovery.

Architecture

After deployment, your Flash app runs as independent Serverless endpoints on Runpod:
Each resource configuration in your code creates an independent endpoint. You can call any endpoint directly based on your needs.

Environment management

Automatic creation

If the specified environment doesn’t exist, flash deploy creates it:
# Creates 'staging' if it doesn't exist
flash deploy --env staging

Auto-selection

When you have only one environment, it’s selected automatically:
# Auto-selects the only available environment
flash deploy
When multiple environments exist, you must specify one:
# Required when multiple environments exist
flash deploy --env staging

Default environment

If no environment exists and none is specified, Flash creates a production environment by default.

Post-deployment

After successful deployment, Flash displays all deployed endpoints:
✓ Deployment Complete

Load-balanced endpoints:
  https://abc123xyz.api.runpod.ai  (lb_worker)
    POST   /process
    GET    /health

  Try it:
    curl -X POST https://abc123xyz.api.runpod.ai/process \
        -H "Content-Type: application/json" \
        -H "Authorization: Bearer $RUNPOD_API_KEY" \
        -d '{"input": {}}'

Queue-based endpoints:
  https://api.runpod.ai/v2/def456xyz  (gpu_worker)
  https://api.runpod.ai/v2/ghi789xyz  (cpu_worker)

  Try it:
    curl -X POST https://api.runpod.ai/v2/def456xyz/runsync \
        -H "Content-Type: application/json" \
        -H "Authorization: Bearer $RUNPOD_API_KEY" \
        -d '{"input": {}}'
Each endpoint is independent with its own URL and can be called directly.

Authentication

All deployed endpoints require authentication with your Runpod API key:
export RUNPOD_API_KEY="your_key_here"

curl -X POST https://YOUR_ENDPOINT_URL/path \
    -H "Authorization: Bearer $RUNPOD_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"param": "value"}'

Preview mode

Test locally before deploying:
flash deploy --preview
This builds your project and runs it in Docker containers locally:
  • Each endpoint runs in its own container.
  • All containers communicate via Docker network.
  • Endpoints exposed on local ports for testing.
  • Press Ctrl+C to stop.

Managing deployment size

Runpod Serverless has a 500MB limit. Flash automatically excludes packages that are pre-installed in the base image (torch, torchvision, torchaudio, numpy, triton). If the deployment is still too large, use --exclude to skip additional packages:
flash deploy --exclude scipy,pandas
See flash build - Managing deployment size for more details.

flash run vs flash deploy

See flash run for a detailed comparison of local development vs production deployment.

Troubleshooting

Multiple environments error

Error: Multiple environments found: dev, staging, production
Specify the target environment:
flash deploy --env staging

Deployment size limit

Base image packages are auto-excluded. If the deployment is still too large, use --exclude to skip additional packages:
flash deploy --exclude scipy,pandas

Authentication fails

Ensure your API key is set:
echo $RUNPOD_API_KEY
export RUNPOD_API_KEY="your_key_here"