.bashrc, .zshrc, etc.) or exported in your terminal session.
Proxy Configuration
Override the default proxy port. The proxy will listen on this port instead of the default 1355.Ports below 1024 require sudo to bind. Portless automatically selects the appropriate state directory based on the port number:
- Ports < 1024: Uses
/tmp/portless(system-wide, shared between root and non-root processes) - Ports >= 1024: Uses
~/.portless(user-specific)
Enable HTTPS/HTTP2 mode by default. Set to You can override this with the
1 or true to always start the proxy with TLS enabled.When enabled, Portless generates a local Certificate Authority (CA) and uses it to issue certificates for your .localhost domains. The CA is automatically added to your system trust store on first use.--no-tls flag when starting the proxy.Override the state directory location. By default, Portless automatically selects the state directory based on the proxy port:See State Directory for more details on state directory structure and behavior.
- Ports < 1024:
/tmp/portless - Ports >= 1024:
~/.portless
Application Configuration
Use a fixed port for your application instead of automatically assigning one from the 4000-4999 range.Equivalent to the
--app-port CLI flag. Useful when your application has specific port requirements or when you need to configure another service to connect to a known port.Automatically sync See Safari DNS Issues for more details.
/etc/hosts whenever routes change. Set to 1 to enable.This is useful for Safari, which relies on the system DNS resolver and may not resolve .localhost subdomains automatically. When enabled, Portless adds entries to /etc/hosts for each registered route.Important: The proxy must be started with sudo for this to work, as modifying /etc/hosts requires root permissions.Skip Portless entirely and run commands directly. Set to
0 or skip to bypass the proxy.This is useful when you temporarily need to run your application without Portless, or when debugging connection issues.Child Process Environment
When Portless runs your application, it sets the following environment variables in the child process:The port your application should listen on. This is either an automatically assigned port from the 4000-4999 range, or the value of
PORTLESS_APP_PORT if set.Most web frameworks respect this variable. For frameworks that don’t (Vite, Astro, React Router, Angular, Expo, React Native), Portless automatically injects --port and --host flags.The host your application should bind to. Always set to
127.0.0.1 to ensure the proxy can connect to your app.This prevents frameworks from binding to IPv6 ::1 instead of IPv4, which would make them unreachable by the proxy.The public URL of your application (e.g.,
http://myapp.localhost:1355 or https://myapp.localhost:1355).Use this when your application needs to construct URLs pointing to itself, such as for OAuth callbacks or webhooks.Internal variable set for Vite to allow
.localhost subdomains. This prevents Vite from blocking requests from the proxy.Examples
Development Environment Setup
~/.zshrc or ~/.bashrc
Team-Shared Configuration
.envrc (with direnv)