OpenVPN server on Windows - Teltonika Networks Wiki (2024)

Main Page > General Information > Configuration Examples > PC > Windows > OpenVPN server on Windows

Contents

  • 1 Introduction
  • 2 Configuration overview and prerequisites
  • 3 Step 1: installing OpenVPN software
  • 4 Step 2: preparing EasyRSA
  • 5 Step 3: generating certificates and keys
  • 6 Step 4: OpenVPN server configuration
  • 7 Step 5: configuring clients
  • 8 Step 6: launching the server
  • 9 See also
  • 10 External links

Introduction

OpenVPN is an open-source software application that implements virtual private network (VPN) techniques for creating secure point-to-point or site-to-site connections in routed or bridged configurations and remote access facilities.

This article contains step-by-step instructions on how to create and run an OpenVPN server on a PC that runs on Windows OS. The information provided here is geared towards users of almost any knowledge level. The instructions apply to Windows 7 and newer systems.

Configuration overview and prerequisites

Before we begin, let's overview the configuration that we are attempting to achieve and the prerequisites that make it possible.

Prerequisites:

  • A PC or Laptop running on Windows 7 or a later version
  • The computer in question must have a Public IP address
  • And an active Internet connection

Objective:

The purpose of this article is to provide the know-how needed to configure a working OpenVPN server on a Windows PC.

Step 1: installing OpenVPN software

  • Download an OpenVPN installer file from here.
    Run the downloaded file.
  • Before starting the installation process, click 'Customize':
  • While in the 'Custom Installation' window, scroll down to find OpenSSL Utilities → EasyRSA 3 Certificate Management Scripts; make sure it is installed along with OpenVPN and click 'Install Now':

Step 2: preparing EasyRSA

  • Now we can start preparing to generate certificates and keys. For this we'll be using the EasyRSA 3 application that was installed along with OpenVPN.
    EasyRSA commands have to be executed via the Windows Command Prompt. It can be opened by typing cmd in the Windows search bar (Windows button + S). When you launch it, make sure you run it as administrator:
  • Change the current directory to the EasyRSA folder. To do so, execute this command:
    cd "C:\Program Files\OpenVPN\easy-rsa"
  • Launch EasyRSA:
    EasyRSA-Start.bat
  • Before you can generate files with EasyRSA, you must first initialize a directory for the Public Key Infrastructure (PKI). This can be done with the following command:
    ./easyrsa init-pki
  • Open the vars.bat file with the Notepad text editor:
    notepad vars.bat
  • This is the template file for generating certificates, i.e., the information stored here will be offered as default values during certificate generation. Locate and edit the following lines in accordance with your needs:
    set KEY_COUNTRY=USset KEY_PROVINCE=CAset KEY_CITY=SanFranciscoset KEY_ORG=OpenVPNset [emailprotected]
  • You can also set the key size for the Diffie Hellman parameters:
    set DH_KEY_SIZE=2048
  • Once you're done, save the file and close the editor; then run the following commands:
    vars.bat./easyrsa clean-all

Step 3: generating certificates and keys

  • Now we can start generating the certificates and keys. Begin with the certificate authority (CA) - the root certificate file that will be used to sign other certificates and keys:
    ./easyrsa build-ca nopass
  • Next, build the server certificate and key:
    ./easyrsa build-server-full server nopass
  • Next, build certificates and keys for the clients:
    ./easyrsa build-client-full Client1 nopass
    Note: replace Client1 with this client's Common Name (CN). Omit "nopass" and you will be prompted to choose the client's password.
  • Lastly, generate Diffie Hellman parameters:
    ./easyrsa gen-dh

The generated and signed files should appear in the following directories (by default):

File(s) Location
CA certificate C:\Program Files\OpenVPN\easy-rsa\pki
Diffie-Hellman parameters C:\Program Files\OpenVPN\easy-rsa\pki
Client and Server keys C:\Program Files\OpenVPN\easy-rsa\pki\private
Client and Server certificates C:\Program Files\OpenVPN\easy-rsa\pki\issued

Step 4: OpenVPN server configuration

In this section we'll be discussing how to configure an OpenVPN Tunnel (TUN) server that uses:

  • The UDP protocol
  • TLS authentication

As a template, we'll be using the sample configuration file that comes along with the OpenVPN installation, but we'll be adding with some minor changes to it. You can find it in the OpenVPN installation directory, sample-config folder (default: C:\Program Files\OpenVPN\sample-config) under the name server.ovpn.

  • When you locate the file, make a copy, rename it and place it in the config directory of the OpenVPN folder (default path: C:\Program Files\OpenVPN\config). You should also copy the certificates and keys to this directory (required files: ca.crt, server.crt, server.key, dh2048.pem).
  • Open the config file with a text editor. You can use the Notepad, but for editing configuration files we recommend using Notepad++ for a better experience (you can download it from here).
  • Locate the following lines:
    ca ca.crtcert server.crtkey server.keydh dh1024.pem
  • Edit the lines in a way that corresponds with the actual file paths. The defaults used in this example are:
    ca "C:\\Program Files\\OpenVPN\\config\\ca.crt"cert "C:\\Program Files\\OpenVPN\\config\\server.crt"key "C:\\Program Files\\OpenVPN\\config\\server.key"dh "C:\\Program Files\\OpenVPN\\config\\dh2048.pem"

    NOTE: Diffie Hellman parameters file name will depend on the key size that you specified in the vars.bat file. Don't forget to change it accordingly.

  • Next comes the preferential configurations, i.e., whether you want UDP or TCP, Tunnel or Bridge, server's network, keep alive, cipher values, etc. You should configure these options in accordance with your needs. Bellow is an image of what the final configuration from this example looks like (with the comments present in the sample deleted file for more clarity):

    The following changes were made to the sample file:

    • Changed udp to udp4 to indicate that the connection should use only IPv4
    • Added client-config-dir option for possible TLS client configuration
    • Changed the ifconfig-pool-persist file path
    • Changes to the certificate and key file paths
    • Note: cipher AES-256-CBC is deprecated in v.2.5. Change CBC to GCM
    • You can harden (add security) to the VPN by creating a ta.key (openvpn--genkey --secret keys/ta.key) file on the server, placing it in the config folder and copying it to the config folder of all client machines.
    • Edit the server.ovpn file found in the OpenVPN/sample-config folder. Lines that begin with # or; will be ignored.) Feel free to change it however you want.
  • Step 5: configuring clients

    Install OpenVPN on all client machines, but omit Steps 2, 3 and 4 above. Just copy the ca.crt , client.crt and client.key files already created on the server machine in Step 4 above to the config folder of the relevant client machine.

    The next step is to create a configuration file for the clients. Edit the client.ovpn file found in the sample-config folder and save it. Now open the separate article: OpenVPN client on Windows, but note that only the latter part is relevant to this page. Begin at the line "• Save the file with an .ovpn extension."

    Note: The edited client.ovpn file can be copied to all the client machines unless specific changes need to be made.

    Step 6: launching the server

    If you've followed all the steps until now, your OpenVPN server configuration is complete! The next thing to do is to simply launch the server.

    • Run the OpenVPN GUI application as administrator in order for the application to be able to fill log files.
    • Locate OpenVPN GUI in the Windows system tray. Right click it and click Connect:

    See also

    • OpenVPN client on Windows
    • OpenVPN configuration examples
    • OpenVPN traffic split

    External links

    OpenVPN server on Windows - Teltonika Networks Wiki (2024)

    FAQs

    Can you run an OpenVPN server on Windows? ›

    Access Server supports VPN connections from Windows devices using a VPN client app. Our app, OpenVPN Connect, is available for Windows, and makes it easy to do that. Each Windows device needs a client application to connect with Access Server.

    How to use OpenVPN in Windows? ›

    Windows Installation Guide for OpenVPN Connect with Access Server
    1. Open a browser and navigate to your Access Server Client Web UI.
    2. Sign in with your username and password.
    3. Click on the Windows icon.
    4. Wait until the download completes, then open it.
    5. Run the OpenVPN Connect setup wizard.
    6. Agree to the EULA and install.

    What does OpenVPN server do? ›

    Open source OpenVPN uses VPN technologies to secure and encrypt data sent over the internet. Its custom VPN protocol uses SSL/TLS for key exchange. Since its creation in 2001 it has become the de facto standard in the open source networking space with over 60 million downloads.

    How do I access my OpenVPN server? ›

    This includes our business products: Access Server and CloudConnexa.
    1. Step 1: Download OpenVPN Connect v3. You can download the install files for OpenVPN Connect v3 for Windows, macOS, Android, and iOS here: ...
    2. Step 2: Launch OpenVPN Connect v3. ...
    3. Step 3: Connect to the VPN server.

    What is the easiest VPN server for Windows? ›

    ExpressVPN: the most user-friendly Windows VPN

    The apps are stripped-back and very easy to use, but it's also excellent for streaming and has some of the strongest privacy around. It's more expensive than NordVPN and Surfshark at $6.67 per month, but you do have a 30-day money-back guarantee to make sure you like it.

    How to set up a VPN server on Windows? ›

    Under Add a VPN connection, do the following:
    1. For VPN provider, choose Windows (built-in).
    2. In the Connection name box, enter a name you'll recognize (for example, My Personal VPN). ...
    3. In the Server name or address box, enter the address for the VPN server.
    4. For VPN type, choose the type of VPN connection you want to create.

    Does Windows 10 support OpenVPN? ›

    OpenVPN Connect v3 supports Windows 7, Windows 8, Windows 10, and Windows 11. For Windows Vista and XP, you'll need to get an open source client from the Open Source Community.

    How do I connect to an OpenVPN server? ›

    Now that you've installed OpenVPN Connect with a bundled profile, it's easy to connect to Access Server:
    1. Launch OpenVPN Connect.
    2. Click on your profile.
    3. If prompted, enter your password.
    4. You're connected and OpenVPN Connect displays connection statistics.

    Does OpenVPN need a server? ›

    Access Server's only software requirements are choosing a compatible operating system (OS), avoiding static-compiled kernels, and running on a server without other applications, as noted below. You can install Access Server on a server with a minimal install, a server install, or a full desktop installation.

    Is OpenVPN really free? ›

    VPN ClientOpenVPN ConnectDownload our free and full-featured VPN client to connect to CloudConnexa®, Access Server, or any OpenVPN protocol compatible server. Word on the Street.News and insights from the OpenVPN team.

    What is the difference between VPN and OpenVPN? ›

    What is the difference between VPN and OpenVPN? Modern VPNs use Wireguard, which is the faster protocol, whereas OpenVPN doesn't. Both offer a similar level of security, but OpenVPN's encryption can be set to a lower level — from 256-bit to 128-bit.

    How can I see who is connected to my OpenVPN server? ›

    Under Status Overview is Current Users. Clicking on this takes you to a landing page that displays a table with information about the users currently connected to your Access Server in real-time.

    How do I run OpenVPN on Windows server? ›

    The purpose of this article is to provide the know-how needed to configure a working OpenVPN server on a Windows PC.
    1. Step 1: installing OpenVPN software. ...
    2. Step 2: preparing EasyRSA. ...
    3. Step 3: generating certificates and keys. ...
    4. Step 4: OpenVPN server configuration. ...
    5. Step 5: configuring clients. ...
    6. Step 6: launching the server.

    How do I host an OpenVPN server? ›

    The purpose of this article is to provide the know-how needed to configure a working OpenVPN server on a Windows PC.
    1. Step 1: installing OpenVPN software. ...
    2. Step 2: preparing EasyRSA. ...
    3. Step 3: generating certificates and keys. ...
    4. Step 4: OpenVPN server configuration. ...
    5. Step 5: configuring clients. ...
    6. Step 6: launching the server.

    How to set up an OpenVPN server on Windows 11? ›

    How to set up OpenVPN connection on Windows 11
    1. Allow installation of the program.
    2. Run OpenVPN app.
    3. After launch, a folder for configuration files is created.
    4. In the Subscriptions download OpenVPN files for Windows and extract the ZIP archive to the Desktop.

    Top Articles
    Coinbase Lawsuit: Coinbase Class Action Lawsuit - The Rosen Law
    What Does the 👻 Ghost Emoji Mean?
    English Bulldog Puppies For Sale Under 1000 In Florida
    Katie Pavlich Bikini Photos
    Gamevault Agent
    Pieology Nutrition Calculator Mobile
    Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
    Hendersonville (Tennessee) – Travel guide at Wikivoyage
    Compare the Samsung Galaxy S24 - 256GB - Cobalt Violet vs Apple iPhone 16 Pro - 128GB - Desert Titanium | AT&T
    Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
    Craigslist Dog Kennels For Sale
    Things To Do In Atlanta Tomorrow Night
    Non Sequitur
    Crossword Nexus Solver
    How To Cut Eelgrass Grounded
    Pac Man Deviantart
    Alexander Funeral Home Gallatin Obituaries
    Shasta County Most Wanted 2022
    Energy Healing Conference Utah
    Geometry Review Quiz 5 Answer Key
    Hobby Stores Near Me Now
    Icivics The Electoral Process Answer Key
    Allybearloves
    Bible Gateway passage: Revelation 3 - New Living Translation
    Yisd Home Access Center
    Home
    Shadbase Get Out Of Jail
    Gina Wilson Angle Addition Postulate
    Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
    Walmart Pharmacy Near Me Open
    Marquette Gas Prices
    A Christmas Horse - Alison Senxation
    Ou Football Brainiacs
    Access a Shared Resource | Computing for Arts + Sciences
    Vera Bradley Factory Outlet Sunbury Products
    Pixel Combat Unblocked
    Movies - EPIC Theatres
    Cvs Sport Physicals
    Mercedes W204 Belt Diagram
    Mia Malkova Bio, Net Worth, Age & More - Magzica
    'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
    Teenbeautyfitness
    Where Can I Cash A Huntington National Bank Check
    Topos De Bolos Engraçados
    Sand Castle Parents Guide
    Gregory (Five Nights at Freddy's)
    Grand Valley State University Library Hours
    Holzer Athena Portal
    Hello – Cornerstone Chapel
    Stoughton Commuter Rail Schedule
    Selly Medaline
    Latest Posts
    Article information

    Author: Mrs. Angelic Larkin

    Last Updated:

    Views: 5652

    Rating: 4.7 / 5 (47 voted)

    Reviews: 94% of readers found this page helpful

    Author information

    Name: Mrs. Angelic Larkin

    Birthday: 1992-06-28

    Address: Apt. 413 8275 Mueller Overpass, South Magnolia, IA 99527-6023

    Phone: +6824704719725

    Job: District Real-Estate Facilitator

    Hobby: Letterboxing, Vacation, Poi, Homebrewing, Mountain biking, Slacklining, Cabaret

    Introduction: My name is Mrs. Angelic Larkin, I am a cute, charming, funny, determined, inexpensive, joyous, cheerful person who loves writing and wants to share my knowledge and understanding with you.