> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/mullvad/mullvadvpn-app/llms.txt
> Use this file to discover all available pages before exploring further.

# Environment Variables

> Configure Mullvad VPN daemon and frontend behavior using environment variables

## Daemon Environment Variables

These environment variables control the behavior of the Mullvad VPN daemon.

### Firewall Configuration

#### TALPID\_FIREWALL\_DEBUG

Helps debug firewall rules. Behavior varies by platform:

<Tabs>
  <Tab title="Linux">
    Set to `"1"` to add packet counters to all firewall rules.

    ```bash theme={null}
    export TALPID_FIREWALL_DEBUG=1
    ```
  </Tab>

  <Tab title="macOS">
    Makes rules log packets to the `pflog0` interface:

    * `"all"` - Add logging to all rules
    * `"pass"` - Add logging to rules allowing packets
    * `"drop"` - Add logging to rules blocking packets

    ```bash theme={null}
    export TALPID_FIREWALL_DEBUG=all
    ```
  </Tab>

  <Tab title="Windows">
    Not applicable on Windows.
  </Tab>
</Tabs>

#### TALPID\_FIREWALL\_DONT\_SET\_SRC\_VALID\_MARK

Set to `1` to prevent the daemon from setting the `net.ipv4.conf.all.src_valid_mark` kernel parameter on Linux.

```bash theme={null}
export TALPID_FIREWALL_DONT_SET_SRC_VALID_MARK=1
```

<Note>
  By default, the daemon sets this kernel parameter to `1` to prevent strict reverse path filtering from blocking relay traffic. Only disable if you understand the implications.
</Note>

#### TALPID\_FIREWALL\_DONT\_SET\_ARP\_IGNORE

Set to `1` to prevent the daemon from setting the `net.ipv4.conf.all.arp_ignore` kernel parameter on Linux.

```bash theme={null}
export TALPID_FIREWALL_DONT_SET_ARP_IGNORE=1
```

<Warning>
  By default, this parameter is set to `2` to prevent attackers from discovering the in-tunnel IP via ARP requests. Only disable for testing purposes.
</Warning>

### DNS Configuration

#### TALPID\_DNS\_MODULE

Override the automatic DNS configuration method detection.

<Tabs>
  <Tab title="Linux">
    Available options:

    * `"static-file"` - Modify `/etc/resolv.conf` directly
    * `"resolvconf"` - Use the `resolvconf` program
    * `"systemd"` - Use systemd's `resolved` service via DBus
    * `"network-manager"` - Use NetworkManager via DBus

    ```bash theme={null}
    export TALPID_DNS_MODULE=systemd
    ```
  </Tab>

  <Tab title="Windows">
    Available options:

    * `"iphlpapi"` - Use the IP helper API
    * `"netsh"` - Use the `netsh` program
    * `"tcpip"` - Set TCP/IP parameters in the registry

    ```powershell theme={null}
    $env:TALPID_DNS_MODULE = "iphlpapi"
    ```
  </Tab>

  <Tab title="macOS">
    DNS module configuration is automatic on macOS.
  </Tab>
</Tabs>

#### TALPID\_DISABLE\_LOCAL\_DNS\_RESOLVER

Set to `1` to disable the local DNS resolver (macOS only).

```bash theme={null}
export TALPID_DISABLE_LOCAL_DNS_RESOLVER=1
```

#### TALPID\_NEVER\_FILTER\_AAAA\_QUERIES

Set to `1` to never ignore DNS AAAA queries (macOS only).

```bash theme={null}
export TALPID_NEVER_FILTER_AAAA_QUERIES=1
```

### WireGuard Configuration

#### TALPID\_FORCE\_USERSPACE\_WIREGUARD

Forces the daemon to use the userspace implementation of WireGuard instead of the kernel module.

```bash theme={null}
export TALPID_FORCE_USERSPACE_WIREGUARD=1
```

### Network Monitoring

#### TALPID\_DISABLE\_OFFLINE\_MONITOR

Forces the daemon to always assume the host is online, disabling network connectivity checks.

```bash theme={null}
export TALPID_DISABLE_OFFLINE_MONITOR=1
```

### Split Tunneling (Linux)

#### TALPID\_CGROUP2\_FS

Forces the daemon to look for the cgroup2 filesystem at a custom path instead of `/sys/fs/cgroup`.

```bash theme={null}
export TALPID_CGROUP2_FS=/custom/cgroup/path
```

#### TALPID\_NET\_CLS\_MOUNT\_DIR

Forces the daemon to mount the `net_cls` controller in a specific directory (cgroup v1 systems only).

```bash theme={null}
export TALPID_NET_CLS_MOUNT_DIR=/custom/mount/dir
```

### Access Control

#### MULLVAD\_MANAGEMENT\_SOCKET\_GROUP

Restricts access to the management interface socket to users in a specific group (Linux and macOS only).

```bash theme={null}
export MULLVAD_MANAGEMENT_SOCKET_GROUP=mullvad-users
```

<Note>
  By default, everyone has access to the management socket. Use this variable to restrict CLI and GUI access.
</Note>

### Debugging

#### MULLVAD\_BACKTRACE\_ON\_FAULT

Controls whether the daemon logs a backtrace when encountering a fault (e.g., SIGSEGV).

* `1` - Enable backtrace logging
* `0` - Disable backtrace logging
* Default: Enabled in debug builds, disabled in release builds

```bash theme={null}
export MULLVAD_BACKTRACE_ON_FAULT=1
```

<Warning>
  Backtrace logging causes heap allocation in the signal handler, which is technically undefined behavior. Enable at your own risk.
</Warning>

### File Paths

These environment variables override default file and directory locations:

#### MULLVAD\_SETTINGS\_DIR

Customize the settings directory location.

```bash theme={null}
export MULLVAD_SETTINGS_DIR=/custom/settings/path
```

#### MULLVAD\_LOG\_DIR

Customize the log directory location.

```bash theme={null}
export MULLVAD_LOG_DIR=/custom/logs/path
```

#### MULLVAD\_CACHE\_DIR

Customize the cache directory location.

```bash theme={null}
export MULLVAD_CACHE_DIR=/custom/cache/path
```

#### MULLVAD\_RPC\_SOCKET\_PATH

Customize the full path to the RPC socket.

```bash theme={null}
export MULLVAD_RPC_SOCKET_PATH=/custom/socket/path
```

See [File Paths](/cli/configuration/file-paths) for default locations.

## Development-Only Variables

<Warning>
  These variables only work in development builds and are ignored in release builds.
</Warning>

#### MULLVAD\_API\_HOST

Set the hostname for API requests.

```bash theme={null}
export MULLVAD_API_HOST=api.mullvad.net
```

#### MULLVAD\_API\_ADDR

Set the IP address and port for API requests.

```bash theme={null}
export MULLVAD_API_ADDR=10.10.1.2:443
```

#### MULLVAD\_API\_DISABLE\_TLS

Use plain HTTP for API requests instead of HTTPS.

```bash theme={null}
export MULLVAD_API_DISABLE_TLS=1
```

#### MULLVAD\_CONNCHECK\_HOST

Set the hostname for connection check requests.

```bash theme={null}
export MULLVAD_CONNCHECK_HOST=am.i.mullvad.net
```

#### MULLVAD\_ENABLE\_DEV\_UPDATES

Enable version checks in development builds.

```bash theme={null}
export MULLVAD_ENABLE_DEV_UPDATES=1
```

## Desktop Frontend Variables

These variables control the Electron desktop application.

#### MULLVAD\_PATH

Customize the path to the `mullvad-problem-report` tool when running in development mode.

```bash theme={null}
export MULLVAD_PATH=/path/to/target/debug/
```

Defaults to `<repo>/target/debug/`.

#### MULLVAD\_DISABLE\_UPDATE\_NOTIFICATION

Set to `1` to disable notifications when updates are available.

```bash theme={null}
export MULLVAD_DISABLE_UPDATE_NOTIFICATION=1
```

## Setting Environment Variables

The method for setting environment variables varies by platform:

<Tabs>
  <Tab title="Windows">
    Use `setx` from an elevated command prompt:

    ```bat theme={null}
    setx TALPID_DISABLE_OFFLINE_MONITOR 1 /m
    ```

    Restart the daemon for changes to take effect:

    ```bat theme={null}
    sc.exe stop mullvadvpn
    sc.exe start mullvadvpn
    ```
  </Tab>

  <Tab title="Linux">
    Edit the systemd unit file:

    ```bash theme={null}
    sudo systemctl edit mullvad-daemon.service
    ```

    Add the environment variable:

    ```ini theme={null}
    [Service]
    Environment="TALPID_DISABLE_OFFLINE_MONITOR=1"
    ```

    Restart the daemon:

    ```bash theme={null}
    sudo systemctl restart mullvad-daemon
    ```
  </Tab>

  <Tab title="macOS">
    Use `plutil` to edit the launch daemon plist:

    ```bash theme={null}
    sudo plutil -replace EnvironmentVariables -json '{"TALPID_DISABLE_OFFLINE_MONITOR": "1"}' /Library/LaunchDaemons/net.mullvad.daemon.plist
    ```

    Restart the daemon:

    ```bash theme={null}
    launchctl unload -w /Library/LaunchDaemons/net.mullvad.daemon.plist
    launchctl load -w /Library/LaunchDaemons/net.mullvad.daemon.plist
    ```
  </Tab>
</Tabs>

## Related Resources

* [File Paths](/cli/configuration/file-paths) - Default and custom file locations
* [Settings Management](/cli/configuration/settings) - Configure app settings
