This guide will walk you through installing Cosdata and running your first test to verify everything is working correctly.
Installation Options
1. Quick Install (Linux)
For a simple one-step installation on Linux, run:
Terminal window
curl-sLhttps://cosdata.io/install.sh|bash
This script will handle all dependencies and set up Cosdata automatically.
To start Cosdata, simply run:
Terminal window
start-cosdata
You will be prompted to enter your admin key on first run.
2. Docker Install (Mac & Windows)
For Mac & Windows users, we recommend using our Docker-based installation:
Ensure Docker is installed and running
Pull the latest image from Docker Hub:
Terminal window
dockerpullcosdatateam/cosdata:latest
Run the container:
Terminal window
dockerrun-it\
--namecosdata-server\
-p8443:8443\
-p50051:50051\
cosdatateam/cosdata:latest
The server will be available at http://localhost:8443.
You will be prompted to enter your admin key when the container starts.
Troubleshooting Docker Pull Issues:
If you encounter errors pulling the Cosdata Docker image (especially on Mac), it may be due to an incorrect or expired Docker login session. Even though the image is public, being logged in incorrectly can cause issues. Try running:
Terminal window
dockerlogout
dockerlogin-u<your-docker-username>
Logging out and then logging in again via the command line often resolves these problems.
3. Build from Source (Development)
Prerequisites
Before building from source, ensure you have:
Git
Rust (version 1.81.0 or higher)
Cargo (Rust’s package manager)
C++ compiler (GCC 4.8+ or Clang 3.4+)
Python 3.8+ (for running test scripts)
Build Steps
Terminal window
# Clone the repository
gitclonehttps://github.com/cosdata/cosdata.git
cdcosdata
# Build the project
cargobuild--release
# Run Cosdata
cargorun--release----admin-keyyour-admin-key
You should see output similar to:
[2025-02-21T02:30:29Z INFO cosdata::web_server] starting HTTP server at http://127.0.0.1:8443
[2025-02-21T02:30:29Z INFO actix_server::builder] starting 20 workers
[2025-02-21T02:30:29Z INFO actix_server::server] Actix runtime found; starting in Actix runtime
[2025-02-21T02:30:29Z INFO actix_server::server] starting service: "actix-web-service-127.0.0.1:8443", workers: 20, listening on: 127.0.0.1:8443
[2025-02-21T02:30:29Z INFO cosdata::grpc::server] gRPC server listening on [::1]:50051
Configuration Options
Cosdata is configured using a config.toml file, which is included by default in your installation. We recommend not editing this file unless you are an expert or have a specific need. Most users will not need to change any settings. The only common exception is configuring SSL certificates for HTTPS - this is covered in the HTTPS Configuration section below.
Below is a reference of the available configuration options, as defined in config.toml:
upload_threshold = 100
upload_process_batch_size = 1000
num_regions_to_load_on_restart = 10000
inverted_index_data_file_parts = 8
sparse_raw_values_reranking_factor = 5
rerank_sparse_with_raw_values = false
tree_map_serialized_parts = 8
[server]
host = "127.0.0.1"
port = 8443
mode = "http"# Options: "http" or "https"
[thread_pool]
pool_size = 64
[hnsw]
default_neighbors_count = 32
default_level_0_neighbors_count = 64
default_ef_construction = 128
default_ef_search = 256
default_num_layer = 9
default_max_cache_size = 1000
[server.ssl]
cert_file = "/etc/ssl/certs/cosdata-ssl.crt"
key_file = "/etc/ssl/private/cosdata-ssl.key"
[search]
shortlist_size = 64
early_terminate_threshold = 0.0
[indexing]
clamp_margin_percent = 1.0# 1%
mode = "sequential"# Options: "sequential" or "batch"
# batch_size = 32 # only required with "batch" indexing mode
[grpc]
host = "127.0.0.1"# Optional - if not specified uses default loopback address
port = 50051# Optional - if not specified will use default 50051
Key sections:
upload_threshold, upload_process_batch_size, etc.: Control upload and indexing performance.
[server]: Network settings for the main API server.
[thread_pool]: Controls the thread pool size for parallel operations.
[hnsw]: Parameters for the HNSW vector index.
[server.ssl]: SSL certificate paths for HTTPS mode.
[search]: Search and ranking parameters.
[indexing]: Indexing mode and margin settings.
[grpc]: gRPC server settings.
Note: Only advanced users should modify these settings. For most deployments, the defaults are optimal.
HTTPS Configuration (TLS)
By default, Cosdata runs over HTTP, but we strongly recommend enabling HTTPS in production.
1. Development Mode (HTTP)
If you just want to spin up the server quickly without TLS, edit your config.toml:
[server]
mode = "http"
⚠️ Warning: HTTP mode is not secure—only use this for local development or testing.
2. Enabling TLS (HTTPS)
To run Cosdata over HTTPS, you need:
TLS certificates (self‑signed OK for testing)
A valid config.toml pointing at your certs
Proper file permissions
a. Generate a Self‑Signed Certificate
Create a new RSA key and self‑signed cert (valid 1 year):