Linode Command Line Interface (CLI)

Linode Command Line Interface
This tutorial focuses on the basics of installing and working with the Linode command-line interface (CLI).

 

Linode is an American-based cloud hosting company that offers Virtual Private Servers (VPS). The company’s name, “Linode”, is a portmanteau of the words “Linux” and “node”. Linode is the most comprehensive and independent open cloud provider serving businesses of all sizes. Cloud computing is the delivery of computing services, such as storage, servers, networking, databases, intelligence, software, analytics, etc., over the cloud. The mission of Linode cloud is to accelerate innovation by making cloud computing simple and accessible to everyone.

 

Linode cloud offers flexible resources, faster innovation, and economies of scale to all their customers. While using Linode cloud services, customers only need to pay for what they use, helping reduce the operating costs. In addition, Linode also helps to run the application infrastructure more efficiently. All the users of Linode cloud can scale up or down the resources whenever the business asks for them. 

 

Linode believes that virtual computing must be more affordable, accessible, and straightforward to expedite innovation in the cloud. The Linode’s Infrastructure as a Service (IaaS) platform is deployed across 11 global markets from its data centers around the globe. In addition, Linode cloud is supported by advanced APIs, comprehensive services, Next Generation Network, and a vast library of educational resources. The services, products, and people offered by Linode cloud helps developers and businesses to deploy, build, and scale applications more efficiently and cost-effectively in the cloud.

 

The Linode command-line interface is a wrapper around the Linode application programming interface (API) that allows users to manage their Linode account from the command line. Virtually any task performed through the Linode Manager can be performed through the command-line interface (CLI), making it an excellent tool for scripting. This tutorial describes the basics of installing and working with the Linode CLI. This tutorial also offers examples demonstrating how to complete common tasks using the Linode command-line interface (CLI).

 

Install the Linode CLI 

To install the command-line interface, follow the below steps: 

  • First, execute the following command to list the user’s support tickets: 

 

linode-cli tickets list

 

  • Then, open a new ticket by executing the following command:

 

linode-cli tickets create --description "Detailed description of the issue" --summary "Summary or quick title for the Ticket"

 

 >> Note: If the user’s issue concerns a particular Linode, Domain, Volume, or NodeBalancer, pass the ID with –domain_id, –volume_id, –linode-id, etc.

 

  • Execute the following command to list replies for a Ticket:

 

linode-cli tickets replies $ticket_id

 

  • Finally, reply to a Ticket by executing the following command:

 

linode-cli tickets reply $ticket_id --description "The content of the reply"

 

 

Options 

Help 

Users can view the information about any part of the command-line interface, including available actions and required parameters, with the –help flag:

linode-cli --help
linode-cli linodes --help
linode-cli linodes create --help

 

 

Customized Output Fields 

By default, the Linode CLI displays a set of pre-selected fields for each type of response. If the user would like to see all available fields, they can use the –all flag, as shown below:

 

linode-cli linodes list --all

 

If the user wants to specify which fields they would like to receive exactly, they can use the –format option, as shown below:

 

linode-cli linodes list --format 'id,region,memory'

 

JSON Output 

The command-line interface returns output in tabulated format for easy readability. If the user prefers to work with JSON, use the –json flag. Adding the –pretty flag to the command helps to format the JSON output to make it more readable, as shown below:

 

linode-cli regions list --json --pretty

 

[
  {
    "country": "us",
    "id": "us-central"
  },
  {
    "country": "us",
    "id": "us-west"
  },
  {
    "country": "us",
    "id": "us-southeast"
  },
  {
    "country": "us",
    "id": "us-east"
  },
  ...
]

 

Machine Readable Output 

Users can also display the output as plain text. By default, tabs are used as a delimiter, but the users can specify another character with the –delimiter option, as shown below:

 

linode-cli regions list --text

 

id	country
us-central	us
us-west	us
us-southeast	us
us-east	us
eu-west	uk
ap-south	sg
eu-central	de
ap-northeast	jp
ap-northeast-1a	jp
ca-east         ca

 

linode-cli regions list --text --delimiter ";"

 

id;country
us-central;us
us-west;us
us-southeast;us
us-east;us
eu-west;uk
ap-south;sg
eu-central;de
ap-northeast;jp
ap-northeast-1a;jp
ca-east;ca

 

Use the Linode CLI with Linode’s Platforms and Services

Account 

Users can perform the below tasks using the Linode command-line interface (CLI): 

  • view or update their account information, 
  • add payment methods, 
  • view notifications, 
  • make payments, 
  • create OAuth clients, and 
  • other related tasks.

 

To view the Linode account details, execute the following command: 

 

linode-cli account view

 

To view the account settings, execute the following command:

 

linode-cli account settings

 

In order to make payment in Linode account, execute the following command: 

 

linode-cli account payment-create --cvv 123 --usd 30.00

 

Execute the following command to view the account notifications: 

 

linode-cli account notifications-list

 

Domains 

Users can view the list of domains on their Linode account, create and delete domains, and create records for a domain using Linode command-line interface.

 

Execute the following command to list the domains on the user account: 

 

linode-cli domains list

 

To view all domain records in a specific domain, execute the following command: 

 

linode-cli domains records-list $domain_id

 

Execute the following command to delete a domain: 

 

linode-cli domains delete $domain_id

 

In order to create a domain, execute the following command: 

 

linode-cli domains create --type master --domain www.test.com --soa_email email@test.com

 

To create a new A record in a domain, execute the following command: 

 

linode-cli domains records-create $domain_id --type A --name subdomain --target 192.0.2.0

 

Events 

Users can view the list of events on their Linode account and mark events as read using the Linode command-line interface.

 

Execute the following command to view a list of events on the account:

linode-cli events list

 

 

To view details about a specific event, execute the following command: 

 

linode-cli events view $event_id

 

Execute the following command to mark an event as read: 

 

linode-cli events mark-read $event_id

 

Conclusion 

This tutorial presents the basics of installing and working with the Linode command-line interface (CLI). Hope this tutorial was helpful, and do reach out to us if you have any query or suggestions. 

Share this post

Services to Explore

Stay up to date!

Stay up to date with the Web Hosting, Cloud and Server Management Industry News and Tutorials!

We will send you only the relevant emails, and we respect your privacy. Please review our privacy policy for more info.

Managed Linode Services

Focus on your business, and let us take care of your Linode Servers!
From what you are reading, it seems you are interested in Linode and related technologies. If you have a moment to spare, please take a look at our Managed Linode plan, which might interest you even more!
Managed Linode

Value-Added Services

We have services that can help you run a successful business. With us, you don't have to worry about these areas because our experts will take care of it for you.

Introducing - WPHealers!

Complete WordPress Management, 24x7 Support & White Label Agency Plans!

WordPress migration service, security, white-label reseller services and lot more! Grab the introductory deals now!

WPHealers

ServerHealers uses cookies.