I've been using Ubuntu 18.04 for about 3 days now and so far it runs smoothly. I now need to install a VPN for my work, and I got the following files from the sysadmin:

  • ca.crt
  • VPNConfig.ovpn

I first ran sudo apt install openvpn. After that I wanted to install it using the GUI. So I went to the settings app and under "Network" I tried adding a new VPN. It gives the option to "Import from a file". So I selected the VPNConfig.ovpn file, but it says it can't import the file. I also tried importing the ca.crt file and importing the zip in which the two files came, but that didn't work either.

Could anybody help me out as to how I can make this VPN work?

  • 4
    All you have to run is openvpn --config openvpn_profile_here
    – NerdOfCode
    Mar 13, 2018 at 17:49
  • 3
    OP states that they want to use the GUI Mar 13, 2018 at 17:50
  • 3
    I found that one can import a *.ovpn file into the GUI using sudo nmcli connection import type openvpn file /path/to/foo.ovpn. Couldn't post an answer here, but see my answer to 'How to setup OpenVPN Client' for more details.
    – HenrikB
    Sep 1, 2018 at 4:25
  • 1
    Totally disagree that this is a duplicate - a lot have changed since 1404.Especially in the GUI!
    – deckoff
    Dec 16, 2018 at 13:07
  • If the GUI has changed, post an updated answer on the dupe.
    – muru
    Oct 1, 2020 at 6:42

2 Answers 2


You have to install a few packages first with:

sudo apt install openvpn network-manager-openvpn network-manager-openvpn-gnome

then, restart network-manager

sudo service network-manager restart

and try again. If it doesn't work, then try logging out and back in, if not, then try rebooting.

  • Thanks! You made my day! Just a question: why is pptp supported by default, but does openvpn support need to be installed seperately?
    – kramer65
    Mar 14, 2018 at 7:27
  • I don't know. I guess the Ubuntu team decided that not enough people use it to make it worth being part of the standard OS. Mar 14, 2018 at 19:50
  • For a long time it didn't work for me, even though it worked from the command line. Finally I disabled ipv6 in the GUI and then it worked. Maybe this also helps other people.
    – kramer65
    Dec 19, 2018 at 9:34

I've had trouble importing .ovpn files as well. It seems to work on some machines and not others. However, it is not difficult to set up the connection using Network Manager. Many critical settings are only accessed after you click on the "Advanced" button, perhaps you didn't look there.

 <general tab>
  Tick "all users may connect to this network"
 <VPN tab>
  Set connection name
  Set server name in Gateway box
  Set type to Certificates (TLS)
  Import user certificate XXX.crt
  Import ca certificate YYY.crt
  Import private key ZZZ.key
  <advanced button> 
   Tick use LZO data compression
   Tick set virtual device type, TUN name tun

If you have other settings look through the tabs to find them.

Not the answer you're looking for? Browse other questions tagged .