Why Port Forwarding?
Browsers require either HTTPS orlocalhost to access the microphone. Even if your remote server is accessible at http://remote-server:3000, your browser won’t allow microphone access over plain HTTP.
Port forwarding makes the remote server appear as
localhost to your browser, which allows microphone access without HTTPS.Port Forwarding Setup
The approach differs slightly between Docker Compose and Dockerless deployments.For Docker Compose
Docker Compose runs everything through Traefik on port 80.Start SSH Tunnel
Forward port 80 from the remote server to a local port (e.g., 3333):Command breakdown:
-N: Don’t execute a remote command (just forward ports)-L 3333:localhost:80: Forward local port 3333 to remote port 80unmute-box: Your remote server hostname or IP
If successful, this command produces no output and keeps running. Don’t close the terminal.
Docker Compose Architecture with Port Forwarding
For Dockerless
Dockerless deployment uses separate ports for frontend (3000) and backend (8000).Start SSH Tunnel with Multiple Ports
Forward both ports in a single SSH command:This forwards:
- Local port 3000 → Remote frontend (port 3000)
- Local port 8000 → Remote backend (port 8000)
Dockerless Architecture with Port Forwarding
Advanced Configurations
Using a Different Local Port
If port 3333 (or 3000/8000) is already in use locally, choose different ports:SSH Config for Easier Access
Create an SSH config file at~/.ssh/config:
~/.ssh/config
Background Port Forwarding
Run SSH tunnel in the background:-f flag moves SSH to the background after authentication.
To stop the background tunnel:
Using SSH Keys
Avoid entering passwords by setting up SSH keys:Autossh for Persistent Tunnels
For tunnels that automatically reconnect, useautossh:
Firewall Considerations
Remote Server Firewall
SSH port forwarding works through the SSH connection, so you only need:- Port 22 (or your SSH port) open on the remote server
Local Firewall
No special configuration needed - you’re accessing localhost.Troubleshooting
Connection Refused
Issue:ssh: connect to host unmute-box port 22: Connection refused
Solutions:
- Verify the hostname/IP is correct
- Check if SSH is running on the remote server:
sudo systemctl status ssh - Ensure firewall allows SSH:
sudo ufw allow 22
Port Already in Use
Issue:bind [127.0.0.1]:3333: Address already in use
Solutions:
- Use a different local port:
-L 3334:localhost:80 - Find what’s using the port:
lsof -i :3333 - Kill the process using the port
Tunnel Works but Browser Shows Error
Issue: Tunnel is active butlocalhost:3333 doesn’t load
Solutions:
- Verify Unmute is running on the remote server
- Check you’re using the correct port (80 for Docker Compose, 3000 for Dockerless)
- Test the tunnel:
curl http://localhost:3333
Microphone Permission Denied
Issue: Browser denies microphone access even with port forwarding Solutions:- Ensure you’re accessing
localhost, not the server’s IP - Check browser permissions: Settings → Privacy → Microphone
- Try a different browser (Chrome/Firefox/Edge)
SSH Tunnel Drops Frequently
Solutions:- Use
autosshfor automatic reconnection - Configure
ServerAliveIntervalin SSH config:
Alternative: Direct HTTPS Access
If you prefer not to use SSH tunneling, set up HTTPS on your remote server:- For production, use Docker Swarm which includes Let’s Encrypt
- For custom setups, see HTTPS configuration
Performance Considerations
Latency
SSH tunneling adds minimal latency (typically less than 10ms on good networks). The main latency comes from:- Network distance between you and the server
- Server GPU processing time
- Internet connection quality
Bandwidth
Unmute streams audio bidirectionally:- Upstream: User audio (~16-32 kbps)
- Downstream: TTS audio (~32-64 kbps)
Compression
Enable SSH compression for better performance over slow connections:-C flag enables compression.
Security Considerations
Restricting Port Forwarding
If you’re sharing SSH access, you can disable port forwarding in/etc/ssh/sshd_config:
Next Steps
- Set up HTTPS for production deployments without SSH tunneling
- Learn about Docker Compose deployment options
- Explore Docker Swarm for automatic HTTPS and scaling