Use cloud-init
How to configure instances at boot with cloud-init user data, network config, and vendor data, and how to manage SSH keys.
cloud-init lets you configure an instance at boot: create users, install packages, write files, set up networking, and add SSH keys. Akasha exposes cloud-init settings in the instance and profile configuration forms.
cloud-init only works with images that have the cloud-init package installed. Most cloud variants in the public image catalog do; minimal images and custom-ISO installs may not.
Edit cloud-init configuration
Open the instance's Configuration tab and go to the Cloud init section (the same section exists on the create form and in profiles). Three YAML documents are available:
| Field | Config key | Purpose |
|---|---|---|
User data | cloud-init.user-data | The main cloud-init document (#cloud-config): users, packages, files, commands. |
Network config | cloud-init.network-config | Network interface configuration applied by cloud-init. |
Vendor data | cloud-init.vendor-data | Like user data, but intended for settings supplied alongside the image; user data takes precedence where they overlap. |
Each field shows the value inherited from profiles and its source, with the usual override and clear-override controls — see Configure instances.
Example user data:
#cloud-config
packages:
- nginx
runcmd:
- systemctl enable --now nginx
Note that cloud-init applies most user data only when an instance is initialized for the first time — set it at creation time (or in a profile) rather than editing it on a long-running instance and expecting changes to apply.
Manage SSH keys
The SSH keys section (on the create form and in the Main configuration section when editing) manages public keys that cloud-init installs for you. Each key has a name, a target Linux user (default root), and the public key itself.
Click New SSH key and pick a source:
- Clipboard — paste a public key.
- Generate key — generate a keypair in the browser; the private key is downloaded to your machine and never stored by Akasha.
- File upload — upload a public key file.
- GitHub — import a user's public keys, stored as
gh:<username>. - Launchpad — import a user's public keys, stored as
lp:<username>.
How keys are applied:
- Keys take effect when the instance is created or restarted — adding a key to a running instance does nothing until the next restart.
- The image must have cloud-init installed.
- Keys are never removed automatically: deleting a key from the configuration does not remove it from the instance's
authorized_keys; remove it inside the instance. - Keys inherited from a profile can be detached for a specific instance (and reattached later).
Once your key is applied, see Access instances for making the instance reachable over SSH.