Skip to content

Create a VIP Local Development Environment

Create one or more local development environments, each with their own unique configurations, using the VIP Local Development Environment built into VIP-CLI.

Prerequisites

On the user’s local machine:

A VIP Local Development Environment has several configurable options that can be selected in a setup wizard during the creation process. New users are recommended to get started with the VIP Local Development Environment by following the instructions below to create a local environment with basic settings. Once a user gains familiarity with the dev-env commands and options, settings can later be updated with new values to make more advanced customizations to a local environment.

  1. In the local machine’s command line, create a new local environment and assign the --slug value example-site by running the command:
vip dev-env create --slug=example-site
  1. Select settings for the local environment 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.
    • WordPress – Which version would you like · Select the Enter or Return key to accept the highlighted default version.
    • 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 staging 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 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”.
    • Enable phpMyAdmin (y/N) · Select the Enter or Return key to accept the default value “false”.
    • Enable XDebug (y/N) · Select the Enter or Return key to accept the default value “false”.
    • 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”.

If the creation process is successful, details about the newly created environment will be output in the command line followed by a confirmation message ✓ environment created.

  1. The environment is created but not yet running. Run the start command to update the environment’s STATUS from DOWN to UP and bring it into a running state.
vip dev-env start --slug=example-site

If successful, details about the running created environment output in the command line will display STATUS as UP.

  1. Confirm that the environment is running as expected by copying the first listed NGINX URLS value and loading it in a browser window: http://example-site.vipdev.lndo.site/
    A successfully running environment will have a core WordPress theme enabled and display a default “Hello World!” post on the home page.
  2. Access the WordPress login portal for the running environment by copying the LOGIN URL value and loading it in a browser window: http://example-site.vipdev.lndo.site/wp-admin/ 
  3. Retrieve the default login credentials for a VIP Local Development Environment with the info command:
vip dev-env info --slug=example-site
  1. Access the WordPress Admin dashboard of the running environment by entering the default log in credentials then select the “Log in” button.

The newly created and running local environment will only list the “Hello Dolly” plugin on the Plugins screen, and core WordPress themes on the Themes screen. Because “Demo” was selected as the value for “source-application-code” in the creation wizard, the environment is currently loading a remote image of the vip-go-skeleton code repository.

After a local environment is successfully running, it can be updated to load a local copy of the VIP application’s code repository.

Creating a local environment based on a VIP Platform environment’s settings

A VIP Local Development Environment can be created with some option values that pre-populate based on an existing VIP Platform environment. To pre-populate values, reference the VIP application’s environment with @<app-name>|<app-id>.<env> when running the vip dev-env create command.

For example, to create a new environment with the slug example-site that pre-populates settings based on the develop environment for an application with the name “example-app”:

vip @example-app.develop dev-env create --slug=example-site

The --slug option

Accepted values: String
Default value: “vip-local”

Multiple local environments can be created with the VIP Local Development Environment and run simultaneously. Each local environment must have a unique --slug value so that a user can accurately run dev-env commands against the intended target environment.

Assign a unique --slug value to a local environment when running the create command.

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

After an environment has been created, ensure that vip dev-env commands target an intended local environment by passing the environment’s assigned slug value with every command.

For example, to retrieve information about a local environment with the assigned slug example-site:

vip dev-env info --slug=example-site

If a local environment is created based on a VIP Platform environment’s settings (i.e. @<app-name>|<app-id>.<env>) and a custom slug value is not assigned to it, a unique slug value for the environment will be created automatically.

To retrieve an environment’s assigned --slug value, run the command vip dev-env list. The command will output basic information about all existing local environments. The SLUG item will display the value that was assigned to an environment’s --slug option when it was created.

Last updated: December 08, 2024

Relevant to

  • WordPress