Skip to main content

Environment Variables

Every LynxDB config key can be overridden with an environment variable using the LYNXDB_ prefix. Environment variables take precedence over the config file but are overridden by CLI flags.

Precedence: CLI flags > environment variables > config file > defaults.

Client Variables

These control CLI client behavior when connecting to a LynxDB server.

VariableDefaultDescription
LYNXDB_SERVERhttp://localhost:3100Default server address
LYNXDB_TOKENAPI key for authentication
LYNXDB_PROFILEDefault connection profile name
LYNXDB_TLS_SKIP_VERIFYfalseSkip TLS certificate verification (true/1/yes)
LYNXDB_CONFIGPath to config file (overrides search order)
NO_COLORDisable colored output (any non-empty value)
# Connect to a remote server with authentication
export LYNXDB_SERVER=https://lynxdb.company.com
export LYNXDB_TOKEN=lxk_a1b2c3d4e5f6...
lynxdb query 'level=error | stats count'

Server Variables

Top-level server settings.

VariableConfig KeyDefaultDescription
LYNXDB_LISTENlistenlocalhost:3100Listen address
LYNXDB_DATA_DIRdata_dir~/.local/share/lynxdbData directory
LYNXDB_RETENTIONretention7dData retention period
LYNXDB_LOG_LEVELlog_levelinfoLog level (debug/info/warn/error)
LYNXDB_LISTEN=0.0.0.0:3100 \
LYNXDB_DATA_DIR=/var/lib/lynxdb \
LYNXDB_RETENTION=30d \
LYNXDB_LOG_LEVEL=info \
lynxdb server

Storage Variables

VariableConfig KeyDefault
LYNXDB_STORAGE_COMPRESSIONstorage.compressionlz4
LYNXDB_STORAGE_ROW_GROUP_SIZEstorage.row_group_size65536
LYNXDB_STORAGE_FLUSH_THRESHOLDstorage.flush_threshold512mb
LYNXDB_STORAGE_MEMTABLE_SHARDSstorage.memtable_shards0 (auto)
LYNXDB_STORAGE_MAX_IMMUTABLEstorage.max_immutable2

WAL Variables

VariableConfig KeyDefault
LYNXDB_STORAGE_WAL_SYNC_MODEstorage.wal_sync_modewrite
LYNXDB_STORAGE_WAL_SYNC_INTERVALstorage.wal_sync_interval100ms
LYNXDB_STORAGE_WAL_SYNC_BYTESstorage.wal_sync_bytes0
LYNXDB_STORAGE_WAL_MAX_SEGMENT_SIZEstorage.wal_max_segment_size256mb

Compaction Variables

VariableConfig KeyDefault
LYNXDB_STORAGE_COMPACTION_INTERVALstorage.compaction_interval30s
LYNXDB_STORAGE_COMPACTION_WORKERSstorage.compaction_workers2
LYNXDB_STORAGE_COMPACTION_RATE_LIMIT_MBstorage.compaction_rate_limit_mb0
LYNXDB_STORAGE_L0_THRESHOLDstorage.l0_threshold4
LYNXDB_STORAGE_L1_THRESHOLDstorage.l1_threshold10
LYNXDB_STORAGE_L2_TARGET_SIZEstorage.l2_target_size1gb

S3 Tiering Variables

VariableConfig KeyDefault
LYNXDB_STORAGE_S3_BUCKETstorage.s3_bucket""
LYNXDB_STORAGE_S3_REGIONstorage.s3_regionus-east-1
LYNXDB_STORAGE_S3_PREFIXstorage.s3_prefix""
LYNXDB_STORAGE_S3_ENDPOINTstorage.s3_endpoint""
LYNXDB_STORAGE_S3_FORCE_PATH_STYLEstorage.s3_force_path_stylefalse
LYNXDB_STORAGE_TIERING_INTERVALstorage.tiering_interval5m
LYNXDB_STORAGE_TIERING_PARALLELISMstorage.tiering_parallelism2
LYNXDB_STORAGE_SEGMENT_CACHE_SIZEstorage.segment_cache_size1gb

Cache Variables

VariableConfig KeyDefault
LYNXDB_STORAGE_CACHE_MAX_BYTESstorage.cache_max_bytes1gb
LYNXDB_STORAGE_CACHE_TTLstorage.cache_ttl5m

Query Variables

VariableConfig KeyDefault
LYNXDB_QUERY_SYNC_TIMEOUTquery.sync_timeout30s
LYNXDB_QUERY_MAX_QUERY_RUNTIMEquery.max_query_runtime5m
LYNXDB_QUERY_MAX_CONCURRENTquery.max_concurrent10
LYNXDB_QUERY_DEFAULT_RESULT_LIMITquery.default_result_limit1000
LYNXDB_QUERY_MAX_RESULT_LIMITquery.max_result_limit50000
LYNXDB_QUERY_JOB_TTLquery.job_ttl10m
LYNXDB_QUERY_JOB_GC_INTERVALquery.job_gc_interval1m

Ingest Variables

VariableConfig KeyDefault
LYNXDB_INGEST_MAX_BODY_SIZEingest.max_body_size10mb
LYNXDB_INGEST_MAX_BATCH_SIZEingest.max_batch_size1000

HTTP Variables

VariableConfig KeyDefault
LYNXDB_HTTP_IDLE_TIMEOUThttp.idle_timeout2m
LYNXDB_HTTP_SHUTDOWN_TIMEOUThttp.shutdown_timeout30s

AWS Credentials

LynxDB uses the standard AWS SDK credential chain for S3 access. These are standard AWS variables, not LynxDB-specific:

VariableDescription
AWS_ACCESS_KEY_IDAWS access key
AWS_SECRET_ACCESS_KEYAWS secret key
AWS_SESSION_TOKENAWS session token (for temporary credentials)
AWS_REGIONDefault AWS region (fallback for LYNXDB_STORAGE_S3_REGION)
AWS_PROFILEAWS profile name from ~/.aws/credentials

Install Script Variables

These are used by the install.sh script, not by the LynxDB binary itself:

VariableDefaultDescription
LYNXDB_VERSIONlatestSpecific version to install
LYNXDB_INSTALL_DIRauto-detectInstallation directory
LYNXDB_BASE_URLhttps://dl.lynxdb.orgCDN base URL
LYNXDB_NO_MODIFY_PATHSkip PATH modification
LYNXDB_VERBOSEVerbose output
LYNXDB_FORCESkip confirmation prompts

Usage in Docker

FROM OrlovEvgeny/Lynxdb:latest

ENV LYNXDB_LISTEN=0.0.0.0:3100
ENV LYNXDB_DATA_DIR=/data
ENV LYNXDB_RETENTION=30d
ENV LYNXDB_LOG_LEVEL=info
ENV LYNXDB_STORAGE_COMPRESSION=lz4
ENV LYNXDB_STORAGE_S3_BUCKET=my-logs
ENV LYNXDB_STORAGE_S3_REGION=us-east-1

CMD ["server"]

Usage in systemd

# /etc/systemd/system/lynxdb.service
[Service]
Environment=LYNXDB_LISTEN=0.0.0.0:3100
Environment=LYNXDB_DATA_DIR=/var/lib/lynxdb
Environment=LYNXDB_RETENTION=30d
Environment=LYNXDB_LOG_LEVEL=info
ExecStart=/usr/local/bin/lynxdb server

Usage in Kubernetes

env:
- name: LYNXDB_LISTEN
value: "0.0.0.0:3100"
- name: LYNXDB_DATA_DIR
value: "/data"
- name: LYNXDB_STORAGE_S3_BUCKET
valueFrom:
configMapKeyRef:
name: lynxdb-config
key: s3-bucket
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: lynxdb-s3-credentials
key: access-key-id

Next Steps