How to Configure Windows Sandbox Local ClickHouse Analytical Database via XML in Windows 11

Column-oriented analytical databases—such as ClickHouse—deliver blistering query performance for real-time analytics, event telemetry processing, and billion-row aggregations. However, running local ClickHouse server clusters directly on a developer workstation can consume gigabytes of storage, lock up background CPU cores during MergeTree merges, and cause port 8123/9000 conflicts. In Windows 11, Windows Sandbox provides a pristine, isolated testing platform. By authoring custom Windows Sandbox XML (.wsb) configuration files, you can deploy a standalone ClickHouse analytical engine in seconds.

Architecture of the Disposable ClickHouse Sandbox

Windows Sandbox provides a disposable, hypervisor-isolated guest environment that resets completely upon termination. To provision an automated ClickHouse instance, the architecture requires:

  • A mapped host folder: A directory containing the portable clickhouse.exe binary and minimal configuration XML files.
  • A WSB configuration file: An XML blueprint that mounts the mapped directory and initiates the analytical daemon automatically via LogonCommand.

Authoring the Windows Sandbox WSB Blueprint

Create a working directory on your host machine, such as C:\SandboxClickHouse. Download the Windows binary of ClickHouse into this directory, then create RunClickHouse.wsb with the following XML code:

<Configuration>
  <VGpu>Default</VGpu>
  <Networking>Default</Networking>
  <MappedFolders>
    <MappedFolder>
      <HostFolder>C:\SandboxClickHouse</HostFolder>
      <SandboxFolder>C:\ClickHouseFiles</SandboxFolder>
      <ReadOnly>false</ReadOnly>
    </MappedFolder>
  </MappedFolders>
  <LogonCommand>
    <Command>powershell.exe -ExecutionPolicy Bypass -NoExit -File C:\ClickHouseFiles\Start-ClickHouse.ps1</Command>
  </LogonCommand>
</Configuration>

Authoring ClickHouse Startup Script

Inside the mapped host folder (C:\SandboxClickHouse), create the PowerShell initialization script named Start-ClickHouse.ps1:

Write-Host "=============================================" -ForegroundColor Cyan
Write-Host " Starting ClickHouse Analytical Engine...    " -ForegroundColor Green
Write-Host " HTTP Interface: http://127.0.0.1:8123/play  " -ForegroundColor Yellow
Write-Host " Native Client:  127.0.0.1:9000              " -ForegroundColor Yellow
Write-Host "=============================================" -ForegroundColor Cyan

# Set working directory to mapped folder
Set-Location "C:\ClickHouseFiles"

# Ensure data directories exist
New-Item -Path "C:\ClickHouseFiles\data" -ItemType Directory -Force | Out-Null

# Launch ClickHouse server in local mode
& "C:\ClickHouseFiles\clickhouse.exe" server -- --path="C:\ClickHouseFiles\data" --http_port=8123 --tcp_port=9000

Running and Validating Analytics in the Sandbox

Double-click RunClickHouse.wsb on your Windows 11 host. Windows Sandbox boots up, mounts the mapped folder, and immediately launches ClickHouse inside an interactive PowerShell window.

The database server binds to port 8123 for HTTP and port 9000 for native TCP. Open Microsoft Edge inside the sandbox and navigate to http://127.0.0.1:8123/play to access the visual ClickHouse Play SQL web interface.

You can create MergeTree tables, ingest massive CSV and Parquet datasets, execute aggregate vector queries, and benchmark partition pruning in complete isolation. When testing concludes, closing the sandbox window instantly eliminates all columnar data parts, temporary scratch space, and server processes, leaving your host workstation completely clean.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.