Installing the CLI
Installing the DC/OS command line interface
The recommended method to install the DC/OS CLI is by getting the preformatted set of commands from the DC/OS UI and running them in the terminal. See the prerequisites and instructions for your operating system for more information:
Prerequisites
Common 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 must not be using the
noexec
to mount the/tmp
directory unless you have set aTMPDIR
environment variable to something other than the/tmp
directory. Mounting the/tmp
directory with thenoexec
option can prevent CLI operations.
Prerequisites for Linux
- You must be able to run
cURL
program on the system hosting the CLI. Thecurl
command is installed by default on most Linux distributions. - If you are using Fedora 30 or above, you must install the
libcrypt
library. You can install the library by runningsudo dnf install libxcrypt-compat
.
Prerequisites for macOS
- You must be running MacOS 10.10 Yosemite (deprecated), or later. The next version of the DC/OS CLI will require macOS 10.11 El Capitan or later.
- A model running on a Haswell CPU (2014), or later.
- You must be able to run
cURL
program on the system hosting the CLI. If you don’t havecURL
, follow the instructions in Install curl on macOS to install it.
Prerequisites for Windows
- Windows 10 64-bit or later.
- You must disable any security or antivirus software before you start the installation.
Installing the CLI using the UI
At the top-right corner of the DC/OS UI, click the down arrow to the right of your cluster name.
Figure 1. Open cluster popup menu
Select Install CLI.
Figure 2. Select Install CLI
Copy and paste the code snippets appropriate to your OS into your terminal, and press the return key.
Once the dcos information screen has been displayed, run the command
dcos cluster list
to verify the connection to the cluster has been established.
Installing the DC/OS CLI manually on Linux
It is strongly recommended that you copy and paste the installation commands from the UI of the cluster to which you want to connect. Following below are the instructions for step by step installation of the CLI.
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
Download the DC/OS CLI binary to your local directory by running the following command:
curl https://downloads.dcos.io/cli/releases/binaries/dcos/linux/x86-64/latest/dcos -o dcos
Move the CLI binary to your local bin directory.
sudo mv dcos /usr/local/bin
Make the CLI binary executable.
chmod +x /usr/local/bin/dcos
Set up the connection from the CLI to your DC/OS cluster. In this example,
http://example.com
is the master node URL.dcos cluster setup http://example.com
Follow the instructions in the DC/OS CLI. For more information about security, see Security.
Your CLI should now be authenticated with your cluster! Enter
dcos
to get started. You can learn more about managing your cluster connections here.
Installing the DC/OS CLI manually on macOS
The first two steps of this tutorial can be replaced by a simple brew install dcos-cli
if you have Homebrew installed.
Download the DC/OS CLI binary to your local directory by running the following command:
curl https://downloads.dcos.io/cli/releases/binaries/dcos/darwin/x86-64/latest/dcos -o dcos
Make the CLI binary executable.
chmod +x dcos
Set up the connection from the CLI to your DC/OS cluster. In this example,
http://example.com
is the master node URL.dcos cluster setup http://example.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.
Follow the instructions in the DC/OS CLI. For more information about security, see the documentation.
Your CLI should now be authenticated with your cluster!
Type
dcos
to view usage information and get started.
Installing the DC/OS CLI manually on Windows
Open the command line environment using the Administrator credentials.
Download the DC/OS CLI binary to your local directory by running the following command:
curl https://downloads.dcos.io/cli/releases/binaries/dcos/windows/x86-64/latest/dcos.exe -o dcos
Change into the directory of the downloaded file if you are not already there.
cd path/to/download/directory
Set up the connection from the CLI to your DC/OS cluster. In this example,
http://example.com
is the master node URL.dcos cluster setup http://example.com
NOTE: 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 the documentation.
Your CLI should now be authenticated with your cluster! Enter
dcos
to get started.