WP Engine is a managed WordPress host. DeployHQ connects to a WP Engine environment over SSH/SFTP using a dedicated SFTP user, and deploys your files straight into the install.

There are two WP Engine specifics that catch most people out, so we will call them out up front:

- **Use the SFTP host and port 2222.** For this setup, connect to WP Engine's SFTP address, `yourinstall.sftp.wpengine.com`, on port 2222. Port 22 will appear to connect but the connection test will fail or time out.
- **Authenticate with an SFTP user's username and password, not an SSH key.** WP Engine's SSH Gateway (shell access, on a separate `yourinstall.ssh.wpengine.net` host) and its SFTP user access are different things. DeployHQ deploys through an SFTP user, so create one in your WP Engine portal and use those credentials.

## Create an SFTP user in WP Engine

1. Log in to your WP Engine User Portal and open the environment you want to deploy to.
2. Create a new **SFTP user** for that environment. WP Engine will give you a username and let you set a password.
3. For security, restrict the SFTP user's access to only the directory you intend to deploy into.

WP Engine's own documentation covers creating an SFTP user in detail if you need it.

## Add the server in DeployHQ

1. In your project, go to **Servers & Groups** and click **New Server**.
2. Enter a name for the server and select **SSH/SFTP** as the protocol.
3. Fill in the **Server Details**:
   - **Hostname**: `yourinstall.sftp.wpengine.com` (replace `yourinstall` with your environment name)
   - **Port**: `2222`
   - **Username**: your WP Engine SFTP user's username
4. Under **Authentication**, choose **username and password** and enter the SFTP user's password.
5. Set the **Deployment path** to the directory you want to deploy into, relative to the install. For a single theme this is typically `wp-content/themes/your-theme`. Do not use a leading slash.
6. Configure any other options you need, such as automatic deployments when you push.
7. Click **Create Server**.

DeployHQ will run a connection test when you save. If everything is correct, the server saves and you are ready to deploy.

## Run your first deployment

Your first deployment uploads the whole repository. If your files are already up to date on WP Engine, you can skip the first deployment. After that, DeployHQ only uploads the files that have changed on each deployment.

## Troubleshooting

- **"Server did not respond within 45 seconds"** or the connection test hangs: check that the **Hostname** is the SFTP address `yourinstall.sftp.wpengine.com` and the **Port** is `2222`. Using the SSH Gateway host or port 22 is the most common cause.
- **"Server could not be written to"**: confirm the **Deployment path** exists inside your install and that your SFTP user has write access to it. See [Server could not be written to](server-could-not-be-written-to).
- **Authentication problems**: make sure you are using an **SFTP user's username and password**, not an SSH key or your WP Engine portal login.

## Zero downtime deployments

If you want atomic, zero downtime deployments on WP Engine, see [Zero downtime deployments on WP Engine](zero-downtime-wp-engine).
