While installing a subdomain site is possible, installing a subdirectory WordPress site is not possible on Cloudways, at least when this article is published. However, there’s a workaround that easy to follow.
In this guide, I will show you how to install a new subdirectory WordPress site on top of a primary domain. I’m going to build a subdirectory example.com/blog. You may also use /shop, /news, /about, or anything.
There are three major steps and it’s extremely easy. Check it out!
Step 1: Creating a new application on Cloudways
We have to do this to create a new MySQL Database account for our later subdirectory website. Cloudways does not allow two websites using the same database.
1. Go to the Application menu on Cloudways, then click Add Application.
2. Select the server, preferably the same like the primary domain. Then, hit Add Application.
3. Choose the application, name, and project, then click Add Application. I prefer to use WordPress, but you can also select Custom PHP App. It doesn’t matter since we only want its database.
4. Wait for the process to finish.
5. The application has been created. We will need the MySQL Access for the later guide.
Step 2: Uploading WordPress to the new subdirectory
Now, we need to create a new folder (subdirectory) on the primary domain. And then, we are going to upload WordPress to that directory.
1. Install File Manager on the primary domain. This will allow us to access the directory since Cloudways has no such feature (yet). If the primary domain is not WordPress, then you need FTP.
2. Go to File Manager and create a new folder under public_html.
3. Give the folder a name. Since I want to create a blog section (example.com/blog), then I’m going to name the folder as ‘blog’.
4. Next, download the latest WordPress here: https://wordpress.org/download/
5. Upload the WordPress installation package to the folder you just created. You can also drag and drop the file there.
6. Wait for the upload process to finish.
7. Right-click on the WordPress installation package, select Extract files from archive > Here.
8. Select Yes. Don’t worry, nothing will be replaced since this is a new folder.
9. Open the wordpress folder. We need to move all files from here to the subdirectory.
10. Select all, then click Cut.
11. Go back to the subdirectory you created before and Paste all the files.
12. After that, you can delete the wordpress folder and WordPress installation package since we are don’t need it anymore.
Step 3: Installing WordPress on the new subdirectory
We almost done! In this guide, we are going to install WordPress on the new subdirectory before it ready to use.
1. Visit the subdirectory site (example.com/blog). Select the installation language, then Continue.
2. This is just information we need to install WordPress. Since we already have that, click Let’s go!
3. Enter the Database name, Username, and Password from the MySQL Database we have created on Step 1. You can leave Database Host and Table Prefix by default, but I prefer to change the Table Prefix with something different for security reasons. Click Submit.
4. Click Run the installation.
5. Provide Site Title, Username, Password, and Your Email for this WordPress site, then click Install WordPress.
6. When done, click Log In.
7. Log In with the username and password you have created before.
8. Now the subdirectory WordPress on Cloudways is ready to use!
But there are some caveats…
Since this is actually a workaround from Cloudways limitations, there is some important information you need to know.
- The subdirectory (may) shares the same Cloudways settings from the primary domain.
- Yes, CloudwaysCDN will also work on the subdirectory site automatically.
- If you migrate the primary domain server, the subdirectory will follow.
- The new application settings won’t affect the subdirectory site.
- Do not delete the new application. Just leave it as it is.
Other than that, your subdirectory site should be fine and work normally. If there’s an issue, contact Cloudways customer service for more technical assistance.
Anyway, let me know if this guide works for you 🙂