wpe apps create

Create a new WP Engine Headless Application

$ wpe apps create [OPTIONS]

The wpe apps create command allows you to create a new WP Engine Headless Application. You provide: The GitHub repository you want to use. The environments you want to deploy. The name of your app. Running the command will deploy the code from your repository to the corresponding environments.

The repository is a reference to your GitHub repository. For example, if your GitHub repository is https://github.com/organization/myapp, then the value your use for repository will be organization/myapp.

The environments correspond to the WP Engine User Portal environments where you have your WP site. So if your domain is myapp.wpengine.com, your environment would be myapp.

--environments, -e Environments in JSON format (use with -n, -r flags; surround value with single quotation marks)
--filepath, -f Path to file with JSON of the app to create (use without -e, -n, -r flags)
--help, -h Help for create
--name, -n Assign a name to the app (optional use with -e, -r flags)
--repo, -r GitHub repo associated with the app (use with -e, -n flags)

The simplest way to create your new app is by configuring a wpe.json file with the variables necessary to deploy the application. Something like the following:

{
"name": "myapp",
"repo": "organization/myapp",
"region": "US-C",
"environments": [
{
"name": "Production",
"branch": "main",
"wp_environment_name": "YOUR WordPress environment name",
"domains": ["yourdomain.com"],
"env_variables": [
{
"key": "WORDPRESS_URL",
"value": "https://yoururl"
}
]
}
]
}

With the above file created, you can deploy your app with a single command:

$ wpe apps create -f wpe.json

Providing custom domains is optional. If you do want to connect a custom domain, you need to configure your domain one of 2 ways.

  • Root CNAME pointed to js.wpenginepowered.com
  • A records with the following IPs:
    • 141.193.213.10
    • 141.193.213.11

NOTE: We currently only support one custom domain.

Note: The zip app flow only works with wpe CLI version 1.0.0 or greater.

If you don't use a GitHub repository host (i.e. you use BitBucket or GitLab), you can create an Atlas app from a json file configured for zip uploads. All requirements from the standard wpe create flow apply, with a few exceptions.

To make your json file zip configurable, set the "repo" parameter to "uploadable". Then, add a parameter named "zip_file_path" with the directory path to your zip file. You must include the "branch:" parameter, with a value of "-".

{
"name":"your_app_name",
"repo": "uploadable",
"region":"EU-W",
"environments": [
{
"domains":[],
"name": "someenvname",
"zip_file_path": "path/to/file.zip",
"branch": "-",
"wp_environment_name": "wpinstancename",
"env_variables": [
{
"key": "replace-with-key",
"value": "replace-with-key-value"
}]
}
]
}

With your json file parameters set, run wpe apps create -f wpe.json.