Overview
Pass acloud_init script when procuring an offer to configure the instance automatically on first boot. Two formats are supported:
Cloud-config YAML
Use#cloud-config for declarative configuration — package installation, file creation, and commands:
packages— apt packages to installwrite_files— files to create (with optional permissions)runcmd— shell commands to run after boot
Shell script
Use#!/bin/bash for full shell scripting control:
How it works
The cloud-init script is injected into the instance’s startup script. Some vendors support native cloud-init (Lambda Labs, Nebius), while others convert the script to bash commands automatically. The conversion is transparent — you always pass the same#cloud-config YAML or #!/bin/bash script regardless of vendor.
Verifying cloud-init ran
SSH into the instance and check your expected outputs:Limitations
- Cloud-init runs once on first boot only
- Maximum script size varies by vendor (generally 16KB-64KB)
#cloud-configpackagesdirective requiresapt(Ubuntu/Debian images)- Some vendors may have delays between instance readiness and cloud-init completion