Skip to content

Server Configuration

Configuration reference for self-hosted Scanopy server deployments.

Environment variables in docker-compose:

environment:
- SCANOPY_SERVER_PORT=60072
- DATABASE_URL=postgresql://postgres:password@db:5432/scanopy

Command-line (for binary builds):

Terminal window
./scanopy-server --port 60072 --database-url postgresql://...
ParameterCLI FlagEnvironment VariableDefaultDescription
Server Public URL--public-urlSCANOPY_PUBLIC_URLhttp://localhost:60072Public URL for webhooks, email links, etc
Server Port--server-portSCANOPY_SERVER_PORT60072Port for server to listen on
Database URL--database-urlSCANOPY_DATABASE_URLRequiredPostgreSQL connection string
Log Level--log-levelSCANOPY_LOG_LEVELinfoLogging verbosity: trace, debug, info, warn, error
Secure Cookies--use-secure-session-cookiesSCANOPY_USE_SECURE_SESSION_COOKIESfalseEnable HTTPS-only cookies
Integrated Daemon URL--integrated-daemon-urlSCANOPY_INTEGRATED_DAEMON_URLhttp://172.17.0.1:60073URL to reach daemon in default docker compose
Disable Registration--disable-registrationSCANOPY_DISABLE_REGISTRATIONfalseDisable new user registration
SMTP Username--smtp-usernameSCANOPY_SMTP_USERNAME-SMTP username for email features
SMTP Password--smtp-passwordSCANOPY_SMTP_PASSWORD-SMTP password for email authentication
SMTP Relay--smtp-relaySCANOPY_SMTP_RELAY-SMTP server address (e.g., smtp.gmail.com)
SMTP Email--smtp-emailSCANOPY_SMTP_EMAIL-Sender email address for outgoing emails
Client IP Source--client-ip-sourceSCANOPY_CLIENT_IP_SOURCE-Source of IP address from request headers for reverse proxy setups

The integrated daemon runs in a separate container and needs to reach the server. The default assumes Docker’s bridge network gateway is 172.17.0.1.

Check your bridge gateway:

Terminal window
docker network inspect bridge | grep Gateway

If different, update in docker-compose.yml:

environment:
- SCANOPY_INTEGRATED_DAEMON_URL=http://YOUR_GATEWAY_IP:60073

SMTP settings enable email-based features such as password reset.

All SMTP parameters are optional. If not configured, email features will be disabled.

Configuration:

environment:
- SCANOPY_SMTP_RELAY=smtp.gmail.com:587
- SCANOPY_SMTP_PASSWORD=your-app-password

The UI automatically uses the hostname and port from your browser’s address bar to reach the API.

No configuration needed for standard deployments where UI and API are on the same domain.

If your API server is on a different hostname than where the UI is served (uncommon):

Rebuild the Docker image with build arguments:

Terminal window
docker build \
--build-arg PUBLIC_SERVER_HOSTNAME=api.example.com \
--build-arg PUBLIC_SERVER_PORT=8080 \
-f backend/Dockerfile \
-t scanopy-server:custom \
.

Then use your custom image in docker-compose:

scanopy-server:
image: scanopy-server:custom
# ... rest of config

Important: Enable secure cookies when running Scanopy behind HTTPS.

environment:
- SCANOPY_USE_SECURE_SESSION_COOKIES=true

When to enable:

  • Behind a reverse proxy with TLS (Nginx, Traefik, Caddy)
  • Using a domain with HTTPS
  • Production deployments

When to disable (default):

  • Internal networks without HTTPS
  • Development environments
  • Accessing via IP address without TLS

Effect:

  • true: Cookies marked as Secure, only sent over HTTPS
  • false: Cookies sent over HTTP and HTTPS

For easier management, use .env files:

Create .env:

Terminal window
# Database
SCANOPY_DATABASE_URL=postgresql://postgres:password@db:5432/scanopy
# Server
SCANOPY_SERVER_PORT=60072
SCANOPY_SERVER_PUBLIC_URL=http://your-domain.com:60072
SCANOPY_LOG_LEVEL=info
SCANOPY_USE_SECURE_SESSION_COOKIES=false
# SMTP (optional - for password reset and notifications)
SCANOPY_SMTP_RELAY=smtp.gmail.com:587
SCANOPY_SMTP_USERNAME=[email protected]
SCANOPY_SMTP_PASSWORD=your-app-password
SCANOPY_SMTP_EMAIL=[email protected]
# Daemon
SCANOPY_INTEGRATED_DAEMON_URL=http://172.17.0.1:60073

Reference in docker-compose.yml:

services:
scanopy-server:
image: ghcr.io/scanopy/scanopy/server:latest
env_file:
- .env
# ... rest of config