Configure WordPress#


Follow the Configure Apache documentation, using the wordpress configuration at the Add sites step.

In the service’s Pillar file, add, for example:

  public_access: True
      configuration: wordpress
      serveraliases: ['']
        user: coalition
        socket: /var/run/php/php-fpm-coalition.sock

MySQL and PHP#

Follow the Configure MySQL and Configure PHP documentation.


Configure PHP-FPM to correspond to the Apache configuration. For example:

      configuration: default
        user: coalition
        listen_user: www-data
        socket: /var/run/php/php-fpm-coalition.sock


You can create a custom configuration, if needed.



Salt contains WordPress states, but they are limited. Also, WordPress is often deployed by copying files, rather than via fresh installs.

  1. Configure WP-CLI. In the service’s Pillar file, add, for example:

      cli_version: 2.7.1
  2. Deploy the service.

  3. Connect to the server as the WordPress user (e.g. coalition).

  4. Change to the public_html directory:

    cd ~/public_html
  5. Download WordPress:

    wp core download --locale=en_US
  6. Configure WordPress’ database connection, to correspond to the MySQL configuration. For example:

    wp core config --dbname=DBNAME --dbuser=USERNAME --dbpass=PASSWORD
  7. Install WordPress, with a siteadmin user associated to For example:

    wp core install --title="" --admin_user=siteadmin --admin_password=PASSWORD --skip-email
  8. Uninstall default plugins:

    wp plugin uninstall hello
  9. If you have a custom theme, download and activate it. For example:

    git -C wp-content/themes/ clone
    wp theme activate


When migrating domains or renaming themes, you might need to search and replace items in the database, using the wp search-replace command.

  1. Run the command with the --dry-run flag, for example:

    wp search-replace --report-changed-only --all-tables --precise --log=/tmp/wp-search-replace.log --dry-run 'open-spedning-coalition' ''
  2. Read the log file to check that no undesired replacements will be made:

    less /tmp/wp-search-replace.log
  3. Run the command without the --dry-run flag.

Strings to replace might include:

  • Developer email addresses

  • Domain names

  • Theme names

  • File paths

If the site uses these plugins, perform these operations to remove old items in the database:

  • Rank Math: Status & Tools menu item > Database Tools tab > Click the Delete Internal Links and Clear 404 Log buttons.

  • WordFence: Scan menu item -> Click the START NEW SCAN button. You can also manually delete rows from the wp_wfhits and wp_wflogins tables.