Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

How to Install Clickhouse on Ubuntu 22.04

Learn about Ubuntu 22.04, including Prerequisites, key uses, practical steps, common issues, and answers to frequently asked questions.

Table of Contents

This practical guide explains how to install clickhouse on ubuntu 22.04 with clear steps and useful context. It also covers common requirements, potential problems, and the details that can help you get better results.

This tutorial will show you how to install ClickHoof on Ubuntu 22.04.

Prerequisites

  • A server running Ubuntu 22.04.
  • The root password is configured on your server.

Install Required Dependencies

Before you begin, you should update and upgrade all system packages to an up-to-date version. You can update them by running the following command:

apt update -y apt upgrade -y

After upgrading all packages, run the following command to install other required packages:

apt-get install curl gnupg2 wget git apt-transport-https ca-certificates -y

Once all the necessary packages are installed, you can proceed to the next step.

Clickhouse Settings

By default, the ClickHouse package is not included in the default Ubuntu 22.04 repositories. So you will need to add the ClickHouse repository to your system.

First, download and add the GPG key with the following command:

gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 8919F6BD2B48D754 gpg --export --armor 8919F6BD2B48D754 | gpg --dearmour -o /etc/apt/trusted.gpg.d/clickhouse-key.gpg

Next, add the ClickHouse repository to APT with the following command:

echo "deb [arch=amd64] https://packages.clickhouse.com/deb stable main" | tee /etc/apt/sources.list.d/clickhouse.list

Next, update the repository and install the ClickHouse server and client packages with the following command:

apt-get update -y apt-get install clickhouse-server clickhouse-client -y

During the installation process, you will be asked to provide a password for the ClickHouse admin user as shown below:

Enter password for default user: Password for default user is saved in file /etc/clickhouse-server/users.d/default-password.xml. Setting capabilities for clickhouse binary. This is optional. chown -R clickhouse:clickhouse '/etc/clickhouse-server' ClickHouse has been successfully installed. Start clickhouse-server with: sudo clickhouse start Start clickhouse-client with: clickhouse-client --password Synchronizing state of clickhouse-server.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable clickhouse-server Created symlink /etc/systemd/system/multi-user.target.wants/clickhouse-server.service ? /lib/systemd/system/clickhouse-server.service. 

Once the installation is finished, you can proceed to the next step.

Start Clickhouse Service

Now you can start the ClickHouse service and enable it to start on system reboot with the following command:

systemctl start clickhouse-server systemctl enable clickhouse-server

You can now verify the status of the ClickHouse with the following command:

systemctl status clickhouse-server

You will get the following output:

? clickhouse-server.service - ClickHouse Server (analytic DBMS for big data) Loaded: loaded (/lib/systemd/system/clickhouse-server.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2022-12-05 14:47:40 UTC; 6s ago Main PID: 13369 (clckhouse-watch) Tasks: 205 (limit: 4579) Memory: 65.5M CPU: 1.128s CGroup: /system.slice/clickhouse-server.service ??13369 clickhouse-watchdog "" "" "" "" "" "" "" --config=/etc/clickhouse-server/config.xml --pid-file=/run/clickhouse-server/cl> ??13370 /usr/bin/clickhouse-server --config=/etc/clickhouse-server/config.xml --pid-file=/run/clickhouse-server/clickhouse-serve> Dec 05 14:47:40 ubuntu2204 systemd[1]: Started ClickHouse Server (analytic DBMS for big data). Dec 05 14:47:40 ubuntu2204 clickhouse-server[13369]: Processing configuration file '/etc/clickhouse-server/config.xml'. Dec 05 14:47:40 ubuntu2204 clickhouse-server[13369]: Logging trace to /var/log/clickhouse-server/clickhouse-server.log Dec 05 14:47:40 ubuntu2204 clickhouse-server[13369]: Logging errors to /var/log/clickhouse-server/clickhouse-server.err.log Dec 05 14:47:41 ubuntu2204 clickhouse-server[13370]: Processing configuration file '/etc/clickhouse-server/config.xml'. Dec 05 14:47:41 ubuntu2204 clickhouse-server[13370]: Saved preprocessed configuration to '/var/lib/clickhouse/preprocessed_configs/config.xml> Dec 05 14:47:41 ubuntu2204 clickhouse-server[13370]: Processing configuration file '/etc/clickhouse-server/users.xml'. Dec 05 14:47:41 ubuntu2204 clickhouse-server[13370]: Merging configuration file '/etc/clickhouse-server/users.d/default-password.xml'. Dec 05 14:47:41 ubuntu2204 clickhouse-server[13370]: Saved preprocessed configuration to '/var/lib/clickhouse/preprocessed_configs/users.xml'.

Conclusion

Understanding Ubuntu 22.04 makes it easier to compare options, avoid common mistakes, and apply the information in this guide more effectively. Review the relevant requirements before making changes or choosing a solution.

FAQ

How do you install clickhouse on ubuntu 22.04?

Follow the steps in this guide in order, confirm the required settings or tools, and verify the result before making additional changes.

Is it safe to install clickhouse on ubuntu 22.04?

It is generally safe when you follow the recommended instructions, use trusted tools, and avoid changing settings you do not understand.

What should you do if the process does not work?

Recheck the requirements, restart the device or application when appropriate, and review each step for missed settings or compatibility issues.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.