Skip to content

wp-manage

wp-manage syncs content from a remote WordPress environment to your local DDEV setup and deploys to remote servers over SSH.

Terminal window
ddev wp-manage <command> <env> [target]

  1. Create an environment config

    Terminal window
    ddev wp-manage init production

    This creates .wp-manage-environments/production.conf. Each environment gets its own file — you can have as many as you need (staging, production, etc).

  2. Fill in the config

    Open the generated file and fill in all values:

    .wp-manage-environments/production.conf
    # ---- SSH ----
    REMOTE_USER="runcloud"
    REMOTE_HOST="your-server.com"
    REMOTE_SSH_PORT="22"
    # ---- WORDPRESS ----
    REMOTE_WP_PATH="/home/runcloud/webapps/your-app"
    UPLOADS_DIR="web/app/uploads"
    # ---- LOCAL ----
    LOCAL_PROJECT_PATH="~/Sites/your-project"
    # ---- DEPLOY ----
    GIT_BRANCH="main"
    CACHE_PLUGIN="none"

Pull content from the remote environment to your local DDEV instance.

Terminal window
ddev wp-manage sync <env> db # database only
ddev wp-manage sync <env> uploads # uploads only
ddev wp-manage sync <env> all # database + uploads

What sync db does:

  • Exports the remote database via WP-CLI, gzips it, and transfers it via rsync
  • Imports it into your local DDEV instance with ddev import-db
  • Cleans up temp files on both ends

What sync uploads does:

  • Rsyncs wp-content/uploads/ from the remote to local
  • Uses --delete so the local directory mirrors the remote exactly

Requirements: ssh, rsync, ddev, and WP-CLI on the remote server.


Deploy to a remote server over SSH.

Terminal window
ddev wp-manage deploy <env>

The default deploy sequence is:

  1. git fetch origin && git reset --hard origin/<GIT_BRANCH>
  2. composer install --no-dev --prefer-dist --no-interaction --optimize-autoloader (if composer.json exists)
  3. npm install && npm run build (if package.json exists)
  4. Cache flush (based on CACHE_PLUGIN)

Set DEPLOY_CMDS in the config to replace the default sequence entirely:

Terminal window
DEPLOY_CMDS="composer install --no-dev && php artisan config:cache"

Set CACHE_PLUGIN to automatically flush the cache after deployment:

ValuePlugin
noneNo cache flush (default)
wpWP Super Cache
w3tcW3 Total Cache
wp-rocketWP Rocket
litespeedLiteSpeed Cache

Install optional plugins from the curated list.

Terminal window
ddev wp-manage plugins # interactive menu
ddev wp-manage plugins list # list available plugins
ddev wp-manage plugins install <key> # install by key

KeyDescriptionDefault
REMOTE_USERSSH username
REMOTE_HOSTSSH hostname or IP
REMOTE_SSH_PORTSSH port22
REMOTE_WP_PATHAbsolute path to WordPress root on remote
UPLOADS_DIRUploads directory relative to REMOTE_WP_PATHwp-content/uploads
LOCAL_PROJECT_PATHAbsolute path to local project root
LOCAL_TMP_DIRLocal temp directory for DB dumps/tmp/wp-sync
REMOTE_TMP_DIRRemote temp directory for DB dumps/tmp/wp-sync
DB_FILENAMEFilename for the exported SQL filedb.sql
GIT_BRANCHBranch to deploymain
COMPOSER_BINPath to Composer binarycomposer
NPM_BINPath to npm binarynpm
DEPLOY_CMDSCustom deploy commands (replaces default sequence)
CACHE_PLUGINCache plugin to flush after deploynone