After installing ClickHouse via One-Click Apps, the server is essentially ready to use. However, before importing data or connecting applications, it is recommended to perform a basic initial configuration. This improves security, verifies that the server is working correctly, and prepares it for production use.
Step 1. Connect to the server
Connect to the virtual machine via SSH:
Make sure the ClickHouse service is running:
If the service is working correctly, you will see the status:
Step 2. Verify the database connection
Launch the ClickHouse client:
Check the connection with a simple query:
You can also check the current server time:
If both queries execute successfully, the server is fully ready to use.
Step 2.1. Check system resources and disk usage
Before working with ClickHouse, it is important to verify that the server has enough available resources for analytical workloads. ClickHouse is highly dependent on disk speed, memory, and CPU performance.
Check overall system usage:
Check disk space:
Check memory usage:
ClickHouse performs best when there is sufficient free RAM for caching and fast disk I/O. If resources are limited, consider optimizing table engines or adjusting server limits in configuration files.
Step 3. Create a separate database
It is not recommended to store user tables in the system database default.
Create a dedicated database:
Check the list of databases:
Switch to the new database:
Step 4. Create the first user
By default, ClickHouse uses the default user. For production environments, it is recommended to create a separate account with restricted permissions.
For example, you can create a user via SQL:
Grant access to the new database:
This ensures that the administrator account is not used for daily operations.
Step 4.1. Configure basic security settings
For production environments, it is recommended to strengthen ClickHouse security beyond default settings. This includes restricting access to the server and disabling unnecessary endpoints.
You can disable remote access for the default user by editing the user configuration file:
Set or update limits such as IP restrictions or password rules.
Example of restricting access to localhost only:
::1
127.0.0.1
After changes, restart ClickHouse:
This step helps reduce the risk of unauthorized access and improves overall server security.
Step 5. Enable remote connections (if needed)
If external applications or BI systems will connect to ClickHouse, make sure the server is listening on external interfaces.
Check the listen_host parameter:
Find the line:
If it is missing, add it to the server configuration section.
After making changes, restart the service:
Step 6. Open required ports
If UFW is enabled, allow incoming connections:
sudo ufw allow 8123/tcp
sudo ufw reload
Port 9000 is used by most ClickHouse clients, while 8123 is used for the HTTP API.
Step 7. Create your first table
To test the setup, create a sample table:
(
id UInt64,
event String,
created_at DateTime
)
ENGINE = MergeTree
ORDER BY id;
Verify that the table was created:
Step 8. Insert test data
Insert a few records:
(1,'Server started',now()),
(2,'Database configured',now());
Check the table contents:
If the records are displayed, the installation and initial setup were completed successfully.
Step 7.1. Optimize table design for better performance
When working with ClickHouse, table structure has a significant impact on query performance. Choosing the correct primary key and sorting strategy is essential for large datasets.
Instead of only using a simple ORDER BY clause, consider designing tables based on query patterns. For example, if most queries filter by date, it is better to include a time-based sorting key:
(
id UInt64,
event String,
created_at DateTime
)
ENGINE = MergeTree
ORDER BY (created_at, id);
For even better performance on large datasets, you can also add partitioning by date:
Proper table design reduces query time, improves compression efficiency, and helps ClickHouse scale more effectively with growing data volumes.
Recommended next steps
After the basic configuration, it is recommended to perform additional server setup:
- create users with different access levels;
- configure data backups;
- enable resource usage monitoring;
- restrict server access by IP addresses;
- set up replication if using multiple nodes;
- connect BI tools or ETL platforms.
After completing these steps, ClickHouse is fully ready for storing and analyzing large volumes of data, as well as integrating with analytics systems, applications, and monitoring services.
Deploy ClickHouse and other services in one click with Serverspace
With Serverspace you can significantly speed up the deployment of your infrastructure using ready-made One-Click Apps. Instead of manually installing and configuring databases, frameworks, or server tools, you can launch a fully working environment in just a few minutes.
Serverspace provides a wide range of preconfigured applications, including ClickHouse, PostgreSQL, MySQL, Redis, Docker, and many others. This allows you to focus on development and data processing instead of routine server setup.
Key advantages of One-Click Apps:
- Fast deployment — launch ClickHouse or other services in minutes without manual installation.
- Preconfigured environments — all essential dependencies are already optimized and ready to use.
- Scalability — easily upgrade CPU, RAM, or storage as your workload grows.
- Flexibility — combine multiple applications within a single cloud infrastructure.
- Global availability — deploy servers in different regions for lower latency.
Using One-Click Apps is especially useful for developers, DevOps engineers, and startups that need to quickly prototype or deploy production-ready services without deep infrastructure management.
You can explore available solutions and deploy your server directly on the Serverspace
FAQ
Does ClickHouse work on Ubuntu 22.04?
Yes, ClickHouse fully supports Ubuntu 22.04 (LTS), and this version is widely used in production environments.
What is the most reliable way to install ClickHouse on Ubuntu 22.04?
It is recommended to install it via the official ClickHouse APT repository, as it provides up-to-date stable releases and easy upgrades.
Is additional configuration required after installing ClickHouse?
Yes, after installation it is usually necessary to configure users, access permissions, memory limits, and settings in /etc/clickhouse-server/.
Can ClickHouse be used on a VPS with 1–2 GB RAM?
Technically yes, but for stable performance at least 4 GB of RAM is recommended, especially for analytical workloads.
How can I check if ClickHouse is running correctly?
You can use the clickhouse-client command or check the service status via systemctl status clickhouse-server.
Is ClickHouse suitable for small projects?
Yes, but its full potential is realized in large-scale analytics. For simple CRUD workloads, PostgreSQL or MySQL are often better choices.