Skip to content

CloudPanel cloud-init script

Some Cloud proviers like e.g. Hetzner (referal link) can use cloud-init to automatically run commands when setting up a new server. The example below will install CloudPanel on a new Ubuntu or Debian system and set up the admin user as defined here. So after the installation is done you can just navigate to the admin UI and login.

#cloud-config

packages:
  - curl
  - wget
  - sudo
package_update: true
package_upgrade: true

runcmd:
  - curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o /tmp/install.sh
  - sudo CLOUD=hetzner DB_ENGINE=MARIADB_10.11 bash /tmp/install.sh
  - sudo /usr/bin/clpctl user:add --userName='john.doe' --email='john.doe@domain.com' --firstName='John' --lastName='Doe' --password='!password!' --role='admin' --timezone='UTC' --status='1'
  - reboot

Check out the CloudPanel documentation for the various installation options such as selecting the database engine you want to use. You can also adjust the CLOUD parameter to adapt the script for other cloud providers.