surprise API: cPanel shared hosting actually IS a WebFaction alternative

Hello fellow GoDaddy/WebFaction refugeees.

When looking for a place to flee WebFaction, I originally ruled out all the cPanel-based shared hosting providers because I was dreading click, click, clicking 10000 times in the GUI to set up my sites. I relied on the WebFaction API to automate tedious site config tasks.

But, to my surprise, I discovered that cPanel actually has an API that you can access via scripts from your favorite scripting language.

And that API can actually do most of the things that the WebFaction API could, albeit with a lot more historical warts and much poorer documentation.

  • create domains
  • create catch-all emails
  • create forwarding emails
  • create MySQL databases and users

So that opened up a lot of very low-cost alternative ISPs. I ended up migrating to MDDHosting and the process was much easier due to the API and ssh support. I will make a separate post about MDDHosting specifically.

Attached is a Perl script which demonstrates the kind of things you can do with the cPanel API and helps you avoid most of the pitfalls of learning cPanel APIs.

Even if you don't do Perl, see the comments in the script for lots of info about how to use the API and what features it supports.

One of the hardest parts of cPanel API is that there are actually at least 5 APIs and it's a confusing mess. See the comments in the attached script for clarity.

Sign In or Register to comment.