dowsoninc
By:
dowsoninc

DigitalOcean API WordPress installation Activation.

April 13, 2017 658 views
WordPress API DigitalOcean Ubuntu 16.04

Hi there, I am currently using the DigitalOcean API to generate sites automatically.

I am generating the site, hooking the domains up etc so I can access the site. When I do access the site I get:

Please log into your droplet via SSH to enable your WordPress installation.

As the sites are being created pragmatically is there anyway I can get around this using the DigitalOcean API?

3 Answers

If you can implement the API, why not implement SSH and execute the commands necessary?

  • I can do this via SSH (well assume so) but I was wondering if there was an easier way of doing this using the DigitalOcean API?

    • No, the API has no way of connecting to your droplet in such a way. You could use User Data.

      • Looking through the calls I'm making so far and it doesn't give me the password anyway (the one that is sent to my email) - how do I get the password so I can connect via SSH pragmatically?

You could do one of the following which have Wordpress Deployment and quick builds of servers:

https://serverpilot.io/a/9f5b39f72604 (Referral link for me)
https://runcloud.io

Both are pretty easy and straight forward, you could do a full WP deployment via their API on ServerPilot, you just would need to call DO to create the Droplet, then ping Serverpilot for the install - some options if nothing else, may not fit, but something to look at/consider.

@dowsoninc

You may want to look at doctl as it can run locally (I use it on my Macbook Pro) and it can connect via SSH.

https://github.com/digitalocean/doctl

https://www.digitalocean.com/community/tutorials/how-to-use-doctl-the-official-digitalocean-command-line-client#making-ssh-connections

I don't run automation from my MBP right now, though if I were to do so, that's probably what I'd use. You could wrap a bash script around it to simplify it further (i.e. reduce down common commands).

DigitalOcean's web based control panel provides a convenient, point-and-click interface for managing Droplets. There are many times, however, when a command-line tool may be a preferable alternative. doctl, the official DigitalOcean command-line client, leverages the DigitalOcean API to provide access to most account and Droplet features.
Have another answer? Share your knowledge.