Flags
Newt ID generated by Pangolin to identify the client.Example:
31frd0uzbjvp721A unique secret used to authenticate the client ID with the websocket.Example:
h51mmlknrvrwv8s4r1i210azhumt6isgbpyavxodibx1k2d6The endpoint where both Gerbil and Pangolin reside for websocket connections.Example:
https://pangolin.example.comPort for the peers to connect to Newt on. This can be used to keep a static port open in firewalls instead of default random ports.Example:
34534MTU for the internal WireGuard interface.Default:
1280DNS server to use for resolving the endpoint.Default:
9.9.9.9The log level to use for Newt output.Options:
DEBUG, INFO, WARN, ERROR, FATALDefault: INFOInterval for pinging the server.Default:
3sTimeout for each ping.Default:
5sSet the Docker socket path for container discovery integration.Example:
/var/run/docker.sockValidate the container target is on the same network as the Newt process.Default:
falseCheck if connection to WireGuard server (Pangolin) is ok. Creates a file if ok, removes it if not ok. Can be used with Docker healthcheck to restart Newt.Example:
/tmp/healthyScript to be called when targets are added or removed.Example:
/path/to/updown.shPath to blueprint file to define Pangolin resources and configurations.Example:
/path/to/blueprint.yamlDon’t fail over to the cloud when using managed nodes in Pangolin Cloud.Default:
falseDisable clients on the WireGuard interface.Default:
false (clients enabled)Name of the WireGuard interface.Default:
newtEnable Prometheus /metrics exporter.Default:
trueEnable OTLP exporters (metrics/traces) to OTEL_EXPORTER_OTLP_ENDPOINT.Default:
falseAdmin/metrics bind address.Default:
127.0.0.1:2112Enable async bytes counting (background flush; lower hot path overhead).Default:
falseOptional region resource attribute for telemetry and metrics.Example:
us-west-2Enforce certificate validation for health checks.Default:
false (accepts any cert)Path to client certificate file (PEM/DER format) for mTLS.Example:
/path/to/client.crtPath to client private key file (PEM/DER format) for mTLS.Example:
/path/to/client.keyPath to CA certificate file for validating remote certificates (can be specified multiple times).Example:
/path/to/ca.crtPath to client certificate (PKCS12 format) - DEPRECATED: use
--tls-client-cert-file and --tls-client-key instead.Example: /path/to/client.p12Prefer this endpoint for the connection (if set, will override the endpoint from the server).Example:
https://preferred.endpoint.comEnvironment Variables
All CLI arguments can be set using environment variables as an alternative to command line flags. Environment variables are particularly useful when running Newt in containerized environments.When both environment variables and CLI arguments are provided, CLI arguments take precedence.
Endpoint of your Pangolin server (equivalent to
--endpoint)Newt ID generated by Pangolin (equivalent to
--id)Newt secret for authentication (equivalent to
--secret)Port for the peers to connect to Newt on (equivalent to
--port)MTU for the internal WireGuard interface (equivalent to
--mtu)Default: 1280DNS server to use for resolving the endpoint (equivalent to
--dns)Default: 9.9.9.9Load the config JSON from this file instead of in the home folder.
Path to blueprint file to define Pangolin resources and configurations (equivalent to
--blueprint-file).Don’t fail over to the cloud when using managed nodes in Pangolin Cloud (equivalent to
--no-cloud).Default: falseLog level (equivalent to
--log-level)Default: INFOPath to Docker socket for container discovery (equivalent to
--docker-socket)Interval for pinging the server (equivalent to
--ping-interval)Default: 3sTimeout for each ping (equivalent to
--ping-timeout)Default: 5sPath to updown script for target add/remove events (equivalent to
--updown)Validate container targets are on same network (equivalent to
--docker-enforce-network-validation)Default: falsePath to health file for connection monitoring (equivalent to
--health-file)Disable clients on the WireGuard interface (equivalent to
--disable-clients).Default: falseName of the WireGuard interface (equivalent to
--interface)Default: newtEnable Prometheus /metrics exporter (equivalent to
--metrics).Default: trueEnable OTLP exporters (metrics/traces) to OTEL_EXPORTER_OTLP_ENDPOINT (equivalent to
--otlp).Default: falseAdmin/metrics bind address (equivalent to
--metrics-admin-addr).Default: 127.0.0.1:2112Enable async bytes counting (background flush; lower hot path overhead, equivalent to
--metrics-async-bytes).Default: falseOptional region resource attribute for telemetry and metrics (equivalent to
--region).Enforce certificate validation for health checks (equivalent to
--enforce-hc-cert).Default: falsePath to client certificate file (PEM/DER format) for mTLS (equivalent to
--tls-client-cert-file)Path to client private key file (PEM/DER format) for mTLS (equivalent to
--tls-client-key)Comma-separated list of CA certificate file paths for validating remote certificates (equivalent to multiple
--tls-client-ca flags)Path to client certificate (PKCS12 format) - DEPRECATED: use
TLS_CLIENT_CERT and TLS_CLIENT_KEY insteadLoading secrets from files
You can useCONFIG_FILE to define a location of a config file to store the credentials between runs.
- macOS:
~/Library/Application Support/newt-client/config.json - Windows:
%PROGRAMDATA%\newt\newt-client\config.json - Linux/Others:
~/.config/newt-client/config.json
Docker Socket Integration
Newt can integrate with the Docker socket to provide remote inspection of Docker containers. This allows Pangolin to query and retrieve detailed information about containers running on the Newt client, including metadata, network configuration, port mappings, and more. Configuration: You can specify the Docker socket path using the--docker-socket CLI argument or by setting the DOCKER_SOCKET environment variable. If the Docker socket is not available or accessible, Newt will gracefully disable Docker integration and continue normal operation.
Supported values include:
-
Local UNIX socket (default):
You must mount the socket file into the container using a volume, so Newt can access it.
unix:///var/run/docker.sock -
TCP socket (e.g., via Docker Socket Proxy):
tcp://localhost:2375 -
HTTP/HTTPS endpoints (e.g., remote Docker APIs):
http://your-host:2375 -
SSH connections (experimental, requires SSH setup):
ssh://user@host
If the Docker socket is not available or accessible, Newt will gracefully disable Docker integration and continue normal operation.
- Running in Network Mode ‘host’: IP addresses will be used
- Running in Network Mode ‘bridge’: IP addresses will be used
- Running in docker-compose without a network specification: Docker compose creates a network for the compose by default, hostnames will be used
- Running on docker-compose with defined network: Hostnames will be used
false by default. It can be enabled via setting the --docker-enforce-network-validation CLI argument or by setting the DOCKER_ENFORCE_NETWORK_VALIDATION environment variable.
Updown Scripts
You can pass in an updown script for Newt to call when it is adding or removing a target:Returning a string from the script in the format of a target (
ip:dst so 10.0.0.1:8080) will override the target and use this value instead to proxy.You can look at
updown.py as a reference script to get started!mTLS Authentication
Newt supports mutual TLS (mTLS) authentication if the server is configured to request a client certificate. You can use either a PKCS12 (.p12/.pfx) file or split PEM files for the client cert, private key, and CA.Option 1: PKCS12 (Legacy)
This is the original method and still supported.
- File must contain:
- Client private key
- Public certificate
- CA certificate
- Encrypted
.p12files are not supported
Option 2: Split PEM Files (Preferred)
You can now provide separate files for:--tls-client-cert-file: client certificate (.crtor.pem)--tls-client-key: client private key (.keyor.pem)--tls-client-ca: CA cert to verify the server (can be specified multiple times)
NAT Traversal Tweaks
Newt supports NAT traversal to allow clients to connect directly to Newt sites without relaying through the Pangolin server, improving performance and reducing latency. In some environment depending on the NAT type and firewall, you may need to tweak some settings to get optimal connectivity in the firewall itself. Take a look at these docs for some firewall changes you might be able to make. Another option is to keep newt listening for client connections on a static port. This allows you to open a specific port in your firewall for Newt client connections instead of random high ports. You can do this by setting the--port flag or PORT environment variable and then opening this port in the your firewall to DNAT to Newt.
