How to add a VPN: configuration and link on iPhone and Android
How to add a VPN in iPhone, Android and computer settings, where to paste a vless:// link or subscription, and why an added VPN won't connect.
More →12 min read
A VPN file is a configuration file: text with the server address, keys and encryption parameters. It doesn't launch anything by itself; you need to import it into the app for its protocol. A .ovpn file is opened by OpenVPN Connect, .conf by WireGuard or AmneziaWG, .json by Xray and sing-box clients, and .vpn only by AmneziaVPN.
Button names and format limitations were checked against the OpenVPN, WireGuard, Amnezia, Xray and sing-box documentation on November 17, 2026.
If you only need the file to get a VPN working, it's easier to do without it. We recommend BessyConnect: the app sets up the connection by itself, with no files or keys to handle manually. Download BessyConnect from the download page, where versions for iPhone, Mac, Android and TVs are collected.
The file format is determined by the protocol. An app for a different protocol will either reject the file or import it with an error, so look at the extension first.
| Format | Protocol | What's inside | What opens it |
|---|---|---|---|
.ovpn | OpenVPN | the directives remote, proto, certificates in <ca>, <cert>, <key> blocks | OpenVPN Connect (Windows, macOS, Android, iOS) |
.conf | WireGuard | [Interface] and [Peer] sections: private key, address, DNS, the server's public key, Endpoint | the WireGuard app |
.conf | AmneziaWG | the same as WireGuard, plus the obfuscation parameters Jc, Jmin, Jmax, S1–S4, H1–H4 | AmneziaWG, AmneziaVPN |
.json | Xray (VLESS, Reality) or sing-box | inbounds, outbounds, routing blocks (route in sing-box) | v2rayNG ("Import from file"), AmneziaVPN for Xray Reality |
.vpn | AmneziaVPN's own format | settings for the Amnezia app | only AmneziaVPN |
.mobileconfig | Apple profile | system settings, including VPN | iPhone Settings |
The WireGuard file is the simplest of all. According to the format description in the wg(8) manual, there's only one required field in the [Interface] section: PrivateKey. It looks like this:
[Interface]
PrivateKey = <закрытый ключ этого устройства>
Address = 10.0.0.2/32
DNS = 1.1.1.1
[Peer]
PublicKey = <публичный ключ сервера>
Endpoint = vpn.example.com:51820
AllowedIPs = 0.0.0.0/0
In this example, the two placeholders mean "this device's private key" and "the server's public key".
An Xray config is entirely JSON: the Xray documentation states outright that the configuration is written in JSON format, and the same goes for sing-box. Such files are usually written by the server administrator. Ordinary users are more often given not JSON but a vless:// link; more on that below.
How the protocols differ in speed and resistance to blocking is covered in the comparison VLESS, OpenVPN or WireGuard.
If by "VPN file" you meant the app's installation file (an APK for Android), that's something else. There are two safe sources: the official app store and the developer's website. What happens with builds from third-party channels is explained in the article on cracked VPNs in APK form.
On Windows and Mac, just double-click a .ovpn file or drag it into the OpenVPN Connect window. A .conf file is imported with the "Import tunnel(s) from file" button in the WireGuard app.
OpenVPN Connect, Windows and macOS:
.ovpn file or drag it onto any screen of the app. The OpenVPN documentation describes these two methods only for Windows and macOS.WireGuard on Windows:
.conf files and .zip archives with several configurations.On a Mac, the WireGuard app installs from the App Store, and the menu item has the same name: Import Tunnel(s) from File. An AmneziaWG file won't load into regular WireGuard (the reason is below). For it you need the AmneziaWG app: according to the Amnezia documentation, on a Mac it requires macOS 12 or later, and the button is called "Import tunnel(s) from file".
VPNs on Windows and Mac in general, without files, are covered in the guide VPN on PC.
On a phone, first save the file to Files or Downloads, then open it with the "+" button in the app. On the first connection, the system will ask you to allow adding a VPN configuration; that's normal.
Menu item names in the official apps:
| App | Android | iPhone |
|---|---|---|
| WireGuard | "+" → Import from file or archive, or Scan from QR code | "+" → Create from file or archive, or Create from QR code |
| AmneziaVPN | "+" or "Let's get started" → "File with connection settings" | the same |
| OpenVPN Connect | menu → My Profiles → "+" → Upload File | the same |
| v2rayNG (Xray) | add menu → "Import from file", "Import from QR code" or "Import from clipboard" | no app; v2rayNG is Android-only |
The steps for AmneziaVPN, according to the official guide:
.conf or .json file to your phone.According to the Amnezia documentation, the AmneziaWG app on Android runs on Android 7.0 and later. System methods for adding a VPN without a file, through the phone's settings, are described in the guide how to add a VPN.
A .mobileconfig profile is installed differently on iPhone, through the system settings. According to Apple's support article, after downloading it, open Settings, tap "Profile Downloaded", then "Install". If you don't install the profile within 8 minutes of downloading it, the iPhone deletes it by itself.
A QR code is the same configuration file, just encoded into an image. A subscription link is an https://… address from which the app downloads and updates the server list by itself. Amnezia's vpn:// key and a vless:// link also replace a file.
The WireGuard developers point out in the Android app how to make a QR code from a file: with the command qrencode -t ansiutf8 < tunnel.conf. So a photo of a QR code sent in a chat reveals the same as the file itself, including the private key.
A subscription has one advantage, but an important one: if a server gets blocked, a replacement arrives with the next update, and there's nothing to re-import. v2rayNG warns about this: "Do not use the insecure HTTP protocol in the subscription address". The address should start with https://.
For its own services, Amnezia recommends the key specifically: according to its documentation, connecting with a vpn:// key in AmneziaVPN is "more convenient than importing a configuration file", and files are needed where keys aren't supported, for example in AmneziaWG and on routers. How vless:// keys work and where to paste them is explained in the article VPN key.
Most often the file has been opened in the wrong app: an AmneziaWG config in regular WireGuard, extra lines in a .conf, or .ovpn certificates stored separately. Less often the cause is an old app version or the same configuration on several devices.
| What you see | Cause | What to do |
|---|---|---|
| WireGuard on iPhone or Mac: "Unable to import tunnel" | the file has lines that aren't on the app's list. In the [Interface] section it only accepts PrivateKey, ListenPort, Address, DNS, MTU | if the file contains Jc, S1, H1, it's AmneziaWG: open it in AmneziaWG |
| WireGuard on Windows: "Invalid key for [Interface] section" | the same cause: AmneziaWG parameters or a typo in a field name | AmneziaWG instead of WireGuard |
| WireGuard on Android: import error with an unknown attribute | the app doesn't know the PreUp, PostUp lines or AmneziaWG parameters | remove the script lines or use AmneziaWG |
| OpenVPN Connect can't find the certificate | the .ovpn refers to the files ca.crt, client.key, but they aren't next to it | put the files in the same folder or embed them in the .ovpn as <ca>, <cert>, <key> blocks |
| OpenVPN Connect on a phone reports unsupported options | directives the mobile app doesn't have: dev tap, fragment, secret, socks-proxy | remove the directive; unused lines are listed in the connection log, in the UNUSED OPTIONS section |
| OpenVPN Connect won't accept the file | the file is larger than 256 KB or not saved in UTF-8 | re-save it in UTF-8 without anything extra |
| AmneziaVPN: "Not installed" under the connection name | an AmneziaWG 3.1 configuration in an app older than version 5.0.1.5 | update AmneziaVPN |
| It worked, then stopped everywhere | one file was added to several devices | a separate file for each device |
The last point doesn't apply only to Amnezia, but there it's described explicitly: the Amnezia Premium guide says that if the same file is added to several devices, "the connection will stop working on all of them".
If the file imported but the connection won't establish, the problem is no longer the file but the server or the network. The Amnezia documentation says WireGuard has fixed packet headers and predictable sizes, by which DPI systems easily recognize it and can break the connection. That's why AmneziaWG appeared: the obfuscation parameters change how the traffic looks, while the cryptography is still WireGuard's.
Someone else's file is exactly as safe as your trust in its author. The server owner sees which addresses you connect to, and commands can be written into the file that will run on your computer. The Amnezia documentation says it plainly: don't use configuration files from public sources, as they can be used to intercept personal data.
Two things about the formats that are rarely explained:
up directive runs a command after the tunnel comes up. According to the OpenVPN manual, by default (script-security 1) the client is only allowed to call built-in system utilities, while the line script-security 2 allows user scripts. If you see the lines script-security 2, up, down or route-up in someone else's .ovpn, don't import it.PreUp, PostUp, PreDown, PostDown lines run only if an administrator has manually created the DangerousScriptExecution registry key. The developers warn that the commands then run as Local System, with the highest privileges on the system.Before importing, open the file in Notepad or TextEdit; it's plain text. Also check the DNS line (whose server will answer your requests) and AllowedIPs: according to the wg(8) manual, the value 0.0.0.0/0 covers all IPv4 addresses, meaning all traffic will go through the tunnel.
And the flip side: your own file is a password. A .conf contains the private key, and a .ovpn often contains the client certificate and key. Whoever gets the file or a photo of its QR code can connect in your place.
For people looking for a VPN file just to start using a VPN, we recommend BessyConnect. No files, keys or subscriptions to handle manually: you install the app, choose a server, and the connection sets itself up.
Apps:
Now about the limits. There's no BessyConnect app for Windows. A Windows computer can be connected through a router, since BessyConnect can be set up on a router; there's a guide for a Keenetic router. The app isn't in the Russian App Store, so on iPhone you need an Apple ID from another country. And BessyConnect doesn't replace a work VPN: if your employer gave you a .ovpn to access the internal network, that file is needed specifically for it, and you should open it in OpenVPN Connect.
Import a file from work or from your own server following the tables above. But if you're looking for a file to open a blocked website or protect your connection on public Wi-Fi, we recommend BessyConnect instead. Download BessyConnect from the download page: the connection will set itself up without a single file.
What opens an ovpn file? The OpenVPN Connect app: on Windows and Mac by double-clicking or dragging it into the window, on a phone via My Profiles → "+" → Upload File. You can view its contents in any text editor.
Can I open an AmneziaWG file in WireGuard?
Only if the obfuscation parameters in it are turned off: then, according to the Amnezia documentation, the configuration is compatible with WireGuard. If the file has Jc, S1 or H1 lines, you need AmneziaWG or AmneziaVPN.
Why won't a VPN configuration file import on iPhone?
Most often the file is opened in the wrong app, or it contains lines the app doesn't know, such as PostUp. Check the extension and open the file in the app for its protocol.
Can I use one VPN file on several devices? It's better not to. A WireGuard server identifies a client by its key and replies to the last address packets came from, so two devices with one file interfere with each other. The Amnezia Premium guide says a shared file stops working on all devices at once.
Do I need a configuration file for BessyConnect? No. BessyConnect sets up the connection by itself: install the app from the App Store or Google Play and connect. There's no Windows app; a computer can be connected through a router.
How to add a VPN in iPhone, Android and computer settings, where to paste a vless:// link or subscription, and why an added VPN won't connect.
More →How to connect a VPN in Happ with a subscription link, QR code or vless:// key, update a subscription, pick a server and share the VPN with a phone or TV.
More →Where Happ's servers come from, which protocols it accepts, how to pick a server by ping, how a proxy differs from a server and the risks of GitHub lists.
More →Set up a VPN on TV with BessyConnect's dedicated Android TV app: install it from Google Play, sign in and control it with the remote.
More →