General prerequisites

Before you install the DC/OS CLI, ensure the following:

  • You have a separate computer that is not part of the DC/OS cluster on which you can install the CLI.
  • You must have network access from the external system hosting the CLI to the DC/OS cluster.
  • You can open a command-line shell terminal on the external system hosting the CLI.
  • You are not using noexec to mount the /tmp directory. Mounting the /tmp directory with the noexec option can prevent CLI operations.

The recommended method to install the DC/OS CLI is from the DC/OS web interface. Or, you can manually install the CLI by using the instructions below.

Installing CLI from the web interface

  1. At the top-left corner of the DC/OS web interface, click the down arrow to the right of your cluster name.

    open cluster popup

  2. Select Install CLI.

    CLI install UI

  1. Copy and paste the code snippets into your terminal.

    CLI copy/paste

Manually installing the CLI

Installing on Linux

Prerequisites

  • You must have a separate computer that is not part of the DC/OS cluster on which you can install the CLI.
  • You must have network access from the external system hosting the CLI to the DC/OS cluster.
  • You must be able to open a command-line shell terminal on the external system hosting the CLI.
  • You nust be able to run cURL program on the system hosting the CLI. The curl command is installed by default on most Linux distributions.
  • You must not be using noexec to mount the /tmp directory. Mounting the /tmp directory with the noexec option can prevent CLI operations.

Installing the DC/OS CLI

  1. If you do not already have a working directory for the CLI, create one. The preferred location is /usr/local/bin and all the instructions will reference this path.

    [ -d usr/local/bin ] || sudo mkdir -p /usr/local/bin
    
  2. Download the DC/OS CLI binary (dcos) to your local directory (for example, /usr/local/bin/).

    curl https://downloads.dcos.io/binaries/cli/linux/x86-64/dcos-1.9/dcos -o dcos
    
  3. Move the CLI binary to your local bin directory.

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

    chmod +x /usr/local/bin/dcos
    
  5. Point the CLI to your DC/OS cluster URL. In this example, http://example.com is the master node IP address.

    dcos config set core.dcos_url http://example.com
    
  6. Authenticate your CLI with your master node and set the auth token:

    dcos auth login
    

    Follow the instructions in the DC/OS CLI. For more information about security, see Security.

    Your CLI should now be authenticated with your cluster.

  7. Type dcos to view usage information and get started.

Installing on macOS

Prerequisites

  • You must have a separate computer that is not part of the DC/OS cluster on which you can install the CLI.
  • You must have network access from the external system hosting the CLI to the DC/OS cluster.
  • You must be able to open a command-line environment, such as Terminal, on the external system hosting the CLI.
  • You must not be using noexec to mount the /tmp directory. Mounting the /tmp directory with the noexec option can prevent CLI operations.

Installing the DC/OS CLI

  1. If you do not already have a working directory for the CLI, create one. The preferred location is /usr/local/bin and all the instructions will reference this path.

    [ -d usr/local/bin ] || sudo mkdir -p /usr/local/bin
    
  2. Download the DC/OS CLI binary (dcos) to your local directory (for example, /usr/local/bin/).

    curl https://downloads.dcos.io/binaries/cli/darwin/x86-64/dcos-1.9/dcos -o dcos
    

    Important: The CLI must be installed on a system that is external to your DC/OS cluster.

  3. Move the CLI binary to your local bin directory.

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

    chmod +x dcos
    
  5. Point the CLI to your DC/OS master node. In this example, http://example.com is the master node IP address.

    dcos config set core.dcos_url http://example.com
    
  6. Authenticate your CLI with your master node and set the auth token.

    dcos auth login
    

    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.

    Follow the instructions in the DC/OS CLI. For more information about security, see Security.

    Your CLI should now be authenticated with your cluster.

  7. Type dcos to view usage information and get started.

Installing on Windows

Prerequisites

  • You must have a separate computer that is not part of the DC/OS cluster on which you can install the CLI.
  • You must have network access from the external system hosting the CLI to the DC/OS cluster.
  • You must be able to open a command-line environment, such as Windows PowerShell or the cmd.exe program, on the external system hosting the CLI. Windows PowerShell is installed by default on Windows 7 and later.
  • You nust disable any security or antivirus software before you start the installation.
  • You must not be using noexec to mount the /tmp directory. Mounting the /tmp directory with the noexec option can prevent CLI operations.
  1. Run command-line environment as Administrator.

  2. Download the DC/OS CLI executable to your local directory (dcos.exe).

  3. Point the CLI to your DC/OS master node. In this example, http://example.com is the master node IP address.

    dcos config set core.dcos_url http://example.com
    
  4. Authenticate your CLI with your master node:

    dcos auth login
    

    Follow the instructions in the DC/OS CLI. For more information about security, see Security.

    Your CLI should now be authenticated with your cluster.

  5. Type dcos to view usage information and get started.