Concept
eCommerce, UI/UX, Web Hosting, WordPress

Leveraging the Runcloud API to create and manage WordPress websites with WordPress

Craig Marolf
Web Developer and Marketing Strategist
Published on January 4, 2025
By Craig Marolf in Concept

Share

Integration

Over the past year, I transitioned web hosting and website management clients from WHMCS to WooCommerce. This shift made sense for the business, as our clients are primarily agency-referred. While we manage the hosting and billing relationship, clients typically reach out to their agencies for support. WHMCS, with its extensive feature set, felt like overkill for our needs—akin to driving a tractor-trailer when all we needed was a streamlined subscription billing solution. Additionally, with the rising costs of WHMCS and cPanel licensing, the writing was on the wall: it was time for a change.

In 2023, we migrated all of our infrastructure away from the data center and hosting provider we had relied on for a decade. After taking on a large investment, their service quality suffered, as expected. Combined with a poorly executed dashboard overhaul that lagged behind competitors and the ever-increasing costs of cPanel licensing (not the provider’s fault), it was clear that if we were going to go through the hassle of updating hundreds of IP addresses, we needed to reassess our entire stack to modernize and future-proof our offering.

Ultimately, we chose Vultr as our primary infrastructure provider due to the high-performance NVMe instances that offered excellent pricing and reliability. To manage server configurations, updates, and streamline WordPress instance deployment and monitoring, we opted to use RunCloud as our management layer.

With this transition, we also moved client billing to WooCommerce since our needs were simple—subscription-based invoicing. However, we didn’t want to strip customers of all functionality, so I developed a WordPress plugin utilizing the RunCloud API to provide some basic interactivity for end users. The most notable features included:

  • Restoring backup snapshots directly from the WordPress dashboard
  • Generating one-click login links using the RunCloud Hub Magic Link API

Backup Snapshots via the RunCloud API

I integrated the RunCloud API into a WordPress plugin to manage and display backup snapshots for individual web applications. This implementation allows us to fetch and store backup snapshots associated with a given backup instance, ensuring that the most recent backup data is always accessible. Rather than making frequent API requests, we store snapshot details in custom post meta fields via an automated cron job, improving performance and reliability.

A shortcode dynamically displays stored snapshots, including:

  1. Status
  2. Creation date
  3. File/database sizes

Additionally, an AJAX-powered restoration feature enables users to restore a specific snapshot with a single click. To ensure efficiency, we separated API calls responsible for fetching snapshot data from user-triggered restoration operations, allowing for a smooth and secure experience within the WordPress environment.

Since this system is designed for end users, we strictly enforce permissions, ensuring that WordPress users can only view or restore backups for their assigned installations. These installations are managed as custom post types, preventing unauthorized access to unrelated websites.

WordPress Login via RunCloud Hub Magic Link

For the RunCloud Hub Magic Link integration, I implemented a feature that facilitates one-click login link generation for WordPress users. These magic links are temporary and user-specific, meaning they must be generated on demand rather than stored in the database for later use.

The integration connects to the RunCloud API to:

  1. Retrieve a list of eligible users for a given WordPress installation
  2. Generate a one-time, time-sensitive login link for streamlined access

A shortcode dynamically displays the list of users from the API, alongside email addresses and a “Generate Magic Link” button. Clicking the button triggers an API request to create a unique login link. Once generated, the page updates to display the newly created link, formatted with the user’s login information.

Because the API call is required on page load, there is a slight but reasonable delay in displaying the user list. I may experiment with deferring the API call until after page load, pending user feedback.

Next Steps & Potential Future Development

This solution works well for now, but it’s not a long-term, scalable approach. A few ideas I’m considering:

Turning this into a commercial WordPress plugin

  • Automating RunCloud API provisioning through WooCommerce
  • Selling managed WordPress hosting as a WooCommerce subscription
  • Auto-creating a WordPress instance & post entry upon checkout
  • Ideal for small agencies and developers who want to offer turnkey hosting solutions

Expanding this into a standalone web application

  • Possibly using Next.js (Payload CMS) or Laravel
  • Creating a central dashboard for server & website management
  • Offering a white-label solution for agencies that want control over their clients’ hosting

The web hosting industry has long been a race to the bottom, but there’s still room to provide value-added services that give agencies and developers more control over their client infrastructure. This project is a step in that direction—helping bridge the gap between server management, client access, and usability.