How to Set Up SSH Access to WP Engine on a Mac

If you manage a WordPress site hosted on WP Engine, SSH access gives you another way to work with the site directly from your Mac’s Terminal. Once SSH is set up, you can use tools such as WP-CLI, move files around, and work with your WordPress installation without relying entirely on the WP Engine dashboard.

This guide walks through the setup from start to finish.

What You’ll Need

Before getting started, you’ll need:

  • A WP Engine account with access to the site you want to manage
  • A Mac
  • Terminal, which is included with macOS
  • Your WP Engine User Portal login

WP Engine uses SSH keys for SSH Gateway access rather than a traditional SSH password.

1. Open Terminal

Open Terminal on your Mac.

You can find it under:

Applications → Utilities → Terminal

You can also press Command + Space, type Terminal, and press Return.

You’ll see a prompt similar to:

yourname@Your-Mac ~ %

2. Check for an Existing SSH Key

Before creating a new key, check whether you already have one configured.

Run:

ls -la ~/.ssh

Look for files named:

wpengine_ed25519
wpengine_ed25519.pub

If those files already exist, you can use them and skip ahead to adding the public key to WP Engine.

If they don’t exist, create a new key as described below.

3. Create an SSH Key for WP Engine

Run this command:

ssh-keygen -t ed25519 -f ~/.ssh/wpengine_ed25519

You’ll be asked for a passphrase:

Enter passphrase (empty for no passphrase):

For a simple setup, you can press Return to leave it blank.

You’ll then be asked to confirm it:

Enter same passphrase again:

Press Return again.

You should see confirmation that two files have been created:

/Users/yourname/.ssh/wpengine_ed25519
/Users/yourname/.ssh/wpengine_ed25519.pub

The first file is your private key. Keep it private and never upload or share it.

The second file is your public key. This is the one you’ll add to WP Engine.

4. Copy Your Public Key

In Terminal, run:

cat ~/.ssh/wpengine_ed25519.pub

You’ll see one long line beginning with:

ssh-ed25519

Copy the entire line, including the ssh-ed25519 at the beginning.

The public key should be a single line.

Do not upload or share the file named:

wpengine_ed25519

Only the .pub file contains the public key that WP Engine needs.

5. Add the Key to WP Engine

Log in to the WP Engine User Portal.

Open your profile and find the SSH Keys section.

Choose New SSH Key and paste the public key you copied in the previous step.

Save the key.

The private key remains on your Mac. It does not need to be uploaded to WP Engine.

6. Configure SSH on Your Mac

Back in Terminal, create the .ssh directory if it doesn’t already exist:

mkdir -p ~/.ssh

Then open your SSH configuration file:

nano ~/.ssh/config

Paste the following:

Host *.ssh.wpengine.net
    IdentityFile ~/.ssh/wpengine_ed25519
    IdentitiesOnly yes

Save the file by pressing:

Control + O

Press Return to confirm the filename.

Then exit nano by pressing:

Control + X

This configuration tells your Mac to use the WP Engine SSH key when connecting to a WP Engine SSH Gateway.

7. Find Your WP Engine SSH Login

Go back to the WP Engine User Portal and open the site/environment you want to access.

On the site’s Overview page, look for the SSH Login information.

WP Engine will provide the exact SSH login for that environment.

It will look something like:

Copy this value exactly as WP Engine displays it.

Important: This is an SSH login address, not a Terminal command by itself. You need to put ssh in front of it when connecting.

8. Connect to WP Engine

Open Terminal and enter:

Replace the example login with the SSH Login provided for your WP Engine environment. If you enter the address by itself, Terminal will try to run it as though it were a command and you’ll get an error similar to:

command not found

The ssh at the beginning tells Terminal that you’re connecting to a remote server.

The first time you connect

The first time you connect, you may see a message asking whether you want to continue:

Are you sure you want to continue connecting (yes/no/[fingerprint])?

Type:

yes

and press Return.

If your SSH key is configured correctly, you should now be connected to WP Engine.

9. Go to Your WordPress Installation

After connecting, you’ll need to move into the directory for your WordPress environment.

Use:

cd sites/ENVIRONMENT

Replace ENVIRONMENT with the name of your WP Engine environment.

For example:

cd sites/amcutedgetemp

Then run:

ls

You should see files and directories associated with your WordPress installation, such as:

wp-admin
wp-content
wp-includes
wp-config.php
index.php

At this point, you’re working directly with your WordPress site through Terminal.

10. Test WP-CLI

Once you’re in your WordPress directory, test whether WP-CLI is available:

wp --info

You can also check the WordPress version with:

wp core version

If those commands work, you’re ready to start using WP-CLI.

What You Can Do With SSH and WP-CLI

Once SSH and WP-CLI are working, there are a lot of useful things you can do from the command line.

For example, you can:

  • Manage WordPress plugins
  • Activate or deactivate plugins
  • Update WordPress
  • Manage themes
  • Search and replace content in the database
  • Import media
  • Export content
  • Run WordPress maintenance commands
  • Work with large numbers of files

For example, WP-CLI can import an image into the WordPress Media Library with:

wp media import /path/to/image.jpg

This becomes particularly useful when you’re dealing with a large number of files. Rather than uploading thousands of images individually through the WordPress Media Library, you can automate the process from the command line.

A Note About Large Media Imports

If you’re planning to import thousands of images, don’t start by running a command against the entire folder all at once.

For a large import, it’s better to work in batches and consider things such as:

  • Existing duplicate files
  • Image filenames
  • WordPress-generated thumbnail sizes
  • Available disk space
  • PHP and server resource limits
  • Whether the images need to be attached to specific posts
  • Whether the images are already optimized

Once SSH access is working, WP-CLI provides a much more practical way to handle a large media library than uploading thousands of files through the WordPress dashboard.

Recent Posts