Can’t listen 8123 port from Clickhouse Docker in Wndows
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
This command maps port 8123 on the container to port 8123 on the host. If ClickHouse is not accessible, confirm that this mapping is correctly defined.
2. Windows Firewall Settings
The Windows firewall may block inbound connections to port 8123. To allow traffic through this port, modify the firewall settings:
- Search for Windows Defender Firewall in the start menu and open it.
- Click on "Advanced settings" and navigate to the "Inbound Rules".
- Create a new rule to allow TCP traffic on port 8123.
3. Check Docker Network Modes
Switching the network mode might rectify the issue, especially if using NAT causes complications. You can specify a different network mode—like bridge—when running your container:
4. Verify ClickHouse Configuration
Ensure that the ClickHouse configuration file (clickhouse-server.xml) is correctly set to open port 8123 for HTTP traffic. Typically, it should look like this:
5. Resolve Conflicting Port Usage
Identify if any other applications are using port 8123, which could block Docker. Use the following PowerShell command to see which service is using a specific port:
If another service is using the port, either stop that service or change the port used by ClickHouse.
Best Practices for Running ClickHouse in Docker on Windows
To ensure smoother execution, consider the following best practices:
- Regularly update Docker and Docker Desktop for the latest fixes and features.
- Adhere to Docker Compose for better multi-container management, along with simplified port and network setups.
- Use Docker logs to troubleshoot ClickHouse issues:
- Ensure system resources—like CPU and RAM—are adequately allocated to Docker for optimal performance.
Summary Table of Potential Issues and Solutions
| Issue | Possible Cause | Solution |
| Port not accessible | Incorrect Docker port mapping | Verify -p 8123:8123 syntax in run command |
| Firewall blocking connection | Default Windows firewall settings | Add an exception for TCP port 8123 |
| Incorrect network mode | Using NAT in a complex setup | Switch to a bridge or transparent network |
| Port already in use | Another service using port 8123 | Stop the conflicting service or change port |
| Misconfigured ClickHouse XML | Error in clickhouse-server.xml | Ensure <http_port>8123</http_port> is set |
By following the above guidance, you can systematically diagnose and resolve issues related to port 8123 with ClickHouse in Docker on a Windows environment. Adjust the configurations and settings according to your specific scenarios for optimal results.
Related reading
- Can't pull image from Azure Container Registry - pull denied
- Can't push docker image to gcloud
- Can't push image to Amazon ECR - fails with no basic auth credentials
- Can't push image to Amazon ECR - fails with no basic auth credentials
- can't open tensorboard 0.0.0.06006 or localhost6006
- Can't push to GitHub because of large file which I already deleted
- Can't run Curl command inside my Docker Container
- Celery & RabbitMQ running as docker containers Received unregistered task of type '...

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseSystem Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.