Tutorial: Configure Global Settings with a .ocfg File⁠

You can configure global settings in OpenVPN Connect by creating and deploying a .ocfg configuration file. This file allows administrators to control application behavior, set security preferences, connection settings, or update behavior.

This tutorial outlines creating and using a .ocfg file with OpenVPN Connect for Windows or macOS, including what values you can set. We also include examples and reference links for advanced use cases, like managing the app from the command line or combining the .ocfg file with deployment tools.

Global Configuration File Support⁠

OpenVPN Connect supports global configuration files for macOS and Windows. This allows administrators to streamline application setup with a single configuration file. Refer to these topics for additional details:

Prerequisites⁠

  • OpenVPN Connect installed on a Windows or macOS device.

  • A text editor.

Step 1: Create the .ocfg file⁠

  1. Open your preferred text editor and create a new file.

  2. Add JSON-formatted settings using the supported schema.

    • Minimal, cross-platform example (global.ocfg): This example uses options that work on both Windows and macOS. (Platform-specific settings are ignored on platforms that don't support them.)

      {
        "settings": {
          "vpn-protocol": "adaptive",
          "timeout": "30",
          "launch-at-startup": "true",
          "connect-on-launch": "true",
          "seamless-tunnel": true,
          "captive-portal-detection": true,
          "software-update": "weekly",
          "theme": "system",
          "confirmation-dialogs": "on-disconnect",
          "security-level": "preferred",
          "enforce-tls-1-3": true,
          "block-ipv6": "no",
          "google-dns-fallback": true
        },
        "proxies": [
          {
            "proxy_name": "proxy1",
            "proxy_host": "192.0.2.1",
            "proxy_port": 8080,
            "basic_auth": true
          },
          {
            "proxy_name": "proxy2",
            "proxy_host": "192.0.2.2",
            "proxy_port": 3129,
            "basic_auth": false
          }
        ],
        "profiles": [
          {
            "profile_name": "work_profile",
            "profile_path": "~/Porilfes/example.ovpn"
          }
        ]
      }
      1. settings: App-wide configuration (protocol, timeout, security, UI behavior).

      2. proxies: Preconfigure proxies (profile assignment is done in the app).

      3. profiles Import VPN profiles (use profile_path for local/HTTPS path, or profile_body to embed the profile content).

  3. Save the file as the .ocfg extension.

    • Use a .ocfg extension (e.g., global.ocfg).

    • Follow the JSON format.

    • Adhere to the schema.

    • Ensure your editor doesn't add a .txt extension (e.g., global.ocfg.txt).

Step 2: Deploy the .ocfg file⁠

Refer to your OS for importing the global config file.

Step 3: Verify the configuration⁠

  1. Launch OpenVPN Connect.

  2. Navigate to the settings to confirm that the configurations from the .ocfg file have been applied.

  3. Check for expected behaviors such as predefined proxy settings and imported profiles.

Can't find what you're looking for?

Our support team will be happy to assist you.