Configuration

Portless is configured through environment variables. No config files needed.

Environment variables

VariableDescriptionDefault
PORTLESS_PORTProxy port1355
PORTLESS_HTTPSSet to 1 to always enable HTTPSoff
PORTLESS_STATE_DIROverride the state directorysee below
PORTLESSSet to 0 or skip to bypass the proxyenabled

State directory

Portless stores state (routes, PID file, port file, TLS marker) in a directory that depends on the proxy port:

ConditionPath
Port below 1024 (sudo)/tmp/portless
Port 1024+ (no sudo)~/.portless

Override with PORTLESS_STATE_DIR.

State files

FilePurpose
routes.jsonMaps hostnames to ports
routes.lockPrevents concurrent writes
proxy.pidPID of the running proxy
proxy.portPort the proxy is listening on
proxy.logProxy daemon log output

Port assignment

Apps get a random port in the 4000--4999 range. Portless sets PORT before running your command. Most frameworks respect this automatically.