Common Issues
Port conflict: 'Port 1355 is already in use'
Port conflict: 'Port 1355 is already in use'
This error means another process is already listening on the proxy port.Solution:
-
Stop the existing proxy first:
-
If that doesn’t work, check what’s using the port:
-
Kill the process manually if needed:
-
Restart the proxy:
Permission denied for port
Permission denied for port
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):
Route conflict: hostname already registered
Route conflict: hostname already registered
This happens when you try to run an app with a name that’s already in use by another running process.Error message:Solutions:
- Stop the existing app first, then start yours
- Use a different name for your app
- Override the existing route with
--force:
Safari can't resolve .localhost subdomains
Safari can't resolve .localhost subdomains
Safari relies on the system DNS resolver, which may not handle To auto-sync whenever routes change:Clean up later:
.localhost subdomains on all configurations.Symptoms:- Chrome/Firefox/Edge work fine
- Safari shows “Safari can’t find the server”
/etc/hosts (requires sudo):Certificate trust issues / Browser warnings
Certificate trust issues / Browser warnings
When using HTTPS, browsers may show certificate warnings if the local CA isn’t trusted.Symptoms:This adds the portless CA to your system trust store. After this, browsers will trust all portless HTTPS certificates.Supported platforms:
- “Your connection is not private” warning
- NET::ERR_CERT_AUTHORITY_INVALID
- macOS (no sudo required)
- Linux (Debian/Ubuntu, Arch, Fedora/RHEL/CentOS, openSUSE)
portless trust fails, you skipped sudo during first run. Just run it manually as shown above.508 Loop Detected error
508 Loop Detected error
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:
Proxy not starting automatically
Proxy not starting automatically
If the proxy doesn’t auto-start when you run an app, it may have failed to start in the background.Solutions:
-
Check if the proxy is already running:
-
Start the proxy manually to see any errors:
-
Check the proxy log file:
-
If the proxy PID file is stale:
App not accessible at expected URL
App not accessible at expected URL
Your app is running but not accessible at the portless URL.Troubleshooting steps:
-
Check if the app registered correctly:
-
Verify the proxy is running:
-
Check if your app is listening on the PORT environment variable:
- Most frameworks (Next.js, Express, Nuxt) respect
PORTautomatically - Vite, Astro, React Router, Angular, Expo, React Native: portless auto-injects
--portflag
- Most frameworks (Next.js, Express, Nuxt) respect
-
Try accessing the app directly on its assigned port:
ECONNREFUSED / Bad Gateway (502)
ECONNREFUSED / Bad Gateway (502)
The proxy can’t connect to your app.Error in browser:Common causes:
- App crashed - Check your app’s console output
- App not listening on PORT - Some apps ignore the PORT env var
- Wrong host - App must listen on
127.0.0.1or0.0.0.0(not a specific IP)
-
Check if the app is actually running:
-
For frameworks that ignore PORT, portless auto-injects flags. If this isn’t working:
- Check your app’s startup logs for errors
Git worktree prefix not working
Git worktree prefix not working
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
-
Using explicit name instead of
run:Userunto enable worktree detection: - Main worktree (main/master branch): The main worktree doesn’t get a prefix. Only linked worktrees do.
- Not in a git worktree: Worktree detection only works in git worktrees, not regular branches.
npx/pnpm dlx blocked error
npx/pnpm dlx blocked error
Error message:Why:
Running Then use it directly:
sudo npx portless is unsafe because it performs package resolution and downloads as root.Solution:Install portless globally:PORTLESS=0 not skipping proxy
PORTLESS=0 not skipping proxy
Setting Accepted values:
PORTLESS=0 should run your command directly without the proxy.Make sure you’re using it correctly:PORTLESS=0PORTLESS=skip
State directory permissions issues
State directory permissions issues
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:
-
Stop the proxy:
-
Fix permissions:
-
Restart the proxy:
OpenSSL not found error
OpenSSL not found error
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:- Check the GitHub issues for similar problems
- Run the proxy in foreground mode to see detailed logs:
- Check the proxy log file:
- Open a new issue with:
- Your OS and Node.js version
- The full error message
- Steps to reproduce