How to SSH into Home Assistant
There are two layers to "SSH into Home Assistant," and mixing them up is the usual source of confusion. On Home Assistant OS, you don't SSH into the host directly — you install an SSH add-on that drops you into the Home Assistant environment, where you can edit configs and run ha commands. On Container/Core/Supervised installs, you SSH into the underlying Linux host as normal. This guide covers both, and how to do it from your phone.
Home Assistant OS — use the SSH add-on
- In Home Assistant, go to Settings → Add-ons → Add-on Store.
- Install "Terminal & SSH" (official) or "Advanced SSH & Web Terminal" (community, more flexible).
- Open the add-on's Configuration tab and set a password or, better, add your SSH public key under
authorized_keys. - Set the port (default
22for the advanced add-on; the official one uses the web terminal plus optional SSH) and Start the add-on.
Now connect from any SSH client to your HA box's IP on that port, username root (advanced add-on) — you land in the Home Assistant shell with the /config folder right there.
Container / Core / Supervised — SSH to the host
If you run Home Assistant in Docker or as a Core install on your own Linux box, there's no add-on layer: just SSH into that host the normal way (host IP, port 22, your user), then work with the container or the config directory directly.
Doing it from your phone
This is where it gets handy — fix your smart home from the couch or while you're out. Install an SSH client (iPhone options / Android options), add a connection to your HA IP and port, and connect.
Useful Home Assistant SSH commands
ha core check— validate your configuration before restartingha core restart— restart Home Assistantha core logs— tail the logs to debug an issuenano /config/configuration.yaml— edit your main configha su update/ha core update— update the supervisor / core
If you don't remember the exact ha subcommand, describe what you want to TermAI's assistant and it'll suggest it — useful when you're debugging from a phone.
When you tail the logs with ha core logs -f (or journalctl -f on a Container host) to watch an automation fire, TermAI switches into a log-stream mode: a toolbar lets you pause the flow, filter the last 500 lines with errors and warnings colour-coded, and hand the last 100 lines to the AI for a quick "why did this automation fail?". A lot less painful than watching HA logs scroll past on a phone.
SSH into Home Assistant from outside your network
Don't forward the SSH port to the internet to reach HA while away — that exposes your smart-home hub. Install Tailscale (there's a Home Assistant add-on for it) on your HA box and your phone, or use TermAI's built-in Tailscale, and you can SSH to Home Assistant by its private address from anywhere. See Tailscale on iPhone.
FAQ
Why can't I SSH directly into Home Assistant OS?
HA OS is a locked-down appliance; the host shell isn't meant for daily use. The SSH add-on gives you a supported shell into the Home Assistant environment instead.
What username do I use?
With the Advanced SSH & Web Terminal add-on it's root. On a Container/Core host, it's your normal Linux user.
How do I SSH into Home Assistant remotely?
Use Tailscale (there's an HA add-on) rather than port forwarding, then connect to HA's private address.
Quick Facts
- HA OS: install the Terminal & SSH or Advanced SSH add-on — don't SSH the host directly
- Container/Core: SSH into the underlying Linux host normally
- Key commands:
ha core check,ha core restart,ha core logs - From a phone: any SSH client; TermAI adds AI help for
hacommands - Remote access: Tailscale, not port forwarding
Free on iOS and Android. 5 AI requests/day on the free tier, plus unlimited SSH/SFTP and built-in Tailscale.