Skip to main content
This page isn’t applicable to ClickHouse Cloud. The feature documented here isn’t available in ClickHouse Cloud services. See the ClickHouse Cloud Compatibility guide for more information.
ClickHouse’s s3 table function and S3 disk type are compatible with SeaweedFS, an open-source distributed object store with an S3-compatible gateway. SeaweedFS serves path-style requests natively, so a self-hosted store works without wildcard DNS. SeaweedFS also supports Iceberg tables: its table buckets store the table data as Parquet files, and the built-in Iceberg REST catalog serves the table metadata - see the SeaweedFS catalog guide for querying them through the same endpoint. Use SeaweedFS 4.42 or newer. Earlier versions can delete an object whose write commits while its parent folder is being removed for being empty, which surfaces as Object ... suddenly disappeared right after a successful write.

Running SeaweedFS locally

For a local test setup, create a file s3config.json with the S3 credentials:
Then start the whole SeaweedFS stack in one container - the -bucket flag creates the bucket on startup:
The S3 endpoint listens on port 8333; wait for it to respond before continuing:
More buckets can be created at any time with echo "s3.bucket.create -name mybucket" | docker exec -i seaweedfs weed shell. By default a write is acknowledged once it is handed to the operating system. To fsync every write to disk before acknowledging it, enable fsync on the bucket:

S3-backed MergeTree

The S3-backed merge tree configuration is compatible with minor changes:
The endpoint contains the bucket name (clickhouse) followed by a path prefix (tables/) for the table data. SeaweedFS does not require a region, so the tag can stay empty. Replace seaweedfs with the host running the S3 gateway.
Tables then place their data on SeaweedFS through the storage policy:
To keep a local cache of frequently read data, create the table with SETTINGS disk = 's3_cache' instead - the cache disk defined above wraps the S3 disk.

The s3 table function

The s3 table function reads and writes objects against the same endpoint:
Glob patterns work for reading multiple objects.

Backup and restore

BACKUP and RESTORE accept a SeaweedFS endpoint as the S3 destination:
Last modified on August 18, 2026