Linode CLI cheatsheet

Basic Linode CLI commands

view on github

Linode cloud services

✔️ help commands

# account information commands
linode-cli account --help
# available linodes related commands
linode-cli linodes --help
# available firewalls related commands
linode-cli firewalls --help
# ip addresses management actions
linode-cli networking --help

✔️ list instance types, images and regions available for provisioning

# list instance types
linode-cli linodes types
# list regions (linode-cli regions list)
linode-cli regions list
# list images
linode-cli images list
# list private provisioning scripts
linode-cli stackscripts list --is_public false

✔️ start, stop and delete linodes

# list instances with their IDs
linode-cli linodes list

# autocompletion is NOT available
linode-cli linodes boot "$linode_id"
linode-cli linodes shutdown "$linode_id"
linode-cli linodes delete "$linode_id"

✔️ add a new provisioning script to the account

# script specifics
script_title="debian-minimal"
image="linode/debian11"
script="$(realpath ./linode.minimal.provision.sh)"
desc="minimal provisioning script for tests"

# scripts are managed at account level + make script private
linode-cli stackscripts create \
--label "$script_title" \
--images "$image" \
--script "$script" \
--description "$desc" \
--is_public false

✔️ update an existing provisioning script

# script specifics
script_title="debian-minimal"
script="$(realpath ./linode.minimal.provision.sh)"

# retrieve script id
script_id=$(linode-cli stackscripts list --label "$script_title" --no-headers --format id --text)

# update script
linode-cli stackscripts update "$script_id" --script "$script"

Useful links