# Install ClickHouse on Centos 8

# Install ClickHouse on Centos 8

# add repo

sudo dnf install -y yum-utils

sudo yum-config-manager --add-repo https://packages.clickhouse.com/rpm/clickhouse.repo

# install

`sudo dnf install -y clickhouse-server clickhouse-client`

# start &amp; enable

`sudo systemctl enable --now clickhouse-server`

# open firewall (optional)

```
sudo firewall-cmd --permanent --add-port=8123/tcp
sudo firewall-cmd --permanent --add-port=9000/tcp
sudo firewall-cmd --reload

```

[![](https://wiki.exceltoquiz.com/uploads/images/gallery/2026-01/scaled-1680-/yIjqttGUMvWX6UvB-image-1769336352956.png)](https://wiki.exceltoquiz.com/uploads/images/gallery/2026-01/yIjqttGUMvWX6UvB-image-1769336352956.png)

Remember the top most &lt;listen\_host&gt;0.0.0.0&lt;/listen\_host&gt;

[![](https://wiki.exceltoquiz.com/uploads/images/gallery/2026-01/scaled-1680-/yDq4AweC1KwDyn4Y-image-1769336414925.png)](https://wiki.exceltoquiz.com/uploads/images/gallery/2026-01/yDq4AweC1KwDyn4Y-image-1769336414925.png)

[![](https://wiki.exceltoquiz.com/uploads/images/gallery/2026-01/scaled-1680-/WiLQumsjIs9omunB-image-1769336495936.png)](https://wiki.exceltoquiz.com/uploads/images/gallery/2026-01/WiLQumsjIs9omunB-image-1769336495936.png)

[![](https://wiki.exceltoquiz.com/uploads/images/gallery/2026-01/scaled-1680-/ENaSU6b7Eyv8WdPp-image-1769336563335.png)](https://wiki.exceltoquiz.com/uploads/images/gallery/2026-01/ENaSU6b7Eyv8WdPp-image-1769336563335.png)

[![](https://wiki.exceltoquiz.com/uploads/images/gallery/2026-01/scaled-1680-/1qMJ2pJmrlhhqB4m-image-1769336630494.png)](https://wiki.exceltoquiz.com/uploads/images/gallery/2026-01/1qMJ2pJmrlhhqB4m-image-1769336630494.png)

# test locally

clickhouse-client -q "SELECT version();"

# Configure Clickhouse Server Config file

` sudo nano /etc/clickhouse-server/config.xml`

Uncommet below this statement :

`<listen_host>0.0.0.0</listen_host>`

# Verify ClickHouse from DBeaver

# Run a test query:

SELECT version();

CREATE DATABASE IF NOT EXISTS demo ON CLUSTER default;

CREATE TABLE demo.test ON CLUSTER default ( ts DateTime, name String ) ENGINE = ReplicatedMergeTree() ORDER BY ts;

INSERT INTO demo.test (ts, name) VALUES (now(), 'Cluster Test 5');

CREATE TABLE demo.test\_distributed ON CLUSTER default AS demo.test ENGINE = Distributed('default', 'demo', 'test', rand());

select \* from demo.test\_distributed;

SELECT hostName(), ts, name FROM clusterAllReplicas('default', demo.test);