Documentation Index
Fetch the complete documentation index at: https://private-7c7dfe99-page-updates.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Install ClickHouse on NixOS
ClickHouse is available in the Nixpkgs repository and can be installed using Nix on Linux and macOS.
Review recommendations
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.
- 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.
- 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.
- Account for replicas: If you plan to store data in multiple replicas, multiply the estimated volume by the number of replicas.
Install ClickHouse using Nix
You can use Nix to install ClickHouse without permanently adding it to your system:clickhouse binary available in your current shell session.- The
nixpkgs#clickhousepackage provides the latest stable version. - The
nixpkgs#clickhouse-ltspackage provides the Long Term Support version. - Both packages work on Linux and macOS.
Permanent installation
To install ClickHouse permanently on your system:For NixOS users, add to yourconfiguration.nix:Start ClickHouse server
After installation, you can start the ClickHouse server:localhost:9000.For production use on NixOS, you may want to configure ClickHouse as a system service. Refer to the NixOS manual for available configuration options.About the Nix Package
The ClickHouse package in Nixpkgs includes:clickhouse-server- The ClickHouse database serverclickhouse-client- The command-line client for connecting to ClickHouseclickhouse-local- A tool for running SQL queries on local files- Other ClickHouse utilities