Skip to content

VIP Local Development Environment

Basic usage

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

$ vip dev-env -h
  Usage: vip dev-env [options] [command]
  
  Commands:
    create   Create a new local dev environment
    destroy  Remove containers, networks, volumes and configuration files of a local dev environment
    exec     Execute an operation on a dev environment
    import   Import data into a local WordPress environment
    info     Provides basic info about one or multiple local dev environments
    list     Provides basic info about all local dev environments
    start    Start a local dev environment
    stop     Stop a local dev environment
    update   Update an already created local dev environment
  
  Options:
    -d, --debug    Activate debug output
    -h, --help     Output the help for the (sub)command
    -v, --version  Output the version number

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 info command:

vip dev-env info --slug=<custom-name>

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, Enterprise Search, WordPress, mu-plugins, client-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: The URL to load in a browser to access the WordPress log in portal.
  • DEFAULT USERNAME:  vipgo                                                                          
  • DEFAULT PASSWORD:  password 

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

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 site-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.

Executing CLI commands

Use exec to execute commands against the local environment’s containers as opposed to the host machine. Separate the arguments of the vip process and the 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:

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

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

Last updated: September 14, 2022