Skip to main content

Common Issues

This error means another process is already listening on the proxy port.Solution:
  1. Stop the existing proxy first:
  2. If that doesn’t work, check what’s using the port:
  3. Kill the process manually if needed:
  4. Restart the proxy:
Ports below 1024 require root access.Error message:
Solution:Either run with sudo for privileged ports:
Or use the default non-privileged port (no sudo needed):
This happens when you try to run an app with a name that’s already in use by another running process.Error message:
Solutions:
  1. Stop the existing app first, then start yours
  2. Use a different name for your app
  3. Override the existing route with --force:
Safari relies on the system DNS resolver, which may not handle .localhost subdomains on all configurations.Symptoms:
  • Chrome/Firefox/Edge work fine
  • Safari shows “Safari can’t find the server”
Solution:Add current routes to /etc/hosts (requires sudo):
To auto-sync whenever routes change:
Clean up later:
When using HTTPS, browsers may show certificate warnings if the local CA isn’t trusted.Symptoms:
  • “Your connection is not private” warning
  • NET::ERR_CERT_AUTHORITY_INVALID
Solution:Trust the local CA certificate:
This adds the portless CA to your system trust store. After this, browsers will trust all portless HTTPS certificates.Supported platforms:
  • macOS (no sudo required)
  • Linux (Debian/Ubuntu, Arch, Fedora/RHEL/CentOS, openSUSE)
If portless trust fails, you skipped sudo during first run. Just run it manually as shown above.
This happens when a dev server proxies requests back through portless without rewriting the Host header.Error message:
Common cause: Your frontend dev server (Vite, webpack, etc.) is proxying API requests to another portless app, but isn’t rewriting the Host header.Solution for Vite:
Solution for webpack-dev-server:
If the proxy doesn’t auto-start when you run an app, it may have failed to start in the background.Solutions:
  1. Check if the proxy is already running:
  2. Start the proxy manually to see any errors:
  3. Check the proxy log file:
  4. If the proxy PID file is stale:
Your app is running but not accessible at the portless URL.Troubleshooting steps:
  1. Check if the app registered correctly:
  2. Verify the proxy is running:
  3. Check if your app is listening on the PORT environment variable:
    • Most frameworks (Next.js, Express, Nuxt) respect PORT automatically
    • Vite, Astro, React Router, Angular, Expo, React Native: portless auto-injects --port flag
  4. Try accessing the app directly on its assigned port:
The proxy can’t connect to your app.Error in browser:
Common causes:
  1. App crashed - Check your app’s console output
  2. App not listening on PORT - Some apps ignore the PORT env var
  3. Wrong host - App must listen on 127.0.0.1 or 0.0.0.0 (not a specific IP)
Solutions:
  1. Check if the app is actually running:
  2. For frameworks that ignore PORT, portless auto-injects flags. If this isn’t working:
  3. Check your app’s startup logs for errors
Expected a worktree-based subdomain but got the plain name.Symptoms:
  • In a git worktree on branch feature-auth
  • Expected: http://auth.myapp.localhost:1355
  • Got: http://myapp.localhost:1355
Causes:
  1. Using explicit name instead of run:
    Use run to enable worktree detection:
  2. Main worktree (main/master branch): The main worktree doesn’t get a prefix. Only linked worktrees do.
  3. Not in a git worktree: Worktree detection only works in git worktrees, not regular branches.
Error message:
Why: Running sudo npx portless is unsafe because it performs package resolution and downloads as root.Solution:Install portless globally:
Then use it directly:
Setting PORTLESS=0 should run your command directly without the proxy.Make sure you’re using it correctly:
Accepted values:
  • PORTLESS=0
  • PORTLESS=skip
Any other value will not skip the proxy.
Errors about file permissions, especially after running with sudo.Common error:
Cause: When you start the proxy with sudo (for ports < 1024), the state directory is owned by root.Solution:Portless automatically handles this by using world-writable permissions for the system state directory. If you still see errors:
  1. Stop the proxy:
  2. Fix permissions:
  3. Restart the proxy:
When using HTTPS, portless requires OpenSSL for certificate generation.Error message:
Solution:Install OpenSSL:macOS:
Debian/Ubuntu:
Arch:
Fedora/RHEL/CentOS:

Getting Help

If you’re still having issues:
  1. Check the GitHub issues for similar problems
  2. Run the proxy in foreground mode to see detailed logs:
  3. Check the proxy log file:
  4. Open a new issue with:
    • Your OS and Node.js version
    • The full error message
    • Steps to reproduce

Debug Mode

For troubleshooting, you can run the proxy in foreground mode to see all logs:
This will keep the proxy in the foreground and print all requests and errors to the console.