Configuration Settings#
These settings can be provided in the selected configuration file or through environment variables. See the TOML example for file syntax and a complete configuration.
Required Configuration#
These settings are required for configured operations such as record building and config dump; some standalone commands can run without them.
File System Paths#
NX_INSTRUMENT_DATA_PATH#
Type: typing.Annotated[pathlib.Path, PathType(path_type=’dir’)]
Required: Yes
The root path to the centralized instrument data file store — typically a network share or mounted volume containing subdirectories for each instrument.
IMPORTANT: This path should be mounted read-only to ensure data preservation. NexusLIMS will never write to this location.
The filestore_path column in the NexusLIMS instruments database stores paths relative to this root. For example, if an instrument has filestore_path='FEI_Titan/data' and this value is /mnt/instrument_data, NexusLIMS searches under /mnt/instrument_data/FEI_Titan/data.
NX_DATA_PATH#
Type: typing.Annotated[pathlib.Path, PathType(path_type=’dir’)]
Required: Yes
A writable path that mirrors the directory structure of NX_INSTRUMENT_DATA_PATH. NexusLIMS writes extracted metadata files and generated preview images here, alongside the original data.
This path must be accessible to the NexusLIMS CDCS frontend instance so it can serve preview images and metadata files to users browsing records. Configure your CDCS deployment to mount or serve files from this location.
NX_DB_PATH#
Type: typing.Annotated[pathlib.Path, PathType(path_type=’file’)]
Required: Yes
The full filesystem path to the NexusLIMS SQLite database file.
Must be writable by the NexusLIMS process. The database is created automatically on first run of nexuslims db init. Recommended location: within NX_DATA_PATH for co-location with other data.
CDCS Integration#
NX_CDCS_URL#
Type: AnyHttpUrl
Required: Yes
The root URL of the NexusLIMS CDCS frontend instance. All record uploads are sent here using NX_CDCS_TOKEN.
Include the trailing slash: https://nexuslims.example.com/
This is the same URL users visit to browse experiment records. NexusLIMS POSTs new XML records to the CDCS REST API at this address.
NX_CDCS_TOKEN#
Type: str
Required: Yes
The API authentication token for the NexusLIMS CDCS frontend. Used for all record upload requests.
To obtain: log in to your CDCS instance as an administrator, navigate to the admin panel, and find or create an API token for the NexusLIMS service account. Alternatively, use the CDCS REST API token endpoint.
Keep this value secret — anyone with this token can upload records to your CDCS instance.
NX_CDCS_USER_OWNED_RECORDS#
Type: bool
Default: false
When enabled, NexusLIMS will:
1. Fetch the session user’s details (username, email) from the NEMO reservation or usage event.
2. Search the CDCS user list for a matching account (by username first, then email).
3. If no account exists, create one with a random password — the account is intended for SSO/LDAP login only; the generated password is never shared.
4. Assign ownership of the uploaded record to that CDCS user.
Requirements: NX_CDCS_TOKEN must belong to a superuser account. If user lookup or creation fails for any reason, the record is still uploaded as admin-owned and a warning is logged — the export is never blocked by a user management failure.
Default: false (records are owned by the service account).
NX_CDCS_ASSIGN_TO_PUBLIC_WORKSPACE#
Type: bool
Default: true
Controls whether uploaded records are assigned to the CDCS global public workspace after upload.
When true (default), NexusLIMS calls rest/data/{id}/assign/{workspace_id}/ after each upload.
Set to false to leave records in the uploading user’s private workspace. This is only useful in combination with NX_CDCS_USER_OWNED_RECORDS=true; without user ownership enabled, disabling workspace assignment would make records inaccessible to most users.
Both this setting and NX_CDCS_USER_OWNED_RECORDS are applied independently — a record can be user-owned AND in the public workspace at the same time.
Warning
Store API tokens securely. Use environment variables or a secure secrets management system rather than committing tokens to version control.
NEMO Integration#
For NEMO-backed instruments, configure the corresponding NEMO instance. NexusLIMS supports multiple instances using numbered environment variable pairs; each instance requires an address and token. In TOML, configure each instance under [nemo_harvesters.N] using keys such as address and token.
NX_NEMO_ADDRESS_N#
Type: AnyHttpUrl
Required: Yes
The full URL to the NEMO API root endpoint, including the trailing slash. For example: https://nemo.yourinstitution.edu/api/. This must point to the API root, not the NEMO web interface itself.
You can verify the address is correct by navigating to it in a browser — a valid NEMO API root returns a JSON object listing available endpoints.
NX_NEMO_TOKEN_N#
Type: str
Required: Yes
The API authentication token for this NEMO server instance. To obtain: log in to NEMO as an administrator, navigate to the ‘Detailed administration’ page (typically at /admin/authtoken/token/), and locate or create a token for the NexusLIMS service account. The token is a 40-character hex string.
Optional Configuration#
eLabFTW Integration#
NexusLIMS can optionally export records to eLabFTW, an open-source electronic lab notebook. Each NexusLIMS session creates one eLabFTW experiment with a structured summary and the full XML record attached.
NX_ELABFTW_URL#
Type: AnyHttpUrl | None
Default: None
The root URL of your eLabFTW instance. If not configured, eLabFTW export will be disabled.
Should NOT include /api/ or any path — just the domain:
https://elabftw.example.com
http://localhost:3148
NexusLIMS appends the appropriate API paths automatically.
NX_ELABFTW_API_KEY#
Type: str | None
Default: None
API key for authenticating to the eLabFTW API. If not configured, eLabFTW export will be disabled.
To obtain: log in to your eLabFTW instance, go to user settings, and find the ‘API keys’ section. Create a new key for NexusLIMS.
Format: {id}-{key} (e.g., 1-abc123...). The key is typically a long alphanumeric string.
Note
eLabFTW API keys have the format {id}-{key} where the key portion is 84 hexadecimal characters.
NX_ELABFTW_EXPERIMENT_CATEGORY#
Type: int | None
Default: None
The default category ID for experiments created in eLabFTW. If not specified, eLabFTW uses its default category.
To find category IDs: log in to eLabFTW as an administrator, navigate to the admin panel, and look under ‘Experiment categories’. The ID is shown next to each category name.
NX_ELABFTW_EXPERIMENT_STATUS#
Type: int | None
Default: None
The default status ID for experiments created in eLabFTW. If not specified, eLabFTW uses its default status.
To find status IDs: log in to eLabFTW as an administrator, navigate to the admin panel, and look under ‘Experiment statuses’. The ID is shown next to each status name.
Tip
When eLabFTW export is enabled, experiments are created with:
Title:
NexusLIMS Experiment - {XML filename without extension}Body: HTML summary with session details and link to CDCS record (if available)
Tags: NexusLIMS, instrument name, username
Metadata: Structured extra_fields including session times, instrument, user, and CDCS cross-link
Attachment: Full XML record file
LabArchives Integration#
NexusLIMS can optionally export records to LabArchives, a commercial electronic lab notebook system. Each NexusLIMS session creates one notebook page with an HTML session summary and the full XML record attached as a file when a notebook ID is configured. Without a notebook ID, entries are added to the user’s Inbox.
LabArchives authentication uses HMAC-SHA-512 signed requests. Configure an Access Key ID and Access Password (provided by LabArchives), a User ID (uid), and the instance URL (which can usually use its default unless you are in a different region).
NX_LABARCHIVES_URL#
Type: AnyHttpUrl | None
Default: 'https://api.labarchives.com/api'
The base URL for LabArchives API calls, including the /api path segment. For the standard cloud service this is https://api.labarchives.com/api. For self-hosted instances use https://your-instance.example.com/api.
All API requests are sent to {NX_LABARCHIVES_URL}/{class}/{method}, so the /api suffix must be included here.
NX_LABARCHIVES_ACCESS_KEY_ID#
Type: str | None
Default: None
The Access Key ID (akid) provided by LabArchives for your API integration. This is the public identifier used alongside NX_LABARCHIVES_ACCESS_PASSWORD to sign API requests with HMAC-SHA-512.
Obtain this from your LabArchives account under API settings. Both the Access Key ID and Access Password are required for LabArchives export to be enabled.
NX_LABARCHIVES_ACCESS_PASSWORD#
Type: str | None
Default: None
The access password provided by LabArchives for your API integration. This secret is used to generate HMAC-SHA-512 signatures that authenticate all API requests.
Keep this value secret — it is equivalent to a password and allows full API access to the configured LabArchives account. Used together with NX_LABARCHIVES_ACCESS_KEY_ID.
NX_LABARCHIVES_USER_ID#
Type: str | None
Default: None
The persistent user ID (uid) for the LabArchives account that will own uploaded notebook entries. This is obtained once via the LabArchives user_access_info API call.
To get the uid: call the LabArchives API endpoint users/user_access_info with your login and token. The returned uid value is what you need here.
This uid is stable and does not change, so you only need to retrieve it once.
Note
To obtain your UID, use the nexuslims config labarchives-get-uid command, or use
the button on the LabArchives page of the nexuslims config edit application. You will need to sign in
manually via the LabArchives web interface and generate a fresh Password Token for
External Applications (valid for 1 hour only), which will be exchanged for your
stable UID. This only has to be done once, as the
returned uid value is stable and does not change over time.
NX_LABARCHIVES_NOTEBOOK_ID#
Type: str | None
Default: None
The notebook ID (nbid) of the target LabArchives notebook where NexusLIMS records will be stored. When configured, NexusLIMS automatically creates a NexusLIMS Records/{instrument}/ folder hierarchy within this notebook.
If not set, records are uploaded to the user’s default Inbox.
To find the nbid: open the notebook in LabArchives and check the URL — it typically appears as a parameter in the notebook URL.
Tip
When LabArchives export is enabled, the following structure is created automatically:
Notebook: The notebook specified by
NX_LABARCHIVES_NOTEBOOK_ID(or Inbox if unset)With a notebook ID: Folder hierarchy
NexusLIMS Records/{instrument_pid}/and a new{YYYY-MM-DD} — {session_id}pageWithout a notebook ID: Entries are added to the user’s Inbox
Entry: HTML session summary with optional CDCS cross-link
Attachment: Full XML record file
Export Configuration#
NX_EXPORT_STRATEGY#
Type: str (one of 'all', 'first_success', 'best_effort')
Default: 'all'
Controls behavior when exporting records to multiple destinations (e.g., both CDCS and eLabFTW are configured):
all (default, recommended): Every configured destination must accept the record. If any destination fails after the record is built, the session is marked BUILT_NOT_EXPORTED.
first_success: Stop after the first destination that accepts the record. Useful if destinations are fallbacks for each other.
best_effort: Attempt all destinations; mark COMPLETED if at least one succeeds. Failed destinations are logged but do not trigger a retry.
Note
See the Export Destinations page for a full description of how strategies interact with destination priorities and inter-destination dependencies (e.g. eLabFTW cross-linking to a CDCS record).
File Handling#
NX_FILE_STRATEGY#
Type: str (one of 'exclusive', 'inclusive')
Default: 'exclusive'
Controls which files are included when searching for experiment data.
exclusive (default): Only files for which NexusLIMS has an explicit metadata extractor are included. This produces cleaner records but may miss ancillary files.
inclusive: All files within the session window are included. Files without a known extractor receive basic filesystem metadata only. Useful when you want a complete audit trail of every file created during an instrument session.
See https://datasophos.github.io/NexusLIMS/stable/user_guide/extractors.html for the list of supported file formats and their extractors.
NX_IGNORE_PATTERNS#
Type: list[str]
Default: ['*.mib', '*.db', '*.emi', '*.hdr']
Filename glob patterns to exclude when scanning for experiment files. Patterns follow the same syntax as the ‘-name’ argument to GNU find (see https://manpages.org/find).
This is stored in the config file as a JSON array string:
NX_IGNORE_PATTERNS='["*.mib","*.db","*.emi","*.hdr"]'
In the config editor, enter patterns as a comma-separated list.
Common patterns to ignore:
*.mib — Merlin detector raw frames (very large)
*.db — SQLite lock/temp files
*.emi — FEI TIA sidecar files (paired with .ser via FEI EMI extractor)
*.hdr — header files paired with other data formats
NX_FILE_DELAY_DAYS#
Type: float
Default: 2.0
The maximum time (in days) to wait for instrument files to appear after a session ends before giving up.
Background: On some systems, instrument data files are not immediately available on the network share after an experiment ends — they may be synced or transferred with a delay.
When a session ends and no files are found, the record builder marks it NO_FILES_FOUND and retries on subsequent runs until this window expires.
Example: With a value of 2, if a session ended Monday at 5 PM, the builder keeps retrying until Wednesday at 5 PM.
Can be a fractional value (e.g., 0.5 for 12 hours). Must be > 0.
NX_CLUSTERING_SENSITIVITY#
Type: float
Default: 1.0
Controls how aggressively files are grouped into separate Acquisition Activities within a session record.
NexusLIMS uses kernel density estimation (KDE) on file modification times to detect natural gaps in activity. This multiplier scales the KDE bandwidth.
Higher values (e.g., 2.0): more sensitive — smaller time gaps cause a split, producing more (smaller) activities.
Lower values (e.g., 0.5): less sensitive — only large gaps cause a split, producing fewer (larger) activities.
Set to 0 to disable clustering and place all files into a single Acquisition Activity. Default is 1.0 (unmodified KDE bandwidth).
Examples:
# More sensitive - detects smaller time gaps as activity boundaries
NX_CLUSTERING_SENSITIVITY=2.0
# Less sensitive - only large time gaps create new activities
NX_CLUSTERING_SENSITIVITY=0.5
# Disable clustering - all files in one activity
NX_CLUSTERING_SENSITIVITY=0
Directory Paths#
NX_LOG_PATH#
Type: typing.Annotated[pathlib.Path, PathType(path_type=’dir’)] | None
Default: None
Directory for NexusLIMS application logs. If not specified, logs are written to NX_DATA_PATH/logs/ by default.
Within this directory, logs are organized by date:
YYYY/MM/DD/YYYYMMDD-HHMM.log
The directory must be writable by the NexusLIMS process. Leave blank to use the default location within NX_DATA_PATH.
NX_RECORDS_PATH#
Type: typing.Annotated[pathlib.Path, PathType(path_type=’dir’)] | None
Default: None
Directory where generated XML record files are stored before and after upload. If not specified, defaults to NX_DATA_PATH/records/.
After a record is successfully uploaded, the XML file is moved to an 'uploaded' subdirectory within this path for archival.
Failed records remain in the main directory for inspection. The directory must be writable by the NexusLIMS process.
NX_LOCAL_PROFILES_PATH#
Type: typing.Annotated[pathlib.Path, PathType(path_type=’dir’)] | None
Default: None
Directory containing site-specific instrument profile Python modules. Profiles customize metadata extraction for instruments unique to your deployment without modifying the core NexusLIMS codebase.
Each Python file in this directory should define one or more InstrumentProfile subclasses that are auto-discovered and loaded alongside built-in profiles.
Use cases: adding static metadata fields, transforming extracted values, adding instrument-specific warnings, or overriding which extractor handles a particular instrument’s files.
Leave blank if you only need the built-in profiles.
See Instrument Profiles for details on writing profile modules.
NEMO Advanced Options#
NX_NEMO_STRFTIME_FMT_N#
Type: str
Default: '%Y-%m-%dT%H:%M:%S%z'
The Python strftime format string used when sending datetime values to this NEMO API instance. The default %Y-%m-%dT%H:%M:%S%z is ISO 8601 and works with all standard NEMO installations.
Only change this if your NEMO server has a non-standard date format configuration. See https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes for format codes.
NX_NEMO_STRPTIME_FMT_N#
Type: str
Default: '%Y-%m-%dT%H:%M:%S%z'
The Python strptime format string used when parsing datetime values returned by this NEMO API instance. The default %Y-%m-%dT%H:%M:%S%z is ISO 8601 and works with all standard NEMO installations.
Only change this if your NEMO server returns dates in a non-standard format. See https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes for format codes.
NX_NEMO_TZ_N#
Type: str | None
Default: None
An IANA tz database timezone name (e.g., America/Denver, Europe/Berlin) to force onto datetime values received from this NEMO server. Only needed when your NEMO server returns reservation/usage event times without timezone information.
Leave blank for NEMO servers that include timezone info in their API responses. See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for valid timezone names.
SSL/TLS Configuration#
NX_CERT_BUNDLE_FILE#
Type: typing.Annotated[pathlib.Path, PathType(path_type=’file’)] | None
Default: None
Path to a custom SSL/TLS CA bundle file in PEM format. Use this when your CDCS or NEMO servers use certificates signed by a private or institutional CA not in the system trust store.
Any certificates in this bundle are appended to the existing system CA certificates — they do not replace them. Provide the full absolute path to the .pem or .crt file.
If both NX_CERT_BUNDLE and NX_CERT_BUNDLE_FILE are set, NX_CERT_BUNDLE takes precedence.
NX_CERT_BUNDLE#
Type: str | None
Default: None
The full text of a PEM-format CA certificate bundle, provided directly as a string rather than a file path. Certificate lines should be separated by ‘\n’ in the .env file, or just pasted into the config editor field.
This is primarily useful in CI/CD pipelines or containerized deployments where injecting a certificate file is impractical but environment variables are easy to set as secrets.
When defined, this value takes precedence over NX_CERT_BUNDLE_FILE.
NX_DISABLE_SSL_VERIFY#
Type: bool
Default: false
WARNING: Disables SSL certificate verification for ALL outgoing HTTPS requests, including connections to CDCS, NEMO, and eLabFTW.
NEVER enable this in production. An attacker could intercept all communications including API tokens and uploaded records.
Only appropriate for local development or testing with self-signed certificates when setting up a CA via NX_CERT_BUNDLE_FILE is impractical. If you need this in production, configure NX_CERT_BUNDLE_FILE instead.
Email Notifications#
Email notifications are optional but recommended for production deployments. They alert administrators when record building fails.
NX_EMAIL_SMTP_HOST#
Required for email: Yes
Type: str
Required: Yes
The hostname or IP address of the SMTP server used to send error notification emails. For Gmail use smtp.gmail.com, for Outlook/Office365 use smtp.office365.com. For an on-premises mail relay this is typically a local hostname or IP address.
NX_EMAIL_SMTP_PORT#
Type: int
Default: 587
The TCP port for the SMTP connection. Common values:
587 — STARTTLS (recommended, default)
465 — SMTPS / implicit TLS
25 — unencrypted (not recommended)
The default 587 works with most modern mail servers when Use TLS is enabled.
NX_EMAIL_SMTP_USERNAME#
Type: str | None
Default: None
The username for SMTP authentication. For Gmail this is your full email address. Leave blank if your SMTP relay does not require authentication (e.g., an internal relay that accepts connections from trusted hosts without credentials).
NX_EMAIL_SMTP_PASSWORD#
Type: str | None
Default: None
The password for SMTP authentication. For Gmail, use an App Password (not your account password) if 2-factor authentication is enabled. Leave blank if your SMTP relay does not require authentication.
NX_EMAIL_USE_TLS#
Type: bool
Default: true
Whether to use TLS encryption for the SMTP connection. When enabled (the default), NexusLIMS uses STARTTLS on the configured port (typically 587). Disable only when connecting to a plaintext SMTP relay on port 25.
NX_EMAIL_SENDER#
Required for email: Yes
Type: EmailStr
Required: Yes
The ‘From’ email address for notification messages. This must be an address that your SMTP server is authorized to send from. If using Gmail or similar services, this must match the authenticated account’s address.
NX_EMAIL_RECIPIENTS#
Required for email: Yes
Type: list[EmailStr]
Required: Yes
One or more email addresses that will receive error notification messages when the record builder encounters problems. Provide as a comma-separated string, e.g.:
NX_EMAIL_RECIPIENTS='admin@example.com,team@example.com'
Notifications are sent when nexuslims build-records detects ERROR-level log entries.