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

KeyTypeDefaultDescription
portnumber1337The port the proxy listens on
httpsbooleanfalseEnable HTTPS with auto-generated certificates

App settings

Each app is defined under [apps.<name>]:

KeyTypeDefaultDescription
commandstringrequiredThe command to run
cwdstring"."Working directory (relative to config file)
subdomainstringapp nameCustom subdomain for routing
auto_restartbooleanfalseAutomatically restart on crash

Usage

# Start all apps defined in portzero.toml
portzero up

# This will start:
# => http://web.localhost:1337
# => http://api.myapp.localhost:1337

Environment 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.