I would like to perform common automated configuration tasks and run commands/scripts after the LXD instance starts. How to use cloud-init to run commands on my Linux Container (LXD) instance at launch time? LXD can use the cloud-init directive to run commands or scripts at the first boot cycle when you launch an instance using the lxc command.