Cloudways Integration
Overview
Cloudways is a managed cloud hosting platform that allows you to deploy WordPress sites on various cloud providers like DigitalOcean, AWS, Google Cloud, and more. This integration enables automatic domain syncing and SSL certificate management between Ultimate Multisite and Cloudways.
Features
- Automatic domain syncing
- SSL certificate management
- Support for extra domains
- DNS validation for SSL certificates
Requirements
The following constants must be defined in your wp-config.php file:
define('WU_CLOUDWAYS_EMAIL', 'your_cloudways_email');
define('WU_CLOUDWAYS_API_KEY', 'your_api_key');
define('WU_CLOUDWAYS_SERVER_ID', 'your_server_id');
define('WU_CLOUDWAYS_APP_ID', 'your_app_id');
Optionally, you can also define:
define('WU_CLOUDWAYS_EXTRA_DOMAINS', 'comma,separated,list,of,domains');
Setup Instructions
1. Get Your Cloudways API Credentials
- Log in to your Cloudways dashboard
- Go to "Account" > "API Keys"
- Generate an API key if you don't already have one
- Copy your email and API key
2. Get Your Server and Application IDs
- In your Cloudways dashboard, go to "Servers"
- Select the server where your WordPress multisite is hosted
- The Server ID is visible in the URL:
https://platform.cloudways.com/server/{SERVER_ID} - Go to "Applications" and select your WordPress application
- The App ID is visible in the URL:
https://platform.cloudways.com/server/{SERVER_ID}/application/{APP_ID}
3. Add Constants to wp-config.php
Add the following constants to your wp-config.php file:
define('WU_CLOUDWAYS_EMAIL', 'your_cloudways_email');
define('WU_CLOUDWAYS_API_KEY', 'your_api_key');
define('WU_CLOUDWAYS_SERVER_ID', 'your_server_id');
define('WU_CLOUDWAYS_APP_ID', 'your_app_id');
If you have additional external domains (outside your multisite network) that should always be kept on the Cloudways aliases list:
define('WU_CLOUDWAYS_EXTRA_DOMAINS', 'extradomain1.com,extradomain2.com');
Do not add *.your-network.com (or any subdomain pattern of your own network) to
WU_CLOUDWAYS_EXTRA_DOMAINS. See Important — wildcard SSL pitfall
below for why this prevents per-tenant SSL certificates from being issued.
4. Enable the Integration
- In your WordPress admin, go to Ultimate Multisite > Settings
- Navigate to the "Domain Mapping" tab
- Scroll down to "Host Integrations"
- Enable the Cloudways integration
- Click "Save Changes"
How It Works
Domain Syncing
When a domain is mapped in Ultimate Multisite:
- The integration retrieves all currently mapped domains
- It adds the new domain to the list (along with a www version if applicable)
- It sends the complete list to Cloudways via the API
- Cloudways updates the domain aliases for your application
Note: The Cloudways API requires sending the complete list of domains each time, not just adding or removing individual domains.
SSL Certificate Management
After domains are synced:
- The integration checks which domains have valid DNS records pointing to your server
- It sends a request to Cloudways to install Let's Encrypt SSL certificates for those domains
- Cloudways handles the SSL certificate issuance and installation
The integration always requests standard (non-wildcard) Let's Encrypt certificates from
Cloudways. If a wildcard pattern is supplied in WU_CLOUDWAYS_EXTRA_DOMAINS, the leading
*. is stripped before the SSL request — the wildcard itself is never installed by this
integration. To use a wildcard certificate on Cloudways you would have to install it
manually, but doing so blocks per-domain Let's Encrypt issuance for mapped custom domains
(see the pitfall below).
Extra Domains
The WU_CLOUDWAYS_EXTRA_DOMAINS constant allows you to specify additional external
domains that should always be kept on the Cloudways application's aliases list. Use it for:
- External domains that are not managed by Ultimate Multisite (e.g. a separate marketing site sharing the same Cloudways application)
- Parked or staging domains you want kept on the application aliases list
Do not use this constant for your own network's subdomain wildcard
(e.g. *.your-network.com). See the wildcard SSL pitfall below.
Important — Wildcard SSL Pitfall
A common mistake when following Cloudways' default setup is to add a wildcard such as
*.your-network.com to WU_CLOUDWAYS_EXTRA_DOMAINS, or to manually install a Cloudways
wildcard SSL certificate for that wildcard.
If you do this, Cloudways will refuse to issue Let's Encrypt certificates for the per-tenant custom domains that Ultimate Multisite maps. Cloudways replaces the active SSL certificate on the application each time, and a pre-existing wildcard certificate on the application blocks the per-domain Let's Encrypt issuance the integration relies on.
Recommended Cloudways SSL setup for an Ultimate Multisite network
- In the Cloudways application's SSL Certificate tab, install a standard
Let's Encrypt certificate covering only
your-network.comandwww.your-network.com— not a wildcard. - Do not put
*.your-network.com(or any subdomain pattern of your own network) inWU_CLOUDWAYS_EXTRA_DOMAINS. Reserve that constant for external domains only. - Create the per-tenant subdomain wildcard at the DNS level only (an
Arecord for*.your-network.compointing at your Cloudways server IP) so subsites resolve. SSL for individual mapped custom domains is then issued automatically by the integration via Let's Encrypt.
If your tenants' custom domains are stuck without SSL, check the Cloudways SSL tab. If a
wildcard certificate is active there, remove it, reissue a standard Let's Encrypt
certificate for the main network domain only, and remove any wildcard entries from
WU_CLOUDWAYS_EXTRA_DOMAINS. Then re-trigger a domain mapping (or wait for the next one)
and the integration will start issuing per-domain certificates again.
Troubleshooting
API Connection Issues
- Verify that your email and API key are correct
- Check that your server and application IDs are correct
- Ensure that your Cloudways account has the necessary permissions
SSL Certificate Issues
- Cloudways requires that domains have valid DNS records pointing to your server before issuing SSL certificates
- The integration validates DNS records before requesting SSL certificates
- If SSL certificates are not being issued, check that your domains are properly pointing to your server's IP address
- Per-tenant custom domains stuck without SSL? Check the Cloudways application's SSL Certificate tab. If a wildcard certificate (manually installed, or covering
*.your-network.com) is active, Cloudways will not issue Let's Encrypt certificates for individually mapped custom domains. Replace it with a standard Let's Encrypt certificate covering only the main network domain (your-network.com,www.your-network.com) and remove any wildcard entries fromWU_CLOUDWAYS_EXTRA_DOMAINS. Then re-trigger a domain mapping (or wait for the next one) and the integration will request per-domain certificates.
Domain Not Added
- Check the Ultimate Multisite logs for any error messages
- Verify that the domain is not already added to Cloudways
- Ensure that your Cloudways plan supports the number of domains you're adding