Configuration
PortZero can be configured with a portzero.toml file in your project root. This is useful for running multiple apps together.
Example configuration
portzero.toml
[proxy]
port = 1337
https = true
[apps.web]
command = "pnpm dev"
cwd = "./apps/web"
auto_restart = true
[apps.api]
command = "pnpm start"
cwd = "./apps/api"
subdomain = "api.myapp"Proxy settings
| Key | Type | Default | Description |
|---|---|---|---|
port | number | 1337 | The port the proxy listens on |
https | boolean | false | Enable HTTPS with auto-generated certificates |
App settings
Each app is defined under [apps.<name>]:
| Key | Type | Default | Description |
|---|---|---|---|
command | string | required | The command to run |
cwd | string | "." | Working directory (relative to config file) |
subdomain | string | app name | Custom subdomain for routing |
auto_restart | boolean | false | Automatically restart on crash |
Usage
# Start all apps defined in portzero.toml
portzero up
# This will start:
# => http://web.localhost:1337
# => http://api.myapp.localhost:1337Environment variables
PortZero automatically sets the PORT environment variable for each app. The port is deterministically assigned based on the app name, so it remains stable across restarts.