Internet, Networking, & Security VPN How to Install a VPN on Linux Easily connect from your desktop By Nicholas Congleton Writer Nick Congleton has been a tech writer and blogger since 2015. His work has appeared in PCMech, Make Tech Easier, Infosec Institute, and others. our editorial process Twitter LinkedIn Nicholas Congleton Updated October 07, 2019 How to Get a VPN How to Get a VPN Introduction VPN Basics What is a VPN? What Does a VPN Hide? What Are VPN Tunnels? Do I Need a VPN? Why Do I Need a VPN? Top Benefits of Using a VPN Choosing a VPN The Best Free VPN Services The Best VPN Service Providers The Best Linux VPNs The Best VPNs for Kodi The Best Free VPNs For Android The Best Free VPNs for Macs The Best VPNs for Netflix The Best VPNs for iPhone The Best International VPN Services The Best Chromebook VPNs The Best VPNs for Gaming Setting Up Your VPN Set Up VPN Connections in Windows 10 Set Up a VPN on Windows 7 or 8 Set Up a VPN on Mac Set Up an iPhone VPN Set Up VPN on PS4 Set Up VPN on Xbox One Install a VPN on Linux Set Up VPN on Chromecast Set Up a VPN For Roku Use a Mobile VPN on Android Fixing VPN Errors The Most Common VPN Error Codes How to Fix VPN Error 800 How to Fix VPN Error 619 Fix a VPN That's Not Connecting Test & Fix a DNS Leak Tweet Share Email You can connect to nearly any VPN service from Linux, but the process isn’t always the same. Each provider has their own offerings and configurations. Some providers specialized Linux clients. Almost all of them provide OpenVPN configurations that you can use to connect either graphically through Network Manager on your desktop or as a system service. The service route is fairly technical and doesn’t offer many benefits over the graphical route, so this guide covers only Network Manager. Use The Client Before you dig in and try to set things up with OpenVPN, it’s worth checking to see if your VPN service offers a Linux client. Client programs offer features that a simple OpenVPN configuration can’t. If you want built-in features like a VPN kill switch, automatic server switching, and other leak prevention features, turn to your VPN client first. Major VPN services like NordVPN, ExpressVPN, and Private Internet Access all offer Linux clients. Take a look at your VPN service’s website to see if they offer one too. You can almost always download a package from them and install it from the command line. That said, most support Debian distributions, like Ubuntu and Mint and Red Hat distributions, like Fedora and CentOS. Some only have Debian packages. Make sure that your distribution is supported. You can install the package with a command similar to one of these: Ubuntu/Debian $ sudo dpkg -i expressvpn_2.1.0-1_amd64.deb Fedora/CentOS $ sudo dnf install expressvpn_2.1.0-1_amd64.rpm Connecting Graphically With Network Manager The easiest way to set up a VPN connection on Linux is using Network Manager. Network Manager is the graphical network connection applet found in almost every Linux desktop environment. If you’ve ever connected to Wi-Fi from your Linux desktop, you used Network Manager to set it up. Network Manager connections can run on login, and you can manage multiple VPNs graphically, without the need to open an application or even a configuration window. Install the Packages Like with anything on Linux, there are packages that you need to install. If you have a graphical desktop, you have Network Manager, but you’ll need OpenVPN and the plugin to hook in to the Network Manager applet. Ubuntu, Debian, Linux Mint, and Derivatives $ sudo apt install openvpn network-manager-openvpn If you’re on GNOME or some GTK desktops like Cinnamon and MATE, also run: $ sudo apt install network-manager-openvpn-gnome Fedora/CentOS and RHEL 8 $ sudo dnf install openvpn networkmanager-openvpn If you’re using GNOME or another GTK desktop like Cinnamon or MATE, also run: $ sudo dnf install networkmanager-openvpn-gnome Arch Linux, Manjaro, and Derivatives # pacman -S openvpn networkmanager-openvpn OpenSUSE $ sudo zypper install openvpn NetworkManager-openvpn For Plasma specific support: $ sudo zypper install plasma-nm5-openvpn Download the OpenVPN Configurations Almost every VPN service provides ready-made OpenVPN configuration files for download. Because OpenVPN is an open source project, and a nearly universal standard throughout the VPN world, those configuration files cover most devices not directly supported by the provider. More often than not, when a VPN says they provide support for devices, like routers, they’re talking about OpenVPN support. To get your OpenVPN configurations, sign in to your VPN account, and look in your account control panel for Linux support or something directly mentioning OpenVPN files. Every service is different, so it’s impossible to say here exactly where they’ll be. If you’re having a hard time, a Google search is one of your better options. Usually, the download page you want will be one of the first results. When all else fails, contact your VPN service’s support. They’ll either get the configurations for you or a direct link to them. The files will probably come in a ZIP archive. It won’t be very large — they’re just text files — so it won’t take much time. Unpack the ZIP someplace convenient, and you’ll be ready to set up your first VPN connection. Connect With Network Manager on GNOME GNOME is easily the most popular Linux desktop environment. It’s the default choice of many major distributions, including Ubuntu, Fedora, and Debian. If you’re running one of those, and you didn’t choose a different desktop environment, GNOME is what’s on your computer. Locate the network manager applet in your system tray. It’s in the upper right corner of the screen by default. You can select anywhere in the area to show the menu. From the menu, choose Wired Settings or Wireless Settings, depending on how you’re connected. That opens Settings and takes you directly to the Network tab. Find the VPN heading, and click the plus sign icon (+). A new smaller window will pop open for you to select the type of VPN connection to create. Choose Import from file. Another window will open, letting your browse to your .ovpn configuration file. Find the one you want to set up, and Open it. A configuration window opens to set up your new connection. Everything you need to connect to the VPN is already filled in, with the exception of your User Name and Password. Fill those in, and click Add in the upper-right corner of the window. The configuration window closes, and you’ll return to the network settings. This time, you’ll find your VPN listed under the VPN heading. Flip the switch next to it to activate the connection. Connect on Most Other GTK Desktops If you're not using GNOME, but you are on one of the other popular GTK desktops, like Cinnamon, XFCE, or MATE, follow these instructions to get connected. Locate the Network Manager applet icon in your desktop’s system tray. It’s probably either going to be the standard Wi-Fi icon, a picture of a network cable, or two computers connected. Those are the most common ones, but if you’re using a custom icon theme, it could be something different. Right click the icon to reveal a management menu. From that new menu, select Edit Connections. A new Network Connections window opens, listing the current connections on your system. In the bottom left of the window, you’ll find a plus sign ( + ), a minus sign ( - ), and a gear. Click the plus icon. Another new window will open for you to select the type of connection you want to create. Scroll all the way to the bottom, and choose Import a saved VPN connection. Then, select Create. A Browse window will open up for you to locate one of your OpenVPN configuration files. Browse to your files, select one, and Open it. You’ll get a new window to set up your connection. Everything you need will already be filled in. Network Manager reads the configuration file, and plugs in everything your VPN service provided. The only thing it needs from you is your login information. Enter your VPN User name and Password in the form. When you’re done, press Save in the lower right of the window. The top configuration window will close, and show you the updated list of connections. Take a look to make sure that your new connection is there. Now, turn your attention back to the Network Manager applet icon. Select it to reveal the available connections. Mouse over VPN Connections to show the available VPNs. Select your VPN from the list. As soon as the check appears next to the connection name, your computer will start trying to connect. When it’s successful, you’ll see a notification appear to let you know that you’re connected. Automatically Connect to Your VPN If you want to automatically connect to your VPN whenever your Internet connection is active, you can set that up through Network Manager too. If you’re on a GTK desktop other than GNOME, right click the Network Manager applet icon again. GNOME users are going to need to get there another way. Open a terminal window, and run: $ nm-connection-editor Then Gnome users can skip to step 3. Select Edit Connections from the menu The same Network Connections window from before will open up. Select your regular Internet connection from the list, and press the gear icon. A new window will open for your connection. It should look similar to the one you used to set up the VPN. Select the General tab at the top of the window. Select Automatically connect to VPN. Use the drop down menu to the right to choose the VPN server you want to connect to automatically. When everything looks good, select Save in the bottom right of the window.