Depending on the version of the DC/OS CLI you have currently installed, you can choose to either update the CLI to the latest version for your cluster or to install a specific version. Also note, if you downloaded the CLI from PyPI or from the DC/OS UI version 1.7 or earlier, you must completely uninstall the CLI then install a new version of the software to upgrade.

Upgrade the CLI using the web interface

The recommended method to install the DC/OS CLI is by getting a preformatted set of commands from the DC/OS web interface and running them in the terminal. If the version of the CLI you have currently installed can be upgraded to the latest build, take the following steps to complete the upgrade.

  1. From the terminal, remove the current CLI binary. For example, if it was installed to /usr/local/bin/:

    rm -rf /usr/local/bin/dcos
    
  2. Then, navigate to your DC/OS web interface and click the down arrow to the right of your cluster name in the top right corner.

    open cluster popup

    Figure 1. Open cluster popup menu

  3. Select Install CLI to bring up the installation commands.

    CLI install UI

    Figure 2. Select Install CLI

  4. Copy and paste the code snippets appropriate to your OS into your terminal and press the return key. This automatically downloads, moves, and runs the setup command for the cluster. The last command to run, dcos, will display an overview of the dcos commands.

    CLI copy/paste

    Figure 3. Code snippet window

  5. Verify your cluster(s) by listing them:

    docs cluster list
    
                NAME                          ID                    STATUS    VERSION        URL           
    *  kjdskjd-ds-derr-1     0e2f90b-ded3-458b-8157-0365c8bd1ca4  AVAILABLE  1.10.0         http://example.com
       mr-clr-714024134      e71432a-8c60-48f0-bb14-ddf287775cdb  AVAILABLE  1.11-dev       http://example-1.com
    

Upgrading/Downgrading to a specific version of the CLI manually

  1. From the terminal, remove the current CLI binary. For example, if it was installed to /usr/local/bin/:

    rm -rf /usr/local/bin/dcos
    
  2. Download the DC/OS CLI binary dcos to your working directory by running the following command and replacing <target-os-type> with the OS type (darwin, linux, windows), and <dcos-version> with the version (such as 1.12), that you want to use:

    curl https://downloads.dcos.io/binaries/cli/<target-os-type>/x86-64/dcos-<dcos-version>/dcos -o dcos
    

    For example, the CLI download for a mac user on DC/OS 1.11 would look like this:

    curl https://downloads.dcos.io/binaries/cli/darwin/x86-64/dcos-1.11/dcos -o dcos
    
  3. Move the CLI binary to your local directory, which should be /usr/local/bin:

    sudo mv dcos /usr/local/bin
    
  4. Make the CLI binary executable:

    chmod +x /usr/local/bin/dcos
    
  5. Verify your cluster(s) by listing them:

    docs cluster list
    
                NAME                          ID                    STATUS    VERSION        URL           
    *  kjdskjd-ds-derr-1     0e2f90b-ded3-458b-8157-0365c8bd1ca4  AVAILABLE  1.10.0         http://example.com
       mr-clr-714024134      e71432a-8c60-48f0-bb14-ddf287775cdb  AVAILABLE  1.11-dev       http://example-1.com
    

If your system is unable to find the executable, you may need to re-open the command prompt or add the installation directory to your PATH environment variable manually.

For information about configuration options when using the DC/OS CLI, see Configuring the command-line interface. For information about authentication and authorization when using the DC/OS CLI, see the appropriate Security section.