What is porter.yaml?
A porter.yaml file (or files, if you choose to set up multiple within your project/repository) defines your application’s services, build configuration, and deployment settings as code. This file is used with the porter apply CLI command to deploy and update applications, enabling version-controlled infrastructure and automated CI/CD pipelines.
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
Define Configuration
Create a
porter.yaml file in your repository that describes your application’s services, resources, and settings.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 porter.yaml
The following is an example of a v2 porter.yaml file, which is the latest version of the spec. This example covers many of the available fields, but not all of them. For a full list of configurable options, see the full reference.
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
- porter apply Command - CLI reference for deployments
- Using Other CI Tools - Integrate with GitHub Actions, GitLab CI, etc.

