Create a single WordPress instance using a cloud-init config and bash script

  • Login to the DCD via https://dcd.ionos.com
  • Create a new data center from the Data Center designer menu in the upper left and select the region from the drop down below the description area
  • Add a server item by clicking on server from the left palette and dragging to the DCD grid area
  • Attach your server to the internet by clicking on the plus “+” and dragging the line to the internet access icon, this will automatically create a “LAN 1” network
  • Click on the server icon and to the right and enter a name ie wordpress1
    1. Choose the type of CPU, and desired number of Cores and RAM
    2. Click on the Storage item
    3. Select the desired storage, HDD or SSD
    4. Provide a name for the storage ie  wordpress-storage
    5. Enter desired availability zone or leave on auto
    6. Enter desired storage size in GB
    7. Click on image and select IONOS Images and then select Ubuntu 20.04-LTS-server-cloud-init.qcow2
    8. For password, enter the desired root password (optionally you can use SSH keys) Note:  This field can only take alphanumeric, no special characters like *!@# etc…
    9. Make sure “Boot from device” is checked and click “Create HDD Storage”
  • If you have selected the correct image you should see a section appear called “Cloud-Init user data” click in this field to enter the cloud-init script
  • In the Cloud-Init User Data screen, paste the following
Copy to Clipboard
  • Click on Provision Changes to begin the setup/install
  • Once the server has been provisioned, you can watch the wordpress installation progress by right clicking on the server instance and selecting console, no need to login yet
  • You will know when the installation is complete once you see a line that says OK “Finished Execute Cloud user/final scripts” 

NOTE:  Write down the Database Name, Database User, Database Password and Mysql root password that were generated during installation, these should be listed slightly higher up in the console.  You can also get these password later in the /var/log/cloud-init-output.log file

  • You can now finish the wordpress setup via the browser by going to the IP address of the instance that was just created.  Get the IP address by clicking on the instance and going to the Network section on the right NAV.  Copy the IP address listed in “Primary IPv4” and paste this into a web browser
  • Provide a Site Title, username and password for the wordpress site, this username and password will be created as the administrator user in wordpress.
  • The WordPress install is now complete

Github

Download

Copy to Clipboard