Install the Elastic CLI
You need Node.js 22 or later and npm (included with Node.js) installed on your system. The CLI is tested on Linux, macOS, and Windows.
Install the
elasticbinary to yourPATH:npm install -g @elastic/cliVerify the installation:
elastic --version
To run a one-off command without a permanent install, use npx:
npx -y @elastic/cli --help
- Configure the Elastic CLI to connect to your Elasticsearch, Kibana, or Elastic Cloud endpoints.