Getting Started
Prerequisites
Install
bash
brew install steveclarke/tap/outportSee Installation for other methods.
Create Your Config
Run outport init in your project directory:
bash
cd myapp
outport initThis creates .outport.yml. Edit it to declare your services:
yaml
name: myapp
services:
web:
env_var: PORT
protocol: http
hostname: myapp
postgres:
env_var: DB_PORT
redis:
env_var: REDIS_PORTEach service needs at least an env_var — the environment variable that will hold the allocated port.
Apply
bash
outport applyOutput:
myapp [main]
web PORT → 24920 http://myapp.test
postgres DB_PORT → 21536
redis REDIS_PORT → 29454Outport allocates deterministic ports for each service and writes them to .env:
bash
# .env
# --- begin outport.dev ---
PORT=24920
DB_PORT=21536
REDIS_PORT=29454
# --- end outport.dev ---Run outport apply again — you'll get the same ports every time. It's idempotent.
Enable .test Domains (Optional)
For friendly hostnames like myapp.test instead of localhost:24920:
bash
outport setupThis installs a local DNS server and reverse proxy (requires sudo for the DNS resolver file). Services with protocol: http and hostname become accessible at their .test URL.
Manage the daemon:
bash
outport up # Start the daemon
outport down # Stop the daemon
outport teardown # Remove everythingWhat Just Happened
When you run outport apply:
- Config loaded —
.outport.ymlis read from the current directory (or nearest parent). - Instance resolved — The first checkout of a project is "main". Additional checkouts (worktrees, clones) get auto-generated codes like "bxcf".
- Ports allocated — Each service gets a deterministic port via FNV-32a hash on
"{project}/{instance}/{service}". Range: 10000–39999. - Registry updated — Allocations are saved to
~/.config/outport/registry.json. - .env written — Ports are written inside a fenced block (
# --- begin/end outport.dev ---). Your existing.envcontent is preserved.
Next Steps
- Configuration Reference — full
.outport.ymlschema - Commands Reference — all CLI commands