Configuration

View on GitHub

Documentation / Configuration

Configuration

Looksee is configured through environment variables. With Docker Compose they come from .env next to compose.yaml; .env.example lists the variables an installation sets, grouped by service, and the tables below cover the rest with their defaults. Services read their variables at start, so a change takes effect after docker compose up -d.

Compose stack

These variables shape the stack itself: images, ports, passwords, and resource limits.

Network and images

VariableDefaultMeaning
WEBRTC_HOST_IPrequiredAddress browsers use to reach MediaMTX for live video: 127.0.0.1 on one machine, the LAN address on a server. Also the default host in the RUNTIME_* URLs.
REGISTRY, TAGlooksee, latestImage name prefix and tag for the three application images.

Database and storage

VariableDefaultMeaning
POSTGRES_USER, POSTGRES_DBlookseeDatabase user and name.
POSTGRES_PASSWORDrequiredDatabase password.
POSTGRES_VOLUME_NAMEproject-specificUse a fresh volume for a major upgrade. The default is the current Compose project's postgres_data volume.
REDIS_MAXMEMORY512mbValkey memory limit; the eviction policy is noeviction.
STORAGE_PASSWORDrequiredSecret key of the bundled video storage; the access key is looksee.

MediaMTX

Compose publishes the MediaMTX ports listed below. MTX_LOGLEVEL and MTX_AUTHHTTPADDRESS configure the media server. Looksee's API connects to its control API with MEDIAMTX_API_URL, and inference reads video with MEDIAMTX_RTSP_URL.

VariableDefaultMeaning
MTX_MEDIA_USERmediaMediaMTX service account for reading camera streams and managing paths.
MTX_MEDIA_PASSWORDrequiredPassword for the MediaMTX service account.
MTX_LOGLEVELinfoMediaMTX log level.
MTX_AUTHHTTPADDRESShttp://api:8000/internal/media/authWhere MediaMTX asks for authorization. Change it only when the API runs outside Compose.

Models and inference

VariableDefaultMeaning
DEFAULT_MODEL_IDdfine-s-cocoDirectory name inside a custom startup archive.
DEFAULT_MODEL_URLrelease archiveArchive URL used by models-init. An empty value disables the automatic download.
DEFAULT_MODEL_SHA256release checksumPinned SHA-256 of the default archive. Set it with a custom URL.
INFERENCE_CPUS4.0CPU limit of the inference container; also caps ONNX Runtime threads.
INFERENCE_MEMORY4gMemory limit of the inference container.

Other services are limited too: api 2 CPUs and 1 GB, postgres 2 CPUs and 2 GB, mediamtx 2 CPUs and 1 GB, storage 2 CPUs and 1 GB, redis 1 CPU and 768 MB, studio 1 CPU and 512 MB. Edit compose.yaml or add an override file to change them.

The owner sets the lifetime of snapshots, alerts, and finished notification deliveries in Settings → Retention. Each accepts 0–3650 days. The default is 30 days and 0 keeps that category forever. Pending deliveries are kept. See Deployment before upgrading an existing installation.

API

VariableDefaultMeaning
LICENSE_KEYunsetEnterprise license key. Unset or blank runs the Community edition.
DATABASE_URLset by ComposeSQLAlchemy URL, postgresql+asyncpg://user:password@host:5432/looksee.
REDIS_URLset by ComposeValkey URL, redis://host:6379/0.
MEDIAMTX_API_URLset by ComposeMediaMTX control API, http://mediamtx:9997.
MODELS_DIR/app/modelsModel bundle directory.
SNAPSHOTS_DIR/data/snapshotsWhere the Snapshot action writes JPEG files; served at /snapshots.
SECRET_KEYunsetRoot secret for session signing and credential encryption. Unset, a secret is generated on first start and stored in SECRET_KEY_FILE.
SECRET_KEY_FILE/data/keys/secret.keyLocation of the generated secret, on the api_keys volume.
AUTH_COOKIE_SECUREfalseMark the session cookie Secure. Set to true behind HTTPS.
CORS_ORIGIN_REGEX^https?://(localhost|127\.0\.0\.1)(:\d+)?$Origins allowed to call the API from a browser. Requests that change state and WebSocket connections from other origins are rejected. Set it to the Studio origin when it is not localhost.
EVENT_COOLDOWN_SECONDS2Minimum gap between two event messages of the same kind on the same camera in the live feed. 0 disables the cooldown. The graph receives every event.
EVENT_TIMEZONEUTCTime zone for the Schedule filter, an IANA name such as Europe/Berlin.
RECONCILE_INTERVAL_SECONDS30How often the API republishes the desired camera state and retries failed cameras.
RETENTION_INTERVAL_SECONDS3600Seconds between cleanup runs. The first run starts with the API.
CONSUMER_GROUPapi-workersValkey stream consumer group for detection frames.
S3_ENDPOINT_URL, S3_BUCKEThttp://storage:9000, lookseeAsset library for File cameras. Compose points them at the bundled storage; set both to use an external S3-compatible bucket. Natively, both must be set to enable the library.
S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEYlooksee, STORAGE_PASSWORDAsset library credentials.
S3_REGIONautoRegion of an external bucket; auto for Cloudflare R2.
S3_PREFIXemptyKey prefix inside the bucket.
MEDIA_CACHE_DIRset by ComposeWhere downloaded assets are cached for playback.
MEDIA_MOUNT_DIR/mediaWhere MediaMTX sees the same cache.

Inference

VariableDefaultMeaning
REDIS_URLset by ComposeValkey URL.
MEDIAMTX_RTSP_URLrtsp://mediamtx:8554Where camera paths are read from.
MTX_MEDIA_USER, MTX_MEDIA_PASSWORDfrom .envCredentials for reading camera paths.
RTSP_TRANSPORTtcptcp or udp for reading from MediaMTX.
MODELS_DIR/app/modelsModel bundle directory.
FIRST_FRAME_TIMEOUT_SECONDS30How long to wait for the first frame, and for the next frame once running, before reporting an error.
LAST_FRAME_TTL_SECONDS10How long the latest JPEG of each camera stays available for the Snapshot action.

Studio

Studio reads its configuration on the server for every request and passes the public part to the browser, so an image can be repointed without a rebuild.

VariableDefaultMeaning
RUNTIME_API_URLhttp://<WEBRTC_HOST_IP>:<API_PORT>API base URL as seen from the browser.
RUNTIME_WS_URLws://<WEBRTC_HOST_IP>:<API_PORT>WebSocket base URL as seen from the browser.
RUNTIME_MEDIAMTX_WEBRTC_URLhttp://<WEBRTC_HOST_IP>:<MTX_WEBRTC_PORT>MediaMTX WebRTC URL as seen from the browser.
RUNTIME_DOCS_URLhttps://github.com/okoflow/looksee-docsTarget of the Documentation link in the sidebar; Compose pins it to the documentation repository.
RUNTIME_GITHUB_URLhttps://github.com/okoflow/lookseeTarget of the GitHub link.
SERVER_API_URLhttp://api:8000API address used by the Studio server itself for the sign-in guard. Never sent to the browser.

Behind a reverse proxy, set the three RUNTIME_* URLs to the public addresses; Deployment has an example.

Ports

PortServiceBound toPurposePort variable
3000studioall interfacesWeb interfaceWEB_PORT
8000apiall interfacesHTTP API and WebSocketAPI_PORT
8554mediamtxall interfacesRTSPMTX_RTSP_PORT
8889mediamtxall interfacesWebRTC signalling and playbackMTX_WEBRTC_PORT
8189/udpmediamtxall interfacesWebRTC mediaMTX_WEBRTC_ICE_PORT
9997mediamtx127.0.0.1MediaMTX control API—
9000storage127.0.0.1S3 API of the video storageSTORAGE_PORT
5432postgres127.0.0.1PostgreSQLPOSTGRES_PORT
6379redis127.0.0.1ValkeyREDIS_PORT

Volumes

VolumeServiceContents
postgres_datapostgresWorkflows, cameras, credentials, alerts, users, queued deliveries
storage_datastorageUploaded video files for File cameras
redis_dataredisDetection stream and command channels; safe to lose
api_snapshotsapiSnapshot JPEG files
api_keysapiThe generated secret.key
media-cacheapi, mediamtxCached video files for File cameras
./models (bind)models-init, api, inferenceModel bundles. The API writes them, inference reads them.

postgres_data, api_keys, and storage_data hold the state worth backing up; without the secret, stored credentials cannot be decrypted and every session is signed out. Deployment describes a backup routine.