DEV Community

Bulent Kocaman for PD Modules

Posted on

How to sell DigitalOcean Droplets from Blesta

Blesta handles the billing side of a hosting company well: packages, invoices, suspensions, cancellations. Adding cloud servers to that catalogue is a natural move, and DigitalOcean is a sensible place to run them. You keep one provider account, they keep the hardware, and your clients buy a server from you.

What Blesta can't do on its own is talk to DigitalOcean. Between "invoice paid" and "server running" there's a lot of work: building the Droplet, handing the client their access, reacting to plan changes, and tidying up when the service is cancelled. Miss a step and you either have an unhappy client or a provider bill for resources nobody is paying you for.

Here's how to structure it in Blesta, and the cost traps to plan for whatever tooling you choose.

How the pieces fit

Think of it as three layers:

  • Your DigitalOcean account owns every Droplet. DigitalOcean invoices you.
  • Blesta owns the client relationship: the package, the configurable options, the invoices and the service record.
  • A provisioning module links the two, so Blesta's service events (activate, change, suspend, cancel) become API calls against DigitalOcean.

Clients never log in to DigitalOcean, and never need an account there. Everything they see is on their Blesta service page, under your company's name. The gap between what you charge per billing term and what DigitalOcean charges you is your margin.

Step 1: add the account as a module row

In Blesta, provider credentials live on the module, under Settings → Company → Modules. Generate a personal access token in DigitalOcean's API settings and save it there, where Blesta keeps it encrypted.

Give the token write access. A read-only token will happily answer "is this connected?" and then fail when the first paid order tries to create a server. Full Access is the simple choice; custom scopes work if they cover Droplets and the other resources you plan to sell. Set yourself a reminder before it expires, because an expired token stops new orders and client actions even though existing servers keep running.

Step 2: build the package and its options

Create a package that uses the module and that account. Two settings matter more than they look:

  • Hold paid pending services should stay unticked if you want paid orders built automatically, rather than waiting for a member of staff to approve them.
  • Configurable options decide what the client chooses at checkout.

Resist typing region and size lists in by hand. DigitalOcean adds regions and retires plans, and a hand-made list goes stale without warning. Generate the options from the live catalogue instead: region, plan, operating system, extra block storage, automated backups, a dedicated IP, and how many snapshots the client may keep. Hide what you don't want to sell, then set your prices for each term under Packages → Configurable Options. Before you open the order form to clients, check that every plan you show is actually available in the regions you show.

A Blesta package with its options generated from DigitalOcean's catalogue

Step 3: give each service a proper set of tabs

Blesta lets a module add tabs to a client's service page, and that's where a cloud server earns its keep. A useful set covers:

  • status and power: on, shut down, reboot, rename and rebuild;
  • access: IPv4 and IPv6 addresses, an SSH key made for that one server, and a command ready to paste;
  • a firewall per server: DigitalOcean Cloud Firewalls let the client open only the ports they need;
  • snapshots and backups they can take and restore themselves;
  • CPU and bandwidth graphs, plus an activity log so both of you can see what happened and when.

A client's Droplet service page in Blesta, with power controls and server details

The client's own firewall rules for this server

If you can, add a terminal that opens in the browser. A client locked out by their own firewall change, or without an SSH client on the laptop they have with them, can still get in and fix things.

A root terminal opened from the Blesta service page

Step 4: know where the provider bill hides

This is where cloud reselling quietly loses money:

  • Suspension doesn't stop the meter. When Blesta suspends an unpaid service, powering the Droplet off is the safe choice because the disk survives. DigitalOcean still charges for a stopped Droplet, though. If a service stays unpaid, cancel it.
  • Snapshots cost money for as long as they exist, charged by the gigabyte. Sell a snapshot allowance as a configurable option, so clients pay for the storage they keep.
  • A Droplet is rarely alone. Block storage, a firewall, a reserved IP and SSH keys can all belong to one service. Deleting only the server leaves the rest on your bill. Cancellation should remove each piece and confirm with DigitalOcean that it's gone.
  • Decide what happens to client snapshots. Deleting a client's only backup the moment they cancel is unkind; keeping it forever costs you. Agree it in advance.

A client's snapshot list, with the number used out of the number bought

Step 5: keep the background work moving

Creating a Droplet takes seconds, but the finishing steps (recording its addresses, attaching storage, creating the firewall) and client actions such as a reboot normally happen in a background task. In Blesta, that means the cron and the tasks under Settings → Company → Automation. If those run rarely, clients wait. Aim for client-facing work to start within about a minute.

The module we built for this

PD DigitalOcean Droplets is our Blesta module for exactly this. It generates package options from DigitalOcean's live catalogue, builds the Droplet when Blesta activates a paid order, and gives clients service tabs for power, connection details, a browser console, their own Cloud Firewall, snapshots, backups, usage graphs and activity. Plan changes resize the server, suspension powers it off, and cancellation with "Use module" ticked removes the Droplet and the resources it created once DigitalOcean confirms. It runs inside the PD Modules panel in Blesta, which adds a one-minute background task to Blesta's automation with no extra cron to set up.

For requirements and screenshots, see the module page. Questions about running cloud servers from Blesta are welcome in the comments.

PD Modules is made by Projektif Digital Ltd, the team behind PD Hosting.

Top comments (0)