Skip to content

Cloud-init

Cloud-init is a common way to automatically provision and configure Linux machines. OrbStack supports Cloud-init, so you can use the same configuration (user data) as AWS EC2 and other cloud providers.

This makes it easy to replicate, test, and debug environments locally before deploying to protection. It can also be a convenient way to provision development environments for your team.

See the Cloud-init docs for more information.

Screenshot: Cloud-init demo

Usage

Cloud-init user data files can be written in the YAML cloud-config format, or as simple shell scripts.

To create a machine with Cloud-init user data, use the -c or --user-data flag:

bash
orb create ubuntu my-machine -c user-data.yml
orb create ubuntu my-machine -c user-data.yml

Example

yaml
#cloud-config

# create group 'admingroup' with member 'root', and empty group 'cloud-users'
groups:
  - admingroup: [root]
  - cloud-users

# install package 'git'
packages:
  - git

# write file '/etc/cltest' with content 'it works!'
write_files:
- content: |
    it works!
  path: /etc/cltest
#cloud-config

# create group 'admingroup' with member 'root', and empty group 'cloud-users'
groups:
  - admingroup: [root]
  - cloud-users

# install package 'git'
packages:
  - git

# write file '/etc/cltest' with content 'it works!'
write_files:
- content: |
    it works!
  path: /etc/cltest

More examples are available in the Cloud-init docs.