Roger Rosweide, co-founder and CCO of WPCS.io, shows you how to merge your agency’s website portfolio in WPCS where each website has a different tech stack, automate your business with a storefront, and continuously develop your sites like a SaaS.
If you’re using software like ManageWP and MainWP, you already know that you can streamline your agency to a certain degree. But, you’re likely also aware that there’s a limit to how much you can “SaaS-ify” your agency. If you want to experience true scale, like the big website builders such as Shopify and Wix, you have to employ the same SaaS cloud architecture. This webinar shows you what you need to do to benefit from it right away.
Step 1: Install the necessary software
First, we must install some additional software. Takes only a few minutes to install and is for free.
Step 2: Configure LocalWP
Pushing a local WP installation to WPCS gives you 2 options. Push it as a:
- New Version (the development environment that hosts and influences your sites)
- New Tenant (your websites)
For the Version:
- Merge your WP installs into a new WP install by copying the plugin, theme, and language folder inside of this new WP install in LocalWP.
- Any WordPress installation that you have that has the exact same plugins and themes as whatever you’re using as your Version (you need to keep functional parity with your version if you’re uploading different installations as tenants).
Sidenote: even though your tenants need to have the same plugins, themes, and language files as your version, your Version does not need to have the same files as your tenant. It can have more. This idea lends itself to having varying tenants within the same Version.
Step 3: Configure a .env file in your local WP-installs with WPCS API keys
To make sure that WPCS knows which Product you want to send your local installations to, you need to connect it with LocalWP using API credentials from your Product.
Open the WP folder of your local installs in LocalWP and, using a visual editor such as Visual Code, make a file in the WP folder in “Public”, where also wp_config is and name it: .wpcs-cli.env
WPCS_DEFAULT_REGION=eu1-or-us1 WPCS_DEFAULT_API_KEY=your-api-key WPCS_DEFAULT_API_SECRET=your-api-secret
After you’ve pasted the above, go to the WPCS Console, open up your Product and go to API keys. Click on the + button, give your API key a name and generate the key and secret.
You’re now setting up the API credentials in the .wpcs-cli.env by editing these lines:
- Choose your region: eu1 or us1 (strike what you won’t use)
- Replace the “your-api-key” line with the API key you’ve generated
- Replace the “your-api-secret” line with the API secret
Now, save the visual editor and open the site shell of the wp install from the LocalWP dashboard.
Important note: make sure the WP install is active (that means “start” the site in LocalWP).
Opening up the site shell from LocalWP brings you into the terminal.
Inside the terminal, check if the CLI works:
- Check Node: node -v
- Check WP CLI: wp —version
- npx @wpcs.io/cli check
Step 4: Deploy local WP install to WPCS
Now that you’re ready, use any of these commands to either create a Version or a Tenant.
Creating a Version from local:
- npx @wpcs.io/cli local deploy --name [NAME]
Creating a Tenant from local:
To send a local installation to WPCS as a tenant we first need to turn it into a Snapshot that WPCS can receive:
- npx @wpcs.io/cli local package
This will give you a path, that might look something like this:
Next, you enter the command that will send this Snapshot to WPCS:
- npx @wpcs.io/cli tenant create [NAME] --customSnapshotPath= [INSERT PATH]
The result would look something like this:
- npx @wpcs.io/cli tenant create [NAME] (if you want to create a tenant based on your current Production Version)
- npx @wpcs.io/cli tenant list (if you have several Products, to check if you’re in the right product)
☝? If at any stage you need help while using the WPCS CLI, just type “npx @wpcs.io/cli help” and explore from there. Have fun!