> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-8a08bda2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Install ClickHouse on Redhat/CentOS Linux

# Install ClickHouse on rpm-based Linux distributions

<h1 id="from-rpm-packages">
  Install ClickHouse on rpm-based distributions
</h1>

> It is recommended to use official pre-compiled `rpm` packages for **CentOS**, **RedHat**, and all other rpm-based
> Linux distributions.

<Steps>
  <Step>
    <h2 id="review-recommendations">
      Review recommendations
    </h2>

    Before installing ClickHouse, review the following recommendations:

    * **Swap:** Disable the operating system's swap file in production environments.
    * **Disk space:** The ClickHouse binary requires at least 2.5 GB of disk space for installation.
    * **Network:** For distributed deployments (clustering), use at least 10 Gbit network connectivity. Network bandwidth is critical for processing distributed queries with large amounts of intermediate data, as well as for replication.

    **Estimating storage requirements**

    To estimate the disk space needed for your data:

    1. **Estimate data volume:** Take a sample of your data and calculate the average row size, then multiply by the number of rows you plan to store.
    2. **Apply the compression coefficient:** Load a sample into ClickHouse and compare the original data size with the stored table size. Clickstream data, for example, is typically compressed 6-10x.
    3. **Account for replicas:** If you plan to store data in multiple replicas, multiply the estimated volume by the number of replicas.

    For more detailed hardware requirements, see ["Sizing and hardware recommendations"](/guides/oss/best-practices/sizing-and-hardware-recommendations)
  </Step>

  <Step>
    <h2 id="setup-the-rpm-repository">
      Set up the RPM repository
    </h2>

    Add the official repository by running the following command:

    ```bash theme={null}
    sudo yum install -y yum-utils
    sudo yum-config-manager --add-repo https://packages.clickhouse.com/rpm/clickhouse.repo
    ```

    For systems with `zypper` package manager (openSUSE, SLES), run:

    ```bash theme={null}
    sudo zypper addrepo -r https://packages.clickhouse.com/rpm/clickhouse.repo -g
    sudo zypper --gpg-auto-import-keys refresh clickhouse-stable
    ```

    In the steps below, `yum install` can be replaced by `zypper install`, depending
    on which package manager you're using.
  </Step>

  <Step>
    <h2 id="install-clickhouse-server-and-client-1">
      Install ClickHouse server and client
    </h2>

    To install ClickHouse run the following commands:

    ```bash theme={null}
    sudo yum install -y clickhouse-server clickhouse-client
    ```

    * You can replace `stable` with `lts` to use different [release kinds](/resources/support-center/knowledge-base/setup-installation/production) based on your needs.
    * You can download and install packages manually from [packages.clickhouse.com/rpm](https://packages.clickhouse.com/rpm/stable).
    * To specify a particular version, add `-$version` to the end of the package name,
      for example:

    ```bash theme={null}
    sudo yum install clickhouse-server-22.8.7.34
    ```
  </Step>

  <Step>
    <h2 id="start-clickhouse-server-1">
      Start ClickHouse server
    </h2>

    To start ClickHouse server, run:

    ```bash theme={null}
    sudo systemctl enable clickhouse-server
    sudo systemctl start clickhouse-server
    sudo systemctl status clickhouse-server
    ```

    To start ClickHouse client, run:

    ```bash theme={null}
    clickhouse-client
    ```

    If you set up a password for your server, then you will need to run:

    ```bash theme={null}
    clickhouse-client --password
    ```
  </Step>

  <Step>
    <h2 id="install-standalone-clickhouse-keeper-1">
      Install standalone ClickHouse Keeper
    </h2>

    <Tip>
      In production environments we strongly recommend running ClickHouse Keeper on dedicated nodes.
      In test environments, if you decide to run ClickHouse Server and ClickHouse Keeper on the same server,
      then you don't need to install ClickHouse Keeper as it is included with ClickHouse server.
    </Tip>

    To install `clickhouse-keeper` on standalone ClickHouse Keeper servers, run:

    ```bash theme={null}
    sudo yum install -y clickhouse-keeper
    ```
  </Step>

  <Step>
    <h2 id="enable-and-start-clickhouse-keeper-1">
      Enable and start ClickHouse Keeper
    </h2>

    ```bash theme={null}
    sudo systemctl enable clickhouse-keeper
    sudo systemctl start clickhouse-keeper
    sudo systemctl status clickhouse-keeper
    ```
  </Step>
</Steps>
