Skip to content

Use Mosh on iPhone with NeoServer: Setup, UDP Ports and tmux

Configure NeoServer for a roaming Mosh terminal: install mosh-server, allow UDP traffic, choose Mosh in the server profile, and keep long tasks in tmux.

1 min read

SSH is reliable on a stable network, but a mobile connection may change IP addresses or briefly disappear. Mosh is designed for a roaming terminal: it uses SSH to start a remote mosh-server, then exchanges terminal updates over UDP. NeoServer supports this as a terminal connection type.

Prepare the server and app

  1. Install mosh-server on the remote host and confirm the SSH account can run it. This is a server-side requirement, unlike NeoServer’s ordinary SSH monitoring.
  2. Allow the UDP port or range used by Mosh through the server firewall and network path. The common default range is 60000–61000/UDP; your own configuration may differ.
  3. In NeoServer, add or edit the server, select Mosh as the terminal connection type, and save. The optional UDP Port field accepts a port or range; leave it empty to let mosh-server choose. A custom Mosh Server command overrides the UDP Port field.
  4. Connect and test a Wi-Fi-to-cellular switch. If SSH works but Mosh does not, check whether UDP reaches the host and whether mosh-server starts successfully.

Mosh helps a terminal recover after a brief network interruption, but it cannot override iOS background limits or keep a process alive after the server itself stops. Run long jobs inside tmux or zellij on the server and reattach if the app or session closes. SSH agent forwarding in NeoServer applies to an SSH terminal session, not its Mosh terminal type.

If startup fails, check the account’s ability to run mosh-server, firewall rules, and any custom command. A server behind a VPN must also be reachable over the chosen UDP port. For ordinary SSH setup, see the NeoServer user guide.

Ready to try it?

NeoServer · SSH, Mosh, Docker & SFTP client for iPhone, iPad and Mac

Free on the App Store