Skip to main content

Environment Variables

This page documents the deployment-time environment variables used by the SVRunner server.

How Environment Configuration Is Loaded

The server loads environment variables from a .env file located in:

<SVR_SERVER_EXEC_DIR>/.env

If you do not use a .env file, provide the same values through your deployment environment directly.

Core Runtime Variables

NODE_ENV

Controls the runtime mode.

Expected values:

  • development
  • test
  • production

In packaged production mode, the server sets this automatically.

SVR_SERVER_EXEC_DIR

Defines the server execution directory.

  • in production, this resolves to the executable directory
  • in development, it resolves to the current working directory

This value is important because several other paths are derived from it.

SVR_SERVER_PORT

Controls the HTTP server port.

Defaults:

  • 7376 in normal runtime
  • 17376 in test mode

Change this when the deployment requires a non-default port or when container/orchestration routing expects a different binding.

SVR_SERVER_FILES_DIR

Controls the root persistent data directory.

Default:

<SVR_SERVER_EXEC_DIR>/files

This is one of the most important deployment variables because assets, logs, and the database are derived from it.

SVR_SERVER_ASSETS_DIR

Derived from:

<SVR_SERVER_FILES_DIR>/assets

This is the backing directory for the /static route.

SVR_SERVER_LOGS_DIR

Derived from:

<SVR_SERVER_FILES_DIR>/logs

This is where runtime logs are stored.

SVR_SERVER_DATABASE_PATH

Derived from:

<SVR_SERVER_FILES_DIR>/local.db

This is the SQLite database path.

SVR_SERVER_VERSION

This is populated from the server package version and is not usually set manually.

Logging Variables

PAPERTRAIL_HOST

Default:

logs4.papertrailapp.com

PAPERTRAIL_PORT

Default:

50668

PAPERTRAIL_ENABLED

Default:

true

Use these values if the deployment relies on Papertrail-based log shipping.

Deployment Guidance

Host-Based Install

In a normal host install, the most important values to review are:

  • SVR_SERVER_PORT
  • SVR_SERVER_FILES_DIR

Docker Install

In Docker, make sure:

  • SVR_SERVER_PORT matches the container binding
  • the effective SVR_SERVER_FILES_DIR is backed by a persistent mount

Managed Platforms

In managed deployments, document the effective values and how they are provided so recovery and upgrades remain repeatable.

Which Changes Require Restart

Treat environment-variable changes as restart-required changes.

In particular, changes to:

  • port
  • file paths
  • logging configuration
  • execution environment

should always be followed by a controlled service restart and validation.

Environment Variable Example Stub screenshot: sanitized .env example or deployment config view showing the key server variables without secrets. Save final image at packages/docs/screenshots/configuration-env-example.png.