How to Add a VPN Connection in Ubuntu Settings

Whether connecting to an office corporate network, securing public Wi-Fi browsing at a coffee shop, or protecting online privacy, configuring a Virtual Private Network (VPN) on your Ubuntu desktop is essential. While server administrators frequently manage VPN daemons from the command line, desktop users can set up and toggle VPNs effortlessly using Ubuntu’s built-in graphical interface.

Ubuntu GNOME includes native support for OpenVPN, WireGuard, and standard enterprise tunneling protocols. Here is how to add and manage a VPN connection in Ubuntu Settings.


Method 1: Import a VPN Configuration File (.ovpn)

Most commercial VPN providers and enterprise IT departments supply pre-configured .ovpn profile files. Importing this file is the fastest setup method:

  1. Open the Settings application from the Ubuntu dock or press the Super key and search for “Settings”.
  2. In the left sidebar, click on Network (or Wi-Fi if using wireless).
  3. Locate the VPN section.
  4. Click the + (Add) button beside the VPN heading.
  5. In the Add VPN dialogue window, click on Import from file….
  6. Browse to your saved .ovpn configuration file in your Downloads or Documents folder and click Open.
  7. Ubuntu will automatically populate the gateway address, encryption keys, and certificates.
  8. Enter your assigned Username and Password under the Authentication section.
  9. Click the green Add button in the top-right corner to save.

Method 2: Configure a VPN Manually in Ubuntu Settings

If you were given manual server credentials rather than a profile file:

  1. In Settings > Network, click the + button next to VPN.
  2. Choose your connection protocol (e.g., OpenVPN or Point-to-Point Tunneling Protocol (PPTP)).

    Note: If OpenVPN is missing from the list, open terminal and install the plugin: sudo apt install network-manager-openvpn-gnome

  3. Under the General tab:
    • Connection Name: Enter a friendly label (e.g., Office-VPN).
    • Gateway: Enter the remote server IP address or domain hostname.
    • Type: Select Password, Certificates (TLS), or Pre-shared key.
    • Username & Password: Enter your account credentials.
  4. Click Add to save the configuration.

How to Connect and Disconnect from Your VPN

Once configured, you do not need to open Settings to toggle your VPN:

  • Click the Quick Settings menu in the top-right corner of your desktop top bar (the cluster showing battery, volume, and network icons).
  • Click on the VPN card.
  • Click Connect next to your configured network.
  • A small lock or shield icon will appear in your top panel, indicating your internet traffic is encrypted. Click Disconnect at any time to return to your normal connection.

Frequently Asked Questions

Why does my internet stop working after connecting to VPN?

If websites fail to load, open Settings > Network > VPN gear icon > IPv4 and ensure Automatic (DHCP) or correct internal DNS addresses are configured, or enable Use this connection only for resources on its network.

Can I configure multiple VPNs in Ubuntu?

Yes. You can add as many VPN profiles as you need (e.g., work, personal, staging) and switch between them from the top bar quick settings menu.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.