What is porter.yaml?
porter.yaml is a configuration file that defines how your application should be built and deployed on Porter. It serves as a single source of truth for your application’s infrastructure, enabling version-controlled, repeatable deployments.
Think of
porter.yaml like a Dockerfile for your entire application stack - it declares your services, their resources, environment variables, and deployment settings in one place.When to Use Configuration-as-Code
CI/CD Pipelines
Deploy your application automatically on every push usingporter apply:
Version-Controlled Infrastructure
Track infrastructure changes alongside your code. Every deployment configuration change goes through code review.Preview Environments
Spin up isolated environments for pull requests with consistent configuration:How It Works
1
Define Configuration
Create a
porter.yaml file in your repository that describes your application’s services, resources, and settings.2
Run porter apply
The Porter CLI reads your configuration and sends it to the Porter API.
3
Build (if configured)
If a
build section is defined, Porter builds and pushes your container image.4
Deploy
Porter deploys or updates your services according to the configuration.
Getting Started
1. Export Existing Configuration
If you already have an app deployed on Porter, export its current configuration:2. Create from Scratch
Start with a minimal configuration:3. Deploy
Apply the configuration to deploy your app:Example Configuration
This example demonstrates common configuration patterns:Configuration vs Dashboard
For consistent deployments, we recommend:- Use
porter.yamlas the source of truth for production - Use the dashboard for experimentation and one-off changes
- Export dashboard changes with
porter app yamlto update your configuration file
Next Steps
- Full Reference - Complete documentation of all configuration options
- Service Configuration - Detailed service type documentation
- porter apply Command - CLI reference for deployments
- Using Other CI Tools - Integrate with GitHub Actions, GitLab CI, etc.

