Most people manage WordPress through the dashboard, and that’s fine for everyday tasks. But when you need to update dozens of sites at once, repair a database, search-and-replace across your whole site, or fix a site you can’t even log into, SSH is faster and more powerful than any admin screen. Combined with WP-CLI (WordPress’s command-line tool), SSH lets you manage your site with a few typed commands. This guide explains what SSH is, how to enable it and connect from any operating system, the WP-CLI commands worth knowing, and how to troubleshoot when it won’t connect.
Enable SSH in your hosting panel to get your SSH credentials (separate from your WordPress login). On Mac or Linux, open Terminal and run ssh user@yourserver.com; on Windows, use PuTTY or the built-in OpenSSH client. Once connected, you can run shell commands and WP-CLI to manage WordPress.
What is SSH?
SSH (Secure Shell) is a protocol for securely connecting to a remote server over the internet. Instead of clicking through a graphical interface, you type commands in a terminal, and they run directly on your server — encrypted end to end, so no one can intercept the connection.
For WordPress, SSH is an alternative to the dashboard and to SFTP. You’d reach for it when you want to:
- Run WP-CLI commands to manage WordPress in bulk (updates, plugins, users, database tasks).
- Fix a site you can’t log into — SSH doesn’t depend on the WordPress admin working.
- Move or edit files, run database operations, or transfer data faster than a graphical tool allows.
- Manage many sites efficiently, chaining commands or scripting repetitive tasks.
It’s the tool developers and administrators use when the dashboard is too slow or simply unavailable. You don’t need it for everyday blogging — but when you need it, nothing else is as fast.
What you need before you start
Two things:
- SSH access from your host. Not every plan includes it — many entry-level shared plans disable SSH. You’ll usually enable it (or find your credentials) in your hosting control panel, often under a “SSH Access” or “SSH/Shell” section. If you don’t see it, check with your host.
- Your SSH credentials. These are not your WordPress dashboard login. SSH credentials are the server username, the host (usually your domain or a server address), and either a password or an SSH key. You’ll find or create them in your hosting panel.
SSH connects over port 22 by default. Some hosts use a different port for security — if so, they’ll tell you which one, and you’ll add it to your connection command. If a connection fails, the port is one of the first things to check.
How to connect via SSH
The steps depend on your operating system.
On Mac or Linux (built-in terminal). No software needed — the terminal has SSH built in:
Open Terminal (on Mac: Applications → Utilities → Terminal).
Type the connection command with your username and host:
ssh username@yourserver.comIf your host uses a non-standard port, add it with -p:
ssh username@yourserver.com -p 2222The first time, you’ll be asked to confirm the server’s fingerprint — type yes. Then enter your password (it won’t show as you type — that’s normal). You’re connected.
On Windows. Recent versions of Windows 10 and 11 include the OpenSSH client, so you can use the same ssh command in Command Prompt or PowerShell. Otherwise, use the free PuTTY client:
- Download and install PuTTY.
- Enter your host in the Host Name field and set the Port (22 by default).
- Click Open, accept the fingerprint prompt, and enter your username and password when asked.

Once connected, you’ll see a command prompt ready for input. Type ls to list your files — you should see the WordPress folders (wp-admin, wp-content, wp-includes), confirming you’re in the right place.

SSH keys vs passwords
You can authenticate two ways. A password is simplest to start with. An SSH key (a key pair — a private key on your computer, a public key on the server) is more secure and lets you connect without typing a password each time. For regular use, generating an SSH key is worth it; most hosting panels have an option to add your public key. For a one-off task, a password is fine.
A few essential SSH commands
Once connected, you’re in a Linux shell. A handful of commands cover most navigation:
ls— list files and folders in the current directory.cd foldername— change into a folder (cd wp-content);cd ..goes up one level.pwd— show the current directory path.mv,cp,rm— move, copy, and remove files (usermwith care — it’s permanent).
These are standard shell commands. The real power for WordPress, though, comes from WP-CLI.
WP-CLI: managing WordPress from the command line
WP-CLI is WordPress’s official command-line tool. It lets you do almost anything the dashboard does — and things it can’t — with a single typed command. Many hosts (including managed WordPress plans) come with WP-CLI preinstalled, so once you’re connected via SSH, you can use it straight away. Check with:
wp --infoIf it’s not installed and you have SSH access, you can install it following the official WP-CLI guide. Here are the commands worth knowing:
- Update WordPress core:
wp core update - List plugins:
wp plugin list— shows every plugin, its status, and version.

- Install and activate a plugin:
wp plugin install akismet --activate - Deactivate a plugin:
wp plugin deactivate pluginname— invaluable for fixing a site when a plugin broke the dashboard. - Manage themes:
wp theme list,wp theme activate themename - Manage users:
wp user list,wp user create, or reset a password withwp user update - Repair the database:
wp db repair - Search and replace across the database (great for migrations):
wp search-replace 'olddomain.com' 'newdomain.com'— and if you’re doing this as part of moving host, see our guide on migrating WordPress to a new host.
That last pair — deactivating a plugin and search-replace — are exactly the kind of tasks that are painful or impossible through the dashboard, and trivial with WP-CLI.
If a plugin update takes your site down and you can’t reach wp-admin, SSH is the way back in. Connect, run wp plugin deactivate --all to disable every plugin, and your dashboard should return. Then reactivate them one by one to find the culprit — see our guide to the critical error on this website for the full recovery process.
Troubleshooting SSH connections
If you can’t connect, work through these:
- “Connection refused” or timeout. SSH may not be enabled on your plan, or you’re using the wrong port. Confirm SSH is active in your hosting panel and check whether the host uses a port other than 22.
- “Permission denied.” Usually a wrong username, password, or key. Double-check your credentials in the hosting panel — remember they’re not your WordPress login. If using a key, make sure the public key is added on the server. If you hit this while copying files with SCP, see our guide to fixing the SCP permission denied error.
- Wrong host address. The host is typically your domain or a server hostname your panel specifies — not always just
yourdomain.com. - Your plan doesn’t offer SSH. Many basic shared plans disable it. You may need to upgrade, or ask your host to enable shell access.
- Changes not showing. If you edit files over SSH and don’t see the change, it may be cached — clear your WordPress cache to see the current state.
Commands run over SSH execute immediately and can’t be undone — a wrong rm can delete files permanently. Always back up your site and database before running commands that change files or the database, and double-check each command before pressing Enter.
Copahost includes SSH access and WP-CLI on its hosting, plus cPanel, so you can manage WordPress from the command line or the dashboard — whichever you prefer. Fast LiteSpeed servers, NVMe storage, and free SSL included.
See web hosting plansFrequently asked questions
How do I connect to WordPress via SSH?
Enable SSH in your hosting panel to get your credentials (server username and host, plus a password or SSH key). On Mac or Linux, open Terminal and run ssh username@yourserver.com. On Windows, use PuTTY or the built-in OpenSSH client. Once connected, ls should show your WordPress folders.
Do I need SSH access for WordPress?
Not for everyday use — the dashboard handles normal tasks. SSH becomes valuable when you want to use WP-CLI, manage many sites, run database operations, or fix a site you can’t log into. If those apply to you, choose a hosting plan that includes SSH access.
What’s the difference between SSH and WP-CLI?
SSH is the secure connection to your server; WP-CLI is the WordPress-specific command-line tool you run once connected. SSH gets you a terminal on the server; WP-CLI gives that terminal WordPress commands like updating plugins or repairing the database.
Why won’t my SSH connection work?
The most common causes are SSH not being enabled on your plan, the wrong port (it defaults to 22, but some hosts change it), or incorrect credentials (remember they’re not your WordPress login). Check each in your hosting panel, and confirm your plan includes shell access.
Does WordPress hosting include SSH access?
It depends on the host and plan. Many entry-level shared plans disable SSH, while most quality and managed WordPress hosts include it. If SSH matters to you, confirm it’s available before choosing a plan.
Conclusion
SSH turns WordPress management from a series of dashboard clicks into fast, precise commands — and paired with WP-CLI, it’s the most efficient way to update, troubleshoot, and manage sites, especially more than one. Start by enabling SSH in your hosting panel, connect with your terminal or PuTTY, and try a few safe WP-CLI commands like wp plugin list. Keep the essentials in mind: your SSH credentials aren’t your WordPress login, SSH runs on port 22 by default, and every command executes immediately — so back up before anything that changes files or the database. Once it’s part of your workflow, you’ll wonder how you managed without it.
