2020-04-03 13:23:32 +00:00
---
2022-10-05 13:49:55 +00:00
sidebar_label: Install
keywords: [clickhouse, install, getting started, quick start]
2023-02-13 16:55:27 +00:00
description: Install ClickHouse
2022-10-05 13:49:55 +00:00
slug: /en/install
2020-04-03 13:23:32 +00:00
---
2023-02-24 18:26:37 +00:00
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import CodeBlock from '@theme/CodeBlock';
2023-02-13 16:54:41 +00:00
# Install ClickHouse
2022-10-05 13:49:55 +00:00
2022-12-19 22:29:31 +00:00
You have three options for getting up and running with ClickHouse:
2022-10-05 13:49:55 +00:00
2022-12-18 23:45:16 +00:00
- **[ClickHouse Cloud](https://clickhouse.com/cloud/):** The official ClickHouse as a service, - built by, maintained and supported by the creators of ClickHouse
2023-03-18 02:45:43 +00:00
- **[Quick Install](#quick-install):** an easy-to-download binary for testing and developing with ClickHouse
- **[Production Deployments](#available-installation-options):** ClickHouse can run on any Linux, FreeBSD, or macOS with x86-64, ARM, or PowerPC64LE CPU architecture
- **[Docker Image](https://hub.docker.com/r/clickhouse/clickhouse-server/):** use the official Docker image in Docker Hub
2022-10-05 13:49:55 +00:00
## ClickHouse Cloud
2023-02-16 21:21:51 +00:00
The quickest and easiest way to get up and running with ClickHouse is to create a new service in [ClickHouse Cloud ](https://clickhouse.cloud/ ).
2022-10-05 13:49:55 +00:00
2023-03-18 02:45:43 +00:00
## Quick Install
2019-12-05 16:36:51 +00:00
2023-02-25 17:17:33 +00:00
:::tip
2023-02-25 17:22:02 +00:00
For production installs of a specific release version see the [installation options ](#available-installation-options ) down below.
2023-02-25 17:17:33 +00:00
:::
2023-03-18 02:45:43 +00:00
On Linux and macOS:
2023-02-24 18:26:37 +00:00
2023-03-18 02:45:43 +00:00
1. If you are just getting started and want to see what ClickHouse can do, the simplest way to download ClickHouse locally is to run the following command. It downloads a single binary for your operating system that can be used to run the ClickHouse server, clickhouse-client, clickhouse-local,
ClickHouse Keeper, and other tools:
2023-02-24 18:26:37 +00:00
2022-12-19 13:22:03 +00:00
```bash
curl https://clickhouse.com/ | sh
```
1. Run the following command to start the ClickHouse server:
2023-02-24 18:26:37 +00:00
```bash
2023-03-18 02:45:43 +00:00
./clickhouse server
2023-02-24 18:26:37 +00:00
```
2023-03-18 02:45:43 +00:00
The first time you run this script, the necessary files and folders are created in the current directory, then the server starts.
2022-12-19 13:22:03 +00:00
2023-02-24 18:26:37 +00:00
1. Open a new terminal and use the **clickhouse-client** to connect to your service:
```bash
./clickhouse client
```
```response
./clickhouse client
ClickHouse client version 23.2.1.1501 (official build).
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 23.2.1 revision 54461.
local-host :)
```
You are ready to start sending DDL and SQL commands to ClickHouse!
2022-12-18 23:45:16 +00:00
:::tip
2023-03-18 02:45:43 +00:00
The [Quick Start ](/docs/en/quick-start.mdx ) walks through the steps for creating tables and inserting data.
2022-12-18 23:45:16 +00:00
:::
2023-03-18 02:45:43 +00:00
## Production Deployments {#available-installation-options}
For production deployments of ClickHouse, choose from one of the following install options.
2022-10-05 16:04:00 +00:00
2020-03-18 18:43:51 +00:00
### From DEB Packages {#install-from-deb-packages}
2019-12-05 16:36:51 +00:00
2020-04-28 16:39:50 +00:00
It is recommended to use official pre-compiled `deb` packages for Debian or Ubuntu. Run these commands to install packages:
2019-12-05 16:36:51 +00:00
2023-02-16 21:21:51 +00:00
#### Setup the Debian repository
2020-03-20 10:10:48 +00:00
``` bash
2022-04-09 13:29:05 +00:00
sudo apt-get install -y apt-transport-https ca-certificates dirmngr
2023-03-21 07:50:42 +00:00
GNUPGHOME=$(mktemp -d)
sudo GNUPGHOME="$GNUPGHOME" gpg --no-default-keyring --keyring /usr/share/keyrings/clickhouse-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 8919F6BD2B48D754
sudo rm -r "$GNUPGHOME"
sudo chmod +r /usr/share/keyrings/clickhouse-keyring.gpg
2022-03-07 11:20:55 +00:00
2023-03-16 16:17:56 +00:00
echo "deb [signed-by=/usr/share/keyrings/clickhouse-keyring.gpg] https://packages.clickhouse.com/deb stable main" | sudo tee \
2022-04-09 13:29:05 +00:00
/etc/apt/sources.list.d/clickhouse.list
sudo apt-get update
2023-02-16 21:21:51 +00:00
```
2022-04-09 13:29:05 +00:00
2023-02-16 21:21:51 +00:00
#### Install ClickHouse server and client
```bash
2022-04-09 13:29:05 +00:00
sudo apt-get install -y clickhouse-server clickhouse-client
2023-02-16 21:21:51 +00:00
```
#### Start ClickHouse server
2022-04-09 13:29:05 +00:00
2023-02-16 21:21:51 +00:00
```bash
2022-04-09 13:29:05 +00:00
sudo service clickhouse-server start
clickhouse-client # or "clickhouse-client --password" if you've set up a password.
```
2022-03-29 05:09:17 +00:00
2022-04-09 13:29:05 +00:00
< details >
2022-04-03 23:05:35 +00:00
< summary > Deprecated Method for installing deb-packages< / summary >
2022-04-09 13:29:05 +00:00
2022-03-07 11:20:55 +00:00
``` bash
2022-04-09 13:29:05 +00:00
sudo apt-get install apt-transport-https ca-certificates dirmngr
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv E0C56BD4
echo "deb https://repo.clickhouse.com/deb/stable/ main/" | sudo tee \
/etc/apt/sources.list.d/clickhouse.list
sudo apt-get update
sudo apt-get install -y clickhouse-server clickhouse-client
sudo service clickhouse-server start
clickhouse-client # or "clickhouse-client --password" if you set up a password.
2022-03-07 11:20:55 +00:00
```
2022-04-09 13:29:05 +00:00
2022-03-07 11:20:55 +00:00
< / details >
2022-10-25 07:27:52 +00:00
< details >
< summary > Migration Method for installing the deb-packages< / summary >
```bash
sudo apt-key del E0C56BD4
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 8919F6BD2B48D754
echo "deb https://packages.clickhouse.com/deb stable main" | sudo tee \
/etc/apt/sources.list.d/clickhouse.list
sudo apt-get update
sudo apt-get install -y clickhouse-server clickhouse-client
sudo service clickhouse-server start
clickhouse-client # or "clickhouse-client --password" if you set up a password.
```
< / details >
2023-03-18 02:45:43 +00:00
You can replace `stable` with `lts` to use different [release kinds ](/knowledgebase/production ) based on your needs.
2020-04-28 16:39:50 +00:00
2022-10-05 13:49:55 +00:00
You can also download and install packages manually from [here ](https://packages.clickhouse.com/deb/pool/main/c/ ).
2019-12-05 16:36:51 +00:00
2023-02-16 21:32:12 +00:00
#### Install standalone ClickHouse Keeper
:::tip
2023-05-12 16:07:38 +00:00
In production environment we [strongly recommend ](/docs/en/operations/tips.md#L143-L144 ) running ClickHouse Keeper on dedicated nodes.
2023-05-12 15:58:41 +00:00
In test environments, if you decide to run ClickHouse Server and ClickHouse Keeper on the same server, you do not need to install ClickHouse Keeper as it is included with ClickHouse server.
This command is only needed on standalone ClickHouse Keeper servers.
2023-02-16 21:32:12 +00:00
:::
2023-02-16 21:21:51 +00:00
```bash
sudo apt-get install -y clickhouse-keeper
```
#### Enable and start ClickHouse Keeper
```bash
sudo systemctl enable clickhouse-keeper
sudo systemctl start clickhouse-keeper
sudo systemctl status clickhouse-keeper
```
2020-03-20 10:10:48 +00:00
#### Packages {#packages}
2020-01-16 07:55:18 +00:00
2023-04-19 15:55:29 +00:00
- `clickhouse-common-static` — Installs ClickHouse compiled binary files.
- `clickhouse-server` — Creates a symbolic link for `clickhouse-server` and installs the default server configuration.
- `clickhouse-client` — Creates a symbolic link for `clickhouse-client` and other client-related tools. and installs client configuration files.
- `clickhouse-common-static-dbg` — Installs ClickHouse compiled binary files with debug info.
- `clickhouse-keeper` - Used to install ClickHouse Keeper on dedicated ClickHouse Keeper nodes. If you are running ClickHouse Keeper on the same server as ClickHouse server, then you do not need to install this package. Installs ClickHouse Keeper and the default ClickHouse Keeper configuration files.
2020-01-16 07:55:18 +00:00
2022-06-02 10:55:18 +00:00
:::info
2022-04-09 13:29:05 +00:00
If you need to install specific version of ClickHouse you have to install all packages with the same version:
`sudo apt-get install clickhouse-server=21.8.5.7 clickhouse-client=21.8.5.7 clickhouse-common-static=21.8.5.7`
:::
2021-09-08 15:06:24 +00:00
2020-03-20 10:10:48 +00:00
### From RPM Packages {#from-rpm-packages}
2019-12-05 16:36:51 +00:00
2020-03-27 06:02:21 +00:00
It is recommended to use official pre-compiled `rpm` packages for CentOS, RedHat, and all other rpm-based Linux distributions.
2019-12-05 16:36:51 +00:00
2023-02-17 20:55:55 +00:00
#### Setup the RPM repository
2020-03-19 06:53:47 +00:00
First, you need to add the official repository:
2019-12-05 16:36:51 +00:00
2020-03-20 10:10:48 +00:00
``` bash
2022-04-09 13:29:05 +00:00
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://packages.clickhouse.com/rpm/clickhouse.repo
2023-02-17 20:55:55 +00:00
```
2023-05-07 16:36:35 +00:00
For systems with `zypper` package manager (openSUSE, SLES):
2023-05-07 15:59:46 +00:00
``` bash
sudo zypper addrepo -r https://packages.clickhouse.com/rpm/clickhouse.repo -g
sudo zypper --gpg-auto-import-keys refresh clickhouse-stable
```
Later any `yum install` can be replaced by `zypper install` . To specify a particular version, add `-$VERSION` to the end of the package name, e.g. `clickhouse-client-22.2.2.22` .
2023-02-17 20:55:55 +00:00
#### Install ClickHouse server and client
```bash
2022-04-09 13:29:05 +00:00
sudo yum install -y clickhouse-server clickhouse-client
2023-02-17 20:55:55 +00:00
```
#### Start ClickHouse server
2022-04-09 13:29:05 +00:00
2023-02-17 20:55:55 +00:00
```bash
2023-02-17 21:08:12 +00:00
sudo systemctl enable clickhouse-server
sudo systemctl start clickhouse-server
sudo systemctl status clickhouse-server
2022-04-09 13:29:05 +00:00
clickhouse-client # or "clickhouse-client --password" if you set up a password.
2019-12-05 16:36:51 +00:00
```
2023-02-17 20:55:55 +00:00
#### Install standalone ClickHouse Keeper
:::tip
2023-05-12 16:07:38 +00:00
In production environment we [strongly recommend ](/docs/en/operations/tips.md#L143-L144 ) running ClickHouse Keeper on dedicated nodes.
2023-05-12 15:58:41 +00:00
In test environments, if you decide to run ClickHouse Server and ClickHouse Keeper on the same server, you do not need to install ClickHouse Keeper as it is included with ClickHouse server.
This command is only needed on standalone ClickHouse Keeper servers.
2023-02-17 20:55:55 +00:00
:::
```bash
sudo yum install -y clickhouse-keeper
```
#### Enable and start ClickHouse Keeper
```bash
sudo systemctl enable clickhouse-keeper
sudo systemctl start clickhouse-keeper
sudo systemctl status clickhouse-keeper
```
2022-03-07 11:20:55 +00:00
< details markdown = "1" >
< summary > Deprecated Method for installing rpm-packages< / summary >
2022-04-09 13:29:05 +00:00
2022-03-07 11:20:55 +00:00
``` bash
2022-04-09 13:29:05 +00:00
sudo yum install yum-utils
sudo rpm --import https://repo.clickhouse.com/CLICKHOUSE-KEY.GPG
sudo yum-config-manager --add-repo https://repo.clickhouse.com/rpm/clickhouse.repo
sudo yum install clickhouse-server clickhouse-client
sudo /etc/init.d/clickhouse-server start
clickhouse-client # or "clickhouse-client --password" if you set up a password.
2019-12-05 16:36:51 +00:00
```
2022-04-09 13:29:05 +00:00
2022-03-07 11:20:55 +00:00
< / details >
2019-12-05 16:36:51 +00:00
2023-03-18 02:45:43 +00:00
You can replace `stable` with `lts` to use different [release kinds ](/knowledgebase/production ) based on your needs.
2019-12-05 16:36:51 +00:00
2020-03-19 06:53:47 +00:00
Then run these commands to install packages:
2019-12-05 16:36:51 +00:00
2020-03-20 10:10:48 +00:00
``` bash
2019-12-05 16:36:51 +00:00
sudo yum install clickhouse-server clickhouse-client
```
2022-01-18 11:41:33 +00:00
You can also download and install packages manually from [here ](https://packages.clickhouse.com/rpm/stable ).
2019-12-05 16:36:51 +00:00
2020-04-08 14:22:25 +00:00
### From Tgz Archives {#from-tgz-archives}
2020-01-10 13:48:28 +00:00
2020-01-10 13:58:26 +00:00
It is recommended to use official pre-compiled `tgz` archives for all Linux distributions, where installation of `deb` or `rpm` packages is not possible.
2020-01-10 13:48:28 +00:00
2022-01-18 11:41:33 +00:00
The required version can be downloaded with `curl` or `wget` from repository https://packages.clickhouse.com/tgz/.
2022-02-16 03:22:20 +00:00
After that downloaded archives should be unpacked and installed with installation scripts. Example for the latest stable version:
2020-03-20 10:10:48 +00:00
``` bash
2022-04-09 13:29:05 +00:00
LATEST_VERSION=$(curl -s https://packages.clickhouse.com/tgz/stable/ | \
grep -Eo '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | sort -V -r | head -n 1)
export LATEST_VERSION
2022-06-29 10:33:20 +00:00
case $(uname -m) in
x86_64) ARCH=amd64 ;;
aarch64) ARCH=arm64 ;;
*) echo "Unknown architecture $(uname -m)"; exit 1 ;;
esac
2023-02-17 21:04:15 +00:00
for PKG in clickhouse-common-static clickhouse-common-static-dbg clickhouse-server clickhouse-client clickhouse-keeper
2022-06-29 10:33:20 +00:00
do
curl -fO "https://packages.clickhouse.com/tgz/stable/$PKG-$LATEST_VERSION-${ARCH}.tgz" \
|| curl -fO "https://packages.clickhouse.com/tgz/stable/$PKG-$LATEST_VERSION.tgz"
done
tar -xzvf "clickhouse-common-static-$LATEST_VERSION-${ARCH}.tgz" \
|| tar -xzvf "clickhouse-common-static-$LATEST_VERSION.tgz"
2022-04-09 13:29:05 +00:00
sudo "clickhouse-common-static-$LATEST_VERSION/install/doinst.sh"
2022-06-29 10:33:20 +00:00
tar -xzvf "clickhouse-common-static-dbg-$LATEST_VERSION-${ARCH}.tgz" \
|| tar -xzvf "clickhouse-common-static-dbg-$LATEST_VERSION.tgz"
2022-04-09 13:29:05 +00:00
sudo "clickhouse-common-static-dbg-$LATEST_VERSION/install/doinst.sh"
2022-06-29 10:33:20 +00:00
tar -xzvf "clickhouse-server-$LATEST_VERSION-${ARCH}.tgz" \
|| tar -xzvf "clickhouse-server-$LATEST_VERSION.tgz"
2022-08-26 18:14:10 +00:00
sudo "clickhouse-server-$LATEST_VERSION/install/doinst.sh" configure
2022-04-09 13:29:05 +00:00
sudo /etc/init.d/clickhouse-server start
2022-06-29 10:33:20 +00:00
tar -xzvf "clickhouse-client-$LATEST_VERSION-${ARCH}.tgz" \
|| tar -xzvf "clickhouse-client-$LATEST_VERSION.tgz"
2022-04-09 13:29:05 +00:00
sudo "clickhouse-client-$LATEST_VERSION/install/doinst.sh"
2020-01-10 13:48:28 +00:00
```
2022-03-07 11:20:55 +00:00
< details markdown = "1" >
2020-01-10 13:48:28 +00:00
2022-03-07 11:20:55 +00:00
< summary > Deprecated Method for installing tgz archives< / summary >
2022-04-09 13:29:05 +00:00
2022-03-07 11:20:55 +00:00
``` bash
2022-04-09 13:29:05 +00:00
export LATEST_VERSION=$(curl -s https://repo.clickhouse.com/tgz/stable/ | \
grep -Eo '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | sort -V -r | head -n 1)
curl -O https://repo.clickhouse.com/tgz/stable/clickhouse-common-static-$LATEST_VERSION.tgz
curl -O https://repo.clickhouse.com/tgz/stable/clickhouse-common-static-dbg-$LATEST_VERSION.tgz
curl -O https://repo.clickhouse.com/tgz/stable/clickhouse-server-$LATEST_VERSION.tgz
curl -O https://repo.clickhouse.com/tgz/stable/clickhouse-client-$LATEST_VERSION.tgz
tar -xzvf clickhouse-common-static-$LATEST_VERSION.tgz
sudo clickhouse-common-static-$LATEST_VERSION/install/doinst.sh
tar -xzvf clickhouse-common-static-dbg-$LATEST_VERSION.tgz
sudo clickhouse-common-static-dbg-$LATEST_VERSION/install/doinst.sh
tar -xzvf clickhouse-server-$LATEST_VERSION.tgz
sudo clickhouse-server-$LATEST_VERSION/install/doinst.sh
sudo /etc/init.d/clickhouse-server start
tar -xzvf clickhouse-client-$LATEST_VERSION.tgz
sudo clickhouse-client-$LATEST_VERSION/install/doinst.sh
2020-01-10 13:48:28 +00:00
```
2022-03-07 11:20:55 +00:00
< / details >
2020-01-10 13:48:28 +00:00
2020-03-20 10:10:48 +00:00
For production environments, it’ s recommended to use the latest `stable` -version. You can find its number on GitHub page https://github.com/ClickHouse/ClickHouse/tags with postfix `-stable` .
2020-01-10 13:48:28 +00:00
2020-03-20 10:10:48 +00:00
### From Docker Image {#from-docker-image}
2019-12-05 16:36:51 +00:00
2021-09-19 22:45:18 +00:00
To run ClickHouse inside Docker follow the guide on [Docker Hub ](https://hub.docker.com/r/clickhouse/clickhouse-server/ ). Those images use official `deb` packages inside.
2019-12-05 16:36:51 +00:00
2020-03-20 10:10:48 +00:00
### From Sources {#from-sources}
2019-12-05 16:36:51 +00:00
2022-12-21 15:14:07 +00:00
To manually compile ClickHouse, follow the instructions for [Linux ](/docs/en/development/build.md ) or [macOS ](/docs/en/development/build-osx.md ).
2019-12-05 16:36:51 +00:00
2022-12-19 19:27:15 +00:00
You can compile packages and install them or use programs without installing packages.
2019-12-05 16:36:51 +00:00
2022-12-19 19:27:15 +00:00
Client: < build_directory > /programs/clickhouse-client
Server: < build_directory > /programs/clickhouse-server
2019-12-05 16:36:51 +00:00
2022-12-19 19:27:15 +00:00
You’ ll need to create data and metadata folders manually and `chown` them for the desired user. Their paths can be changed in server config (src/programs/server/config.xml), by default they are:
2020-03-20 10:10:48 +00:00
2020-12-07 16:23:46 +00:00
/var/lib/clickhouse/data/default/
/var/lib/clickhouse/metadata/default/
2019-12-05 16:36:51 +00:00
2020-03-19 06:53:47 +00:00
On Gentoo, you can just use `emerge clickhouse` to install ClickHouse from sources.
2019-12-05 16:36:51 +00:00
2023-01-16 15:55:24 +00:00
### From CI checks pre-built binaries
2023-01-16 15:07:01 +00:00
ClickHouse binaries are built for each [commit ](/docs/en/development/build.md#you-dont-have-to-build-clickhouse ).
2020-03-20 10:10:48 +00:00
## Launch {#launch}
2019-12-05 16:36:51 +00:00
To start the server as a daemon, run:
2021-12-28 10:54:37 +00:00
``` bash
$ sudo clickhouse start
```
2022-05-22 10:19:18 +00:00
There are also other ways to run ClickHouse:
2021-12-28 10:54:37 +00:00
2019-12-05 16:36:51 +00:00
``` bash
$ sudo service clickhouse-server start
```
2021-05-27 19:44:11 +00:00
If you do not have `service` command, run as
2019-12-05 16:36:51 +00:00
``` bash
$ sudo /etc/init.d/clickhouse-server start
```
2021-12-28 01:27:04 +00:00
If you have `systemctl` command, run as
``` bash
$ sudo systemctl start clickhouse-server.service
```
2019-12-05 16:36:51 +00:00
See the logs in the `/var/log/clickhouse-server/` directory.
2021-05-27 19:44:11 +00:00
If the server does not start, check the configurations in the file `/etc/clickhouse-server/config.xml` .
2019-12-05 16:36:51 +00:00
You can also manually launch the server from the console:
``` bash
$ clickhouse-server --config-file=/etc/clickhouse-server/config.xml
```
In this case, the log will be printed to the console, which is convenient during development.
2021-05-27 19:44:11 +00:00
If the configuration file is in the current directory, you do not need to specify the `--config-file` parameter. By default, it uses `./config.xml` .
2019-12-05 16:36:51 +00:00
ClickHouse supports access restriction settings. They are located in the `users.xml` file (next to `config.xml` ).
By default, access is allowed from anywhere for the `default` user, without a password. See `user/default/networks` .
2022-10-05 13:49:55 +00:00
For more information, see the section [“Configuration Files” ](/docs/en/operations/configuration-files.md ).
2019-12-05 16:36:51 +00:00
After launching server, you can use the command-line client to connect to it:
``` bash
$ clickhouse-client
```
2020-03-19 06:53:47 +00:00
By default, it connects to `localhost:9000` on behalf of the user `default` without a password. It can also be used to connect to a remote server using `--host` argument.
2019-12-05 16:36:51 +00:00
The terminal must use UTF-8 encoding.
2022-10-05 13:49:55 +00:00
For more information, see the section [“Command-line client” ](/docs/en/interfaces/cli.md ).
2019-12-05 16:36:51 +00:00
Example:
2020-03-20 10:10:48 +00:00
2020-08-06 22:14:31 +00:00
```
2019-12-05 16:36:51 +00:00
$ ./clickhouse-client
ClickHouse client version 0.0.18749.
Connecting to localhost:9000.
Connected to ClickHouse server version 0.0.18749.
:) SELECT 1
SELECT 1
┌─1─┐
│ 1 │
└───┘
1 rows in set. Elapsed: 0.003 sec.
:)
```
**Congratulations, the system works!**
2022-10-05 13:49:55 +00:00
To continue experimenting, you can download one of the test data sets or go through [tutorial ](/docs/en/tutorial.md ).
2022-12-18 23:45:16 +00:00
2022-12-19 19:27:15 +00:00
## Recommendations for Self-Managed ClickHouse
2022-12-18 23:45:16 +00:00
2022-12-21 15:14:07 +00:00
ClickHouse can run on any Linux, FreeBSD, or macOS with x86-64, ARM, or PowerPC64LE CPU architecture.
2022-12-18 23:45:16 +00:00
2022-12-19 19:27:15 +00:00
ClickHouse uses all hardware resources available to process data.
2022-12-18 23:45:16 +00:00
2022-12-19 19:27:15 +00:00
ClickHouse tends to work more efficiently with a large number of cores at a lower clock rate than with fewer cores at a higher clock rate.
2022-12-18 23:45:16 +00:00
2022-12-19 19:27:15 +00:00
We recommend using a minimum of 4GB of RAM to perform non-trivial queries. The ClickHouse server can run with a much smaller amount of RAM, but queries will then frequently abort.
2022-12-18 23:45:16 +00:00
2022-12-19 19:27:15 +00:00
The required volume of RAM generally depends on:
2022-12-18 23:45:16 +00:00
2023-04-19 15:55:29 +00:00
- The complexity of queries.
- The amount of data that is processed in queries.
2022-12-18 23:45:16 +00:00
2022-12-19 19:27:15 +00:00
To calculate the required volume of RAM, you may estimate the size of temporary data for [GROUP BY ](/docs/en/sql-reference/statements/select/group-by.md#select-group-by-clause ), [DISTINCT ](/docs/en/sql-reference/statements/select/distinct.md#select-distinct ), [JOIN ](/docs/en/sql-reference/statements/select/join.md#select-join ) and other operations you use.
2022-12-18 23:45:16 +00:00
2022-12-19 19:27:15 +00:00
To reduce memory consumption, ClickHouse can swap temporary data to external storage. See [GROUP BY in External Memory ](/docs/en/sql-reference/statements/select/group-by.md#select-group-by-in-external-memory ) for details.
2022-12-18 23:45:16 +00:00
2022-12-19 19:27:15 +00:00
We recommend to disable the operating system's swap file in production environments.
2022-12-18 23:45:16 +00:00
2022-12-19 19:27:15 +00:00
The ClickHouse binary requires at least 2.5 GB of disk space for installation.
2022-12-18 23:45:16 +00:00
2022-12-19 19:27:15 +00:00
The volume of storage required for your data may be calculated separately based on
2022-12-18 23:45:16 +00:00
2023-04-19 15:55:29 +00:00
- an estimation of the data volume.
2022-12-18 23:45:16 +00:00
You can take a sample of the data and get the average size of a row from it. Then multiply the value by the number of rows you plan to store.
2023-04-19 15:55:29 +00:00
- The data compression coefficient.
2022-12-18 23:45:16 +00:00
To estimate the data compression coefficient, load a sample of your data into ClickHouse, and compare the actual size of the data with the size of the table stored. For example, clickstream data is usually compressed by 6-10 times.
To calculate the final volume of data to be stored, apply the compression coefficient to the estimated data volume. If you plan to store data in several replicas, then multiply the estimated volume by the number of replicas.
2022-12-19 19:27:15 +00:00
For distributed ClickHouse deployments (clustering), we recommend at least 10G class network connectivity.
2022-12-18 23:45:16 +00:00
2022-12-19 19:27:15 +00:00
Network bandwidth is critical for processing distributed queries with a large amount of intermediate data. Besides, network speed affects replication processes.