How to Set Up SSH Access to Your WordPress Hosting

If you have ever needed to run a WordPress command, unzip a large backup, or fix a plugin that broke the site editor, you already know how limited FTP feels. It moves files one at a time and gives you no way to actually run anything on the server. SSH solves that problem by giving you a proper command-line connection to your hosting account.

In most sites I build, SSH is the first thing I set up once hosting is live, well before I install a single plugin. It turns tasks that would take twenty minutes of clicking through a file manager into a single line typed into a terminal. This guide covers how to enable SSH on your hosting account, connect to it safely, and use it for the kind of everyday WordPress maintenance that makes the extra setup worthwhile.

Quick Answer

Enable SSH in your hosting control panel, generate an SSH key pair, add the public key to your hosting account, then connect using an SSH client with a command like ssh username@yourserver.com. Most managed hosts enable this in a few clicks; a handful require a support ticket to turn it on.

Why This Matters

SSH access changes how you work with a WordPress site day to day. Instead of downloading a plugin folder, editing it locally, and re-uploading it through FTP, you can edit directly on the server or run a single command to fix file permissions across an entire directory. Large tasks that would time out in a browser, like extracting a multi-gigabyte backup archive, finish in seconds from the command line.

It also opens the door to WP-CLI, the official WordPress command-line tool. With WP-CLI over SSH you can update plugins, search and replace text across the database, or reset a locked-out admin password, all without touching wp-admin. For anyone managing more than one WordPress site, this is where most of the real time savings come from.

There is also a troubleshooting angle. If a plugin update leaves the site showing a blank white screen, you often cannot get back into wp-admin to fix it. Over SSH, you can rename the plugin’s folder directly on the server, which instantly deactivates it and brings the site back, without ever needing dashboard access.

Step-by-Step Instructions

1. Check If SSH Is Available on Your Hosting Plan

Not every hosting plan includes SSH by default. Basic shared hosting sometimes disables it entirely, while mid-tier and managed plans usually include it as a toggle in the control panel. Log into your hosting control panel and look for a section called SSH Access, Terminal, or Remote Access. If you cannot find it, check your host’s plan comparison page or contact support directly.

2. Generate an SSH Key Pair

SSH keys are far more secure than a password alone, and most hosts recommend or require them. On Mac, Linux, or Windows 10 and later, open a terminal and run:

ssh-keygen -t ed25519 -C "your-email@example.com"

Press enter to accept the default file location, then set a passphrase when prompted. This creates two files: a private key that stays on your computer and a public key ending in .pub that you will upload to your host.

3. Add the Public Key to Your Hosting Account

In your hosting control panel’s SSH section, there is usually a field to paste your public key or a button to manage authorised keys. Open the .pub file in a text editor, copy the entire contents, and paste it in. Some hosts generate the key pair for you instead and let you download the private key directly, which works just as well.

4. Connect With an SSH Client

Your host’s SSH panel will show connection details: a hostname, port number (often 22, sometimes a custom port), and username. From a terminal, connect with:

ssh username@yourserver.com -p 22

If you prefer a graphical tool, PuTTY on Windows or Termius on any platform both work well and save your connection details for next time. The OpenSSH manual pages are a good reference if you want to understand exactly what each connection option does.

5. Test the Connection With a Basic Command

Once connected, navigate to your WordPress root folder and run ls -la to list the files. Seeing wp-config.php and the usual WordPress folders confirms you are in the right place and that SSH is working correctly.

Practical Tips

  • Install WP-CLI once you have SSH working. A command like wp plugin update --all updates every plugin on a site in seconds, which is especially useful after setting up scheduled maintenance tasks.
  • Save your connection details in your SSH client rather than retyping the hostname and username every time.
  • Use a passphrase-protected key and an SSH agent so you are not typing your passphrase on every connection.
  • If a command feels unfamiliar, run it with a smaller, low-risk file first rather than testing it directly on your live wp-content folder.
  • Keep a plain-text note of your host’s SSH port and hostname somewhere safe. Some hosts use a non-standard port, and forgetting it is a common reason people give up on SSH after the first setup.

Common Mistakes

  • Sharing a private key file. The private key should never leave your computer or be sent by email; only the public key gets shared with your host.
  • Running destructive commands without a backup. SSH gives you the power to delete or overwrite files instantly, so always confirm you have a recent backup before running anything unfamiliar.
  • Leaving SSH enabled with a weak password when key-based login was available. If your host supports keys, disable password authentication entirely once your key is working.
  • Connecting to the wrong directory. Some hosting accounts drop you into a home folder above the actual WordPress install, so always confirm your location with pwd before making changes.

When to Use This vs Alternatives

SSH is worth setting up if you manage more than one site, run WP-CLI, or regularly handle large files that make FTP painful. If you only ever touch a site through the WordPress dashboard and never need to work with raw files, the extra setup may not be worth your time, and FTP or your host’s file manager will cover the basics fine. For anyone following the step-by-step guide to building a WordPress website from the ground up, SSH is worth adding once the core site is live and stable, not on day one.

Conclusion

SSH takes a few minutes to set up and pays for itself the first time you need to fix something quickly on a live site. Generate a key pair, add it to your host, and get comfortable with a handful of basic commands before you need them in an emergency.