NestMTX Configuration Options
NestMTX is highly configurable through environment variables, allowing you to customize various aspects of the application, such as database connections, MQTT client settings, Twilio integration for ICE, MediaMTX configurations, and more. While some variables are required, others are optional and provide additional functionality when set.
Configuration Options
The following table outlines the available environment variables, indicating whether each is required, along with a brief description and the default value if applicable.
Variable | Description | Default Value | Available in Docker |
---|---|---|---|
NODE_ENV | Specifies the environment mode (development, production, test). | development | No |
PORT | The port on which the application will listen for unencrypted HTTP requests | 2000 | No |
HTTPS_PORT | The port on which the application will listen for encrypted HTTPS requests | 2001 | No |
APP_KEY | The application key used for encryption and security. | 2yHkmRqv832ze68zwyIOtBpwzSHIrVzV | Yes |
HOST | The host address on which the application will run. | 0.0.0.0 | No |
LOG_LEVEL | Specifies the logging level for the application. | info | Yes |
PINO_PORT | The port for the Pino logger, if applicable. | 62000 | No |
DB_CONNECTION | The database connection type (sqlite , mysql , pg , mssql ). | sqlite | Yes |
DB_HOST | The host address for the database. | localhost | Yes |
DB_PORT | The port for the database. | When DB_HOST = mysql : 3306 When DB_HOST = pg : 5432 When DB_HOST = mssql : 1143 | |
DB_USER | The username for the database connection. | lucid | Yes |
DB_PASSWORD | The password for the database connection. | '' | Yes |
DB_NAME | The name of the database to connect to. | lucid | Yes |
DB_SECURE | Whether to use a secure connection to the database (true /false ). | false | Yes |
MQTT_PROTOCOL | The protocol used for MQTT (wss , ws , mqtt , mqtts , etc.). | mqtt | Yes |
MQTT_HOST | The MQTT broker host address. If set to :instance: a local MQTT server will be started | :instance: | Yes |
MQTT_PORT | The port for the MQTT broker. | 1883 | Yes |
MQTT_USER | The username for MQTT authentication. | None | Yes |
MQTT_PASS | The password for MQTT authentication. | None | Yes |
MQTT_BASE_TOPIC | The base topic used for MQTT events | nestmtx | Yes |
TWILIO_ACCOUNT_SID | Twilio Account SID used for ICE configuration. | None | Yes |
TWILIO_API_KEY_SID | Twilio API Key SID for accessing Twilio services. | None | Yes |
TWILIO_API_KEY_SECRET | Twilio API Key Secret for secure access to Twilio services. | None | Yes |
IP_PUBLIC_RESOLVED | The resolved public IP address of the server. This is required if IP resolution is disabled. | None | |
IP_RESOLVERS_ENABLED | Which IP resolvers are enabled. (google , cloudflare , aws , akamai , ipify , ifconfigMe , ipEchoNet , ipInfoIo , httpBin ). | true | Yes |
IP_LAN_RESOLVED | The resolved LAN IP address of the server. This is required if IP resolution is disabled. | None | |
ICE_USE_TWILIO | Whether to use Twilio for ICE (true /false ). | true | Yes |
MEDIA_MTX_PATH | Required The file path to the MediaMTX executable. | None | No |
MEDIA_MTX_CONFIG_PATH | Required The path to the MediaMTX configuration file. | None | No |
MEDIA_MTX_API_PORT | The port for the MediaMTX API. | 9997 | No |
MEDIA_MTX_PLAYBACK_ENABLED | Whether playback is enabled in MediaMTX (true /false ). | true | Yes |
MEDIA_MTX_RTSP_PLAYBACK_PORT | The port for RTSP playback in MediaMTX. | 9996 | No |
MEDIA_MTX_RTSP_ENABLED | Whether RTSP is enabled in MediaMTX (true /false ). | false | Yes |
MEDIA_MTX_RTMP_ENABLED | Whether RTMP is enabled in MediaMTX (true /false ). | false | Yes |
MEDIA_MTX_HLS_ENABLED | Whether HLS is enabled in MediaMTX (true /false ). | false | Yes |
MEDIA_MTX_HLS_USE_DISK | Whether HLS uses disk storage in MediaMTX (true /false ). | false | Yes |
MEDIA_MTX_WEB_RTC_ENABLED | Whether WebRTC is enabled in MediaMTX (true /false ). | false | Yes |
MEDIA_MTX_SRT_ENABLED | Whether SRT is enabled in MediaMTX (true /false ). | false | Yes |
MEDIA_MTX_RTSP_TCP_PORT | The TCP port for RTSP in MediaMTX. | 8554 | No |
MEDIA_MTX_RTSP_UDP_RTP_PORT | The UDP RTP port for RTSP in MediaMTX. | 8000 | No |
MEDIA_MTX_RTSP_UDP_RTCP_PORT | The UDP RTCP port for RTSP in MediaMTX. | 8001 | No |
MEDIA_MTX_RTMP_PORT | The port for RTMP in MediaMTX. | 1935 | No |
MEDIA_MTX_HLS_PORT | The port for HLS in MediaMTX. | 8888 | No |
MEDIA_MTX_WEB_RTC_PORT | The port for WebRTC in MediaMTX. | 8889 | No |
MEDIA_MTX_WEB_RTC_UDP_PORT | The UDP port for WebRTC in MediaMTX. | 8189 | No |
MEDIA_MTX_SRT_PORT | The port for SRT in MediaMTX. | 8890 | No |
GSTREAMER_BIN | The file path to the GStreamer executable (gst-launch-1.0). | gst-launch-1.0 | No |
FFMPEG_BIN | The file path to the FFmpeg executable. | ffmpeg | No |
FFMPEG_HW_ACCELERATOR | The hardware accelerator to use with ffmpeg for encoding and decoding | None | Yes |
FFMPEG_HW_ACCELERATOR_DEVICE | The device for the ffmpeg hardware accelerator to use with ffmpeg for encoding and decoding | None | Yes |
WEBRTC_RTP_MIN_PORT | The minimum port range for WebRTC RTP. | 10000 | Yes |
WEBRTC_RTP_MAX_PORT | The maximum port range for WebRTC RTP. | 20000 | Yes |
HTTPS_CERT_PATH | The path to the SSL certificate to use for serving https traffic. If relative (does not start with / ) the path is assumed to be relative to the applications tmp folder | nestmtx.crt | Yes |
HTTPS_KEY_PATH | The path to the SSL certificate key to use for serving https traffic. If relative (does not start with / ) the path is assumed to be relative to the applications tmp folder | nestmtx.pem | Yes |
NESTMTX_RTSP_TCP_PORT | The port number to show for RTSP (TCP) in the UI | 8554 | Yes |
NESTMTX_RTSP_UDP_RTP_PORT | The port number to show for RTSP (UDP/RTP) in the UI | 8000 | Yes |
NESTMTX_RTSP_UDP_RTCP_PORT | The port number to show for RTSP (UDP/RTCP) in the UI | 8001 | Yes |
NESTMTX_RTMP_PORT | The port number to show for RTMP in the UI | 1935 | Yes |
NESTMTX_HLS_PORT | The port number to show for HLS in the UI | 8888 | Yes |
NESTMTX_WEB_RTC_PORT | The port number to show for WebRTC in the UI | 8889 | Yes |
NESTMTX_SRT_PORT | The port number to show for SRT in the UI | 8890 | Yes |
DROPCAM_EXCLUDED_DATACENTERS | A comma seperated list of dropcam.com hostname datacenters which should not be tried as fallbacks for bad RTSP connections | None | Yes |
DROPCAM_EXCLUDED_PHONETICS | A comma seperated list of dropcam.com hostname phonetics which should not be tried as fallbacks for bad RTSP connections | None | Yes |
DROPCAM_EXCLUDED_DATACENTER_ZONES | A comma seperated list of dropcam.com hostname datacenter zones which should not be tried as fallbacks for bad RTSP connections | None | Yes |
DROPCAM_EXCLUDED_HOSTNAMES | A comma seperated list of dropcam.com hostnames which should not be tried as fallbacks for bad RTSP connections | None | Yes |
DROPCAM_MAX_CASCADES | The maximum number of alternative dropcam.com hostnames to try before the feed is determined to be unreachable | 5 | Yes |