Skip to content

Basic usage

Available commands for the VIP Local Development Environment and their options can be reviewed by running vip dev-env --help or vip dev-env -h.

Caution

VIP-CLI commands, including dev-env, should never be run with sudo.

If sudo is used, destroy the affected VIP Local Development Environment. Create a new environment without the sudo command in order for the local environment to work as expected.

Default WordPress login credentials

By default, a newly created local environment supplies a default WordPress user account with an Administrator role for WordPress single site and a Super Admin role for WordPress multisite installations.

Once a local environment is in an UP state, the WordPress Admin dashboard can be accessed by appending the output NGINX URLS value with /wp-admin/.

For example: http://example-site.vipdev.lndo.site/wp-admin/

Default username: vipgo
Default password: password

Users can optionally be auto-logged into the WordPress Admin dashboard with the default credentials by loading the generated LOGIN URL value into a browser window.

Execute WP-CLI commands

Execute WP-CLI commands against the local environment’s containers (as opposed to the host machine) with the command: vip dev-env exec [options]. Separate the arguments of the vip process and the WP-CLI command to be executed with -- (two standard hyphens).

For example, to run the WP-CLI command wp post list against the WordPress site in the running local environment named example-site:

vip dev-env exec --slug=example-site -- wp post list

Note

Commands run with exec -- are running inside of the local environment’s containers and not the host machine. Because of this, paths to local files on the host machine might not work as expected.

The wp db export WP-CLI command can be used to export database tables from a locally running WordPress site. Ensure that the generated file is exported to a location that is easily retrievable by the user and not exported to the Docker container’s file system by using the - > operators:

vip dev-env exec --slug=example-site -q -- wp db export - > /Users/example-user/Desktop/example-export.sql

Retrieve information about a local environment

After a VIP Local Development Environment is created, information about the environment will be automatically output after the completion of commands such as createstart, update, and stop.

Information about an environment can be retrieved on demand with the command: vip dev-env info [options].

Information output:

  • SLUG: The value assigned to the --slug option
  • LOCATION: Path to the local environment on the local machine(e.g. /Users/user-name/.local/share/vip/dev-environment/example-site)
  • SERVICES: A list of available services provisioned in the local environment (e.g. Search Dev Tools, NGINX, PHP, database, Memcached, Elasticsearch, WordPress, vip-mu-plugins, demo-app-code)
  • NGINX URLS: URLs for accessing a running local environment in a browser (e.g. http://example-site.vipdev.lndo.site/)
  • STATUS: State of the local environment (e.g., UP , DOWN)
  • LOGIN URL: Automatically log in to the WordPress Admin dashboard with the default credentials by loading this generated URL value in a browser window.
  • DEFAULT USERNAME:  vipgo                                                                          
  • DEFAULT PASSWORD:  password 

Setup wizard

When a vip dev-env create or a vip dev-env update command is run, a command line setup wizard will appear and ask a user to confirm settings for all other environment options that were not set in the command.

For example, by including --multisite=y in the vip dev-env create command, the setup wizard will skip the “Multisite (y/N)” option, but will ask a user to confirm other environment settings (e.g., “WordPress site title“, “WordPress version“).

An example command that sets multiple option values:

vip dev-env create --title="WPVIP Dev" --multisite=y --php=8.0 --mu-plugins="~/vipdev/vip-go-mu-plugins" --app-code="~/vipdev/vip-go-skeleton" --slug=example-site

Setting options in the setup wizard:

  • WordPress site title · Select the Enter or Return key to accept the default value “VIP Dev”, or type a new custom value and then select the Enter or Return key to proceed to the next option.
  • Multisite (y/N) · Select the Enter or Return key to accept the default value “False”, or type “y” to create a WordPress multisite local environment.
  • PHP version to use · Select the Enter or Return key to accept the default version, or use the Down Arrow or Up Arrow to highlight the desired version and then select the Enter or Return key to proceed to the next option.
  • WordPress – Which version would you like · Select the Enter or Return key to accept the highlighted default version, or use the Down Arrow or Up Arrow to highlight the desired version and then select the Enter or Return key to proceed to the next option.
  • How would you like to source vip-go-mu-plugins · Select the Enter or Return key to accept the default value “Demo”. This will automatically load the production branch of VIP MU plugins on the created local environment.
  • How would you like to source application-code · Use the Down Arrow to highlight the “Demo” option and run the local environment with a default, uneditable codebase. Or, select the default setting “local folder” to configure the local environment to load an application’s wpcomvip GitHub repository that has been git cloned to the local machine. Select the Enter or Return key to proceed to the next option.
  • Enable Elasticsearch (needed by Enterprise Search)? (y/N) · Select the Enter or Return key to accept the default value “false”, or type “y” to enable Elasticsearch for the local environment.
  • Enable phpMyAdmin (y/N) · Select the Enter or Return key to accept the default value “false”, or type “y” to enable phpMyAdmin for the local environment.
  • Enable XDebug (y/N) · Select the Enter or Return key to accept the default value “false”, or type “y” to enable XDebug for the local environment.
  • Enable Mailpit (y/N) · Select the Enter or Return key to accept the default value “false”.
  • Enable Photon (y/N) · Select the Enter or Return key to accept the default value “false”.
  • Enable Cron (y/N) · Select the Enter or Return key to accept the default value “false”.

Last updated: August 08, 2024

Relevant to

  • WordPress