Install the CQL shell

The CQL shell (cqlsh) is a Python-based command-line shell you can use to issue Cassandra Query Language (CQL) statements to your DataStax Enterprise (DSE) databases. The CQL shell also provides unique cqlsh commands like DESCRIBE KEYSPACE.

There are several ways to access the CQL shell, depending on your environment:

Environment CQL shell Notes

DSE tarball installation

Run the included CQL shell binary.

A supported Python version is required.

DSE package installation

A supported Python version is required.

DSE not installed

A supported Python version is required.

DSE Docker container

Use the Docker-bundled CQL shell.

A supported Python version is required.

Install Python

CQL shell requires Python.

DataStax recommends version 3.8 to 3.11. Later Python versions aren’t supported by DSE 5.1.

Use earlier versions (2.7, 3.6, or 3.7) only if required to support a legacy deployment running an early patch release of DSE 5.1 where your OS or the included cqlsh binary doesn’t support a recommended Python version.

If you have multiple Python versions installed, run cqlsh in a virtual environment that uses a supported Python version.

To verify your Python version, run python -V.

Early CentOS versions requiring Python 2.7

If you are running DSE 5.1 on an early CentOS version that requires Python 2.7, install it from the Software Collections (SCL) Repository:

  1. Run the following commands:

    sudo yum update
    sudo yum install scl-utils
    sudo yum install centos-release-scl-rh
    sudo yum install python27
    sudo scl enable python27 bash
  2. Check your Python version to confirm that it is 2.7.

  3. Restart the system, or log out and log back in, and then enable Python 2.7:

    sudo scl enable python27 bash

    Enabling Python 2.7 in .bash_profile or .bashrc causes the machine to hang because CentOS 6 relies on Python 2.6 for Yum.

Install the standalone CQL shell for DSE 5.1.51 or later

To install the standalone CQL shell tool, you need a cqlsh binary tarball file. These files are available from IBM Fix Central in the DSE fix packs for each DSE version.

Download the DSE fix pack for your current DSE version, and then extract the cqlsh distribution:

  1. Find DSE fix packs on IBM Fix Central:

    1. Go to Fix Central.

    2. In the Product selector field, begin typing IBM DataStax Enterprise, and then select that option from the menu.

    3. In the Release field, select the version that you want to install.

    4. Click Continue.

    5. On the Identify fixes page, click Continue to use the default Browse for fixes option.

    6. On the Select fixes page, select the fix pack (DSE version) you want to install, and then click Continue.

      Depending on the product and version, more fix packs might be available if you set the Platform filter to All, and then click Submit.

    7. If prompted, sign in with your IBMid.

      An IBMid account with MFA enabled is required. If you don’t have one, create an IBMid account. If your organization uses Enterprise Federation (EF) for authentication with corporate credentials, see the IBMid EF documentation.

    8. On the Download options page, select Download using your browser (HTTPS), and then click Continue.

    9. Review the terms and conditions, and then click I agree to activate the download links.

  2. Click the appropriate dse-VERSION-tgz.zip link to download the fix pack for your DSE patch release version.

  3. Wait for the fix pack to download, and then unzip the downloaded file:

    unzip dse-VERSION-tgz.zip
  4. Change to the unzipped directory:

    cd dse-VERSION-tgz
  5. Extract the cqlsh distribution into the directory where you want to install cqlsh:

    tar -xzvf cqlsh-VERSION-bin.tar.gz -C /PATH/TO/INSTALL/DIRECTORY

Install the standalone CQL shell for DSE 5.1.50 or earlier

To install the standalone CQL shell tool, you need a cqlsh binary tarball file. These files are available from IBM Fix Central in the DSE fix packs for each DSE version.

Find the DSE fix pack for your current DSE version, download the cqlsh binary tarball from that fix pack, and then extract the distribution:

  1. Find DSE fix packs on IBM Fix Central:

    1. Go to Fix Central.

    2. In the Product selector field, begin typing IBM DataStax Enterprise, and then select that option from the menu.

    3. In the Release field, select the version that you want to install.

    4. Click Continue.

    5. On the Identify fixes page, click Continue to use the default Browse for fixes option.

    6. On the Select fixes page, select the fix pack (DSE version) you want to install, and then click Continue.

      Depending on the product and version, more fix packs might be available if you set the Platform filter to All, and then click Submit.

    7. If prompted, sign in with your IBMid.

      An IBMid account with MFA enabled is required. If you don’t have one, create an IBMid account. If your organization uses Enterprise Federation (EF) for authentication with corporate credentials, see the IBMid EF documentation.

    8. On the Download options page, select Download using your browser (HTTPS), and then click Continue.

    9. Review the terms and conditions, and then click I agree to activate the download links.

  2. Click the cqlsh-VERSION-bin.tar.gz link to download the cqlsh binary tarball.

    The version number depends on your fix pack version.

  3. Wait for the file to downloaded, and then extract the distribution into the directory where you want to install cqlsh:

    tar -xzvf cqlsh-VERSION-bin.tar.gz -C /PATH/TO/INSTALL/DIRECTORY

Use the tarball-bundled CQL shell

If you installed DSE from a tarball, you can find cqlsh in the bin directory of your DSE installation directory.

Make sure you have a supported Python version.

Use the Docker-bundled CQL shell

If you are running a DSE Docker container, you can run the cqlsh script inside the container. This script is located in DSE_INSTALL_DIRECTORY/bin/.

You can also start CQL shell with docker exec. For an example, see Attach to a container.

Was this helpful?

Give Feedback

How can we improve the documentation?

© Copyright IBM Corporation 2026 | Privacy policy | Terms of use |  Manage Privacy Choices

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: Contact IBM