Get Moshi
Back to Learn

Terminal on iPhone: What You Can Actually Run

iOS has no built-in Terminal. What a local shell (a-Shell, iSH) can and can't do, when a remote SSH/Mosh terminal is the real answer, and how to choose.

Terminal on iPhone: What You Can Actually Run

Terminal on iPhone: What You Can Actually Run

iOS has no built-in Terminal. Here is what a shell on your phone can genuinely do, what it cannot, and which of the two real options fits the work you have in mind.


TL;DR: There is no Apple Terminal app on iPhone, and no app gets a shell over iOS itself. You have two workable routes. A local shella-Shell or iSH — runs Unix commands inside its own sandbox: real scripting, Python, git, even local servers, but bounded by what iOS lets any app do. A remote terminal — an SSH or Mosh client connected to a Mac, Linux box, VPS, or WSL host you control — gives you a full shell on that machine, because the shell is not running on the phone at all. Most people asking this question want the second one, but the first is more capable than its reputation.

Disclosure: we make Moshi, one of the remote terminal apps mentioned below. We've tried to describe the alternatives as their own users would.


Why there is no Terminal.app on iPhone

macOS ships Terminal because macOS lets you run arbitrary programs against the whole filesystem. iOS is built on a different assumption: apps run in sandboxes and cannot freely inspect or modify the system or other apps' private data.

Two constraints follow, and they explain most of what's below:

  • Sandboxing. An app works inside its own container. It can reach outside only through system-mediated paths you approve — the Files app, a share sheet, a user-selected folder, Photos or Contacts via permission prompts. What it cannot do is roam the filesystem or inspect other apps the way a desktop shell can. There is no system /usr/bin to drive and no way to ps the rest of your phone.
  • App Store Review Guideline 2.5.2, which requires apps to be self-contained and not download, install, or execute code that introduces or changes features or functionality — with a carve-out for code used in an educational context. Shell apps clearly sit near the boundary of that rule, and in 2020 both iSH and a-Shell were told they'd be removed before Apple backed off. They ship today, but it's a reminder that this category exists at Apple's discretion.

Both apps remain on the App Store. a-Shell ships updates regularly; iSH's shipping App Store build changes rarely, though development continues in the open.

Apple has not shipped a Terminal for iPhone or iPad, and did not announce one at WWDC 2026. Plan around its absence rather than waiting for it.

The two real options

Local shell (a-Shell, iSH)Remote terminal (SSH/Mosh client)
Where the shell runsOn the phone, in the app's sandboxOn a machine you control
Reach outside the appSystem-mediated: Files, share sheet, folder bookmarks, ShortcutsWhatever your account on that host can do
Install packagesa-Shell bundles a set; iSH adds Alpine apkWhatever the host allows
ToolchainsPython, git, C/C++ → WebAssembly, TeXAnything the host runs
DockerNoYes, if the host has it
Long-running servicesForeground only — iOS suspends the appYes, they run on the host
Works offlineYesNo, needs a connection
CostFreeFree clients exist; you need a host

They are not really competitors. A local shell is a self-contained Unix environment on the phone. A remote terminal is a window onto another computer.

Local shells: more capable than their reputation

a-Shell bundles a set of Unix commands plus Python, Lua, and a TeX distribution, compiled to run natively inside the app. It installs pure-Python packages with pip, and precompiled WebAssembly ones through its own pkg. It also does the iOS-native things well: Shortcuts integration, and folder bookmarks that let it keep working against a directory you've picked. iSH takes a different route — user-mode x86 emulation with syscall translation, running an Alpine userspace — so apk add works and you get a recognizable Linux package ecosystem.

Both are free and open source. Genuinely good uses:

  • Scripting and text surgery (sed, awk, jq) over files you've shared in
  • Python work, including many packages, without carrying a laptop
  • Local git operations
  • Running a local server in the foreground for testing
  • Learning Unix fundamentals

The real limits: no Docker, no general-purpose background daemons (iOS suspends the app when you leave it), and iSH's emulation makes anything compute-heavy slow — fine for a script, painful for a build. Access to things like Photos goes through the system's permission prompts rather than a filesystem path.

So a local shell is not a full Linux box in your pocket. But if your work is scripting, text, or learning, it may be all you need — and it costs nothing to find out.

Remote terminals: what most people are picturing

The other route sidesteps the sandbox by not running the shell on the phone at all. The phone becomes a screen and a keyboard for another machine — a Mac at home, a Linux desktop, a $5 VPS, a WSL host at the office.

Once connected, you are on that machine, as yourself, with your tools, repos, and credentials. docker compose up, git rebase -i, tail -f a production log, restart a service, run the test suite. Your reach is whatever that account is allowed to do — host policy, containers, and network rules still apply — but that is an ordinary shell's worth of power rather than an app sandbox's.

This is also the route that runs a coding agent. Claude Code, Codex, and similar CLI agents run on the host; the phone drives them.

The two things that decide whether it's pleasant

Connecting is easy. Staying connected on a phone is the hard part, and it comes down to two choices.

1. Mosh instead of plain SSH

SSH runs over TCP, and a TCP connection is bound to your IP address. Change networks — Wi-Fi to cellular, one Wi-Fi to another — and that connection is broken. Backgrounding the app doesn't necessarily kill the socket outright, but iOS suspends the app's networking, and long enough in your pocket will see the connection time out at one end or at a NAT in between. The practical experience is coming back to a session that's frozen or gone.

Mosh was designed for this. It runs over UDP and syncs terminal state rather than a byte stream, so it re-establishes after IP changes, sleep, and long gaps without a reconnect dance.

The tradeoffs are worth knowing before you commit: Mosh needs mosh-server installed on the host, uses SSH only to bootstrap, and then wants UDP (typically ports 60000–61000) open. Some corporate networks and VPNs block exactly that, in which case you're back to SSH. Where UDP works, Mosh is the single biggest quality-of-life difference on a phone.

2. A multiplexer on the host

Mosh already keeps your shell and its foreground job running on the host while you're disconnected — that part is not tmux's job. What tmux (or Zellij, or Herdr) adds is independence from any particular session: when the Mosh session itself ends, or you want to pick the work up from your laptop instead, the panes are still there to reattach to. Neither one saves a process that exits on its own.

The combination is what makes phone terminal work durable: the work lives in tmux on the host, Mosh reconnects your view to it, and nothing cares that your phone was in your pocket for two hours.

# on the host, once
tmux new -s work

# from the phone, any time after
mosh you@host -- tmux attach -t work

So what can you actually do from an iPhone?

With a remote terminal, honestly: most things. The real constraints stop being technical and start being ergonomic.

Works well on a phone

  • Checking on long-running jobs, builds, and deploys
  • Reading logs and triaging an alert
  • git status / git log / committing and pushing
  • Restarting services, running one-off commands
  • Driving a coding agent and approving its steps
  • Quick edits to a config file

Works badly on a phone, whatever app you use

  • Sustained writing of new code — the on-screen keyboard is the ceiling, not the terminal
  • Anything needing several panes visible at once
  • Careful visual diff review in raw git diff output

The honest framing: a phone terminal is superb for supervising and steering work, and poor for authoring it. Apps differ mainly in how well they soften the ergonomic problems — key rows and modifier handling, voice input, native diff rendering, push when something needs you.

Where to go next

You've now made the only decision that matters — local sandbox or remote shell. Picking the specific app is a separate question, and we've written it up properly rather than compressing it here:

  • Local: a-Shell and iSH are the two leading options, both free — install whichever matches the description above; they coexist happily. Some remote clients, Blink Shell among them, also ship a local shell alongside their SSH side.
  • Remote: the established clients are Blink Shell, Termius, Prompt, and our own Moshi, and they differ enough that the choice is worth a few minutes. Best iOS Terminal App compares them head to head, and Best iPad Terminal App covers the larger-screen tradeoffs.

If you already know you want the remote route for driving coding agents, Moshi is our take on it — native Mosh, multiplexer-aware, push when an agent needs a decision — and it's free to start.

FAQ

Does the iPhone have a built-in terminal?

No. Apple does not ship a Terminal app for iOS or iPadOS, and has not announced one. You need a third-party app: either a local sandboxed shell (a-Shell, iSH) or an SSH/Mosh client connected to another machine.

Can I run Linux commands on my iPhone?

Yes. iSH runs an Alpine userspace under x86 emulation and supports apk packages; a-Shell bundles a large set of Unix tools plus Python. Both work inside their own sandbox — they reach your files through system-mediated paths rather than roaming the filesystem — and iSH's emulation makes anything compute-heavy slow.

Can I run Docker on an iPhone?

Not locally — iOS provides no container runtime, and no way for an app to keep a daemon running in the background. You can run Docker on a remote host and drive it from the phone over SSH or Mosh, which is what most people mean when they ask.

Do I need to jailbreak to get a real terminal?

No. A remote terminal to a machine you control gives you a full shell on that machine without touching your phone's security model, and for development work that's usually both safer and more practical. The one thing it genuinely can't do is inspect or modify iOS itself — if that's your actual goal, a remote shell is not a substitute.

What's the difference between SSH and Mosh on a phone?

SSH runs over TCP, so changing networks breaks the connection and long backgrounding tends to end it. Mosh runs over UDP and syncs terminal state, so it recovers from network switches, sleep, and dead zones — provided the host runs mosh-server and UDP isn't blocked. See Mosh vs SSH for the full comparison.

Is there a free way to get a terminal on iPhone?

Yes. a-Shell and iSH are free and open source for local use. For remote work, several clients — Moshi and Termius among them — have free tiers covering basic connections, while others such as Prompt are paid outright. What you still need either way is access to a host, though for many people that's a computer they already own.


Related Articles