The Rancher Command Line Interface (CLI) is a unified tool for interacting with your Rancher Server.
For usage information see: https://rancher.com/docs/rancher/v2.x/en/cli/
Note: This is for version 2.x.x of the cli, for info on 1.6.x see here
Check the releases page for direct downloads of the binary. After you download it, you can add it to your $PATH
or build your own from source.
The CLI requires your Rancher Server address, along with credentials for authentication. Rancher CLI pulls this information from a JSON file, cli2.json
, which is created the first time you run rancher login
. By default, the path of this file is ~/.rancher/cli2.json
.
$ rancher login https://<RANCHER_SERVER_URL> -t my-secret-token
Note: When entering your
<RANCHER_SERVER_URL>
, include the port that was exposed while you installed Rancher Server.
Run rancher --help
for a list of available commands.