On this page
What opens an .ovpn file on each system
The same file works everywhere, you don't need a separate one per system. Give each device its own file, though: with one certificate on two devices the server usually drops the first when the second connects.
Windows
AppOpenVPN GUI, part of the OpenVPN installer
How to add the fileRight-click its icon near the clock → Import → “Import file…”. Or put the file into
C:\Users\you\OpenVPN\configWindows and macOS
AppOpenVPN Connect
How to add the fileDouble-click the file or drag it into the app's window, then OK
macOS
AppTunnelblick
How to add the fileStart Tunnelblick and drag the file onto its icon in the menu bar
Linux, terminal
AppThe
openvpnpackageHow to add the file
sudo openvpn --config client.ovpnLinux, desktop
AppNetworkManager with its OpenVPN plugin
How to add the file
nmcli connection import type openvpn file client.ovpn, or add a VPN from a file in the network settingsAndroid
AppOpenVPN Connect
How to add the fileMenu → My Profiles → the add icon → Upload File
Android
AppOpenVPN for Android
How to add the fileImport the .ovpn. If it names other files, the app asks you to pick them
iPhone and iPad
AppOpenVPN Connect
How to add the fileThe same Upload File: the file can lie in iCloud or another cloud. From a Mac: Finder → iPhone → Files → drag it onto OpenVPN
Windows and Linux
AppVeli
How to add the fileProfiles → Add → “Open a file”, or drop the file into the window
What is inside
An .ovpn is plain text, so any text editor shows it. Treat it as a password: with the keys inside, whoever has the file can connect as you. That is also why it should not go into online “viewers” and converters.
remote vpn.example.com 1194is the server's address and port. There can be several such lines: the app tries them in turn.proto udporproto tcpis the transport. It must be the one the server uses.dev tunordev tapis the kind of tunnel. TUN is the usual one; TAP, a network bridge, is not supported by OpenVPN Connect and by apps on Android and iPhone.<ca>,<cert>,<key>,<tls-auth>or<tls-crypt>are the certificates and keys. If instead there are lines such asca ca.crt, they are in separate files.auth-user-passmeans the server also wants a login and a password.
From the terminal
Useful when you want to see the whole log. Initialization Sequence Completed in it means the tunnel is up; Ctrl+C disconnects.
sudo apt install openvpn
sudo openvpn --config client.ovpnRun it from the folder the file is in: the names of other files in it are read relative to that folder.
sudo apt install network-manager-openvpn-gnome
nmcli connection import type openvpn file client.ovpn
nmcli --ask connection up clientThe connection takes the file's name. --ask lets it ask for a password.
& "C:\Program Files\OpenVPN\bin\openvpn.exe" --config C:\Users\you\Downloads\client.ovpnbrew install openvpn
sudo "$(brew --prefix)/sbin/openvpn" --config client.ovpnThe file asks for ca.crt, client.crt, client.key or ta.key
Lines like ca ca.crt mean the keys were given to you as separate files, usually in one archive with the .ovpn. The app looks for them next to the .ovpn. OpenVPN GUI's “Import file…” copies only the .ovpn itself, into C:\Users\you\OpenVPN\config\client\: put the other files into that folder by hand. On a phone it is easier to make a single file, because the app often can't reach the neighbouring ones.
A single file looks like this. Open ca.crt and the others in a text editor, paste each whole between its tags and delete the lines that named the files. For tls-auth ta.key 1 the number moves to a line of its own, key-direction 1; with no number there is no such line, except in OpenVPN Connect, which wants key-direction bidirectional then.
client
dev tun
proto udp
remote vpn.example.com 1194
nobind
remote-cert-tls server
<ca>
-----BEGIN CERTIFICATE-----
...ca.crt...
-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
...client.crt...
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
...client.key...
-----END PRIVATE KEY-----
</key>
key-direction 1
<tls-auth>
-----BEGIN OpenVPN Static key V1-----
...ta.key...
-----END OpenVPN Static key V1-----
</tls-auth>For tls-crypt ta.key the block is <tls-crypt>, and no key-direction is needed. Save the file as plain text in UTF-8: OpenVPN Connect takes profiles under 256 KB.
Login and password
- The app asks by itself. With
auth-user-passin the file, it shows a login and a password field when it connects. They are not the account on the provider's site: many services give separate ones for OpenVPN. - To save them in a file, write
auth-user-pass pass.txtand put the login on the first line of pass.txt and the password on the second. The password then lies on the disk as it is. - A passphrase for the key is a different thing: the private key itself is encrypted, and the passphrase came from whoever made the file.
- A one-time code usually goes after the password or into a separate question, as the server wants it.
- No certificate at all, only a login? OpenVPN Connect needs
setenv CLIENT_CERT 0in such a file, or it looks for a certificate that isn't there.
The file won't open or connect
Options error: --ca fails with 'ca.crt': No such file or directory (errno=2)CauseThe keys are in separate files, and the file isn't there
What to doPut ca.crt and the rest next to the .ovpn, or paste them inside
You must define CA file (--ca) or CA path (--capath)CauseNo certificate of the server's authority in the file
What to doAsk whoever made the file for a full one
No client-side authentication method is specifiedCauseNeither a certificate with a key nor
auth-user-passWhat to doThe same: the file is incomplete
Unrecognized option or missing or extra parameter(s) in client.ovpn:20CauseThe line with this number is unknown to this version. On Linux and macOS it is often
block-outside-dns, a Windows optionWhat to doDelete that line, or update OpenVPN if the option is new
OSI layer 2 tunnels are not currently supportedCauseThe file has
dev tap, and OpenVPN Connect is built without TAPWhat to doUse OpenVPN itself on a computer, or ask for a
dev tunfileAUTH_FAILEDCauseThe server refused the login, the password or the certificate
What to doCheck which login the service wants; if it's right, the access may have expired
TLS key negotiation failed to occur within 60 secondsCauseNo answer from the server
What to doA separate guide has the causes
The file opens in Notepad or a browser
CauseNo app is linked with .ovpn
What to doImport it from inside the VPN app
What an .ovpn file can't do
- Work without the server. The file is only an address and keys. If the server is off or the access has ended, no app will connect.
- Become a WireGuard file. The protocols have different keys, so a converter can't help.
- Hide. OpenVPN is easy to recognise, and networks that filter VPNs cut it early.
proto tcpon port 443 helps against closed ports, not against recognition.