DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk12 min

How to Set Up an OpenVPN Server on a VPS

A practical, security-focused guide to deploying OpenVPN on a Linux VPS, from offline CA creation and server configuration to routing, NAT, client profiles, troubleshooting, and offboarding.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To run OpenVPN on a VPS, you need a publicly reachable server address, a certificate authority (CA) that issues separate server and client credentials, an OpenVPN routed tunnel, and matching firewall, forwarding, and NAT rules. The safest practical workflow is to build the PKI with Easy-RSA 3, keep the CA private key offline, install only the required certificates and keys on the VPS, then test connectivity one layer at a time.

What you need before starting

This guide describes a conventional Linux VPS deployment using OpenVPN Community Edition and a routed TUN interface. Commands and service names differ between distributions, so use your distribution’s supported OpenVPN and Easy-RSA packages and its service manager.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Requirement Why it matters What to confirm
Linux VPS Runs the OpenVPN daemon and routes client traffic. You have administrative access and a supported package source.
Public IPv4 or IPv6 address Clients must reach the VPN listener from the internet. Record the address or DNS name. If the VPS is behind another gateway, arrange port forwarding.
Two firewalls Cloud-provider rules and the operating-system firewall can independently block traffic. Allow the selected OpenVPN protocol and port in both places, while restricting SSH to trusted source addresses.
PKI workspace OpenVPN authenticates peers with certificates signed by a CA. Prepare a protected, preferably offline location for the CA private key.
Client devices Every device needs its own identity. Plan one certificate/key pair and one profile per device or person.

Update the VPS before installing software, set a correct time source, and disable or restrict password-based administrative login where your operating system supports key-based access. Certificate validation depends on sensible system clocks; a badly skewed clock can make valid credentials appear expired or not yet valid.

Choose the administration model

There are two common OpenVPN deployment models. The Community Edition uses text configuration, the operating-system service manager, Easy-RSA, and your own firewall rules. Access Server adds a supported management interface and a more guided user lifecycle. Neither model removes the need to design routing, protect credentials, and secure the VPS.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.
Decision area Community Edition Access Server
Administration Manual configuration files, service commands, and firewall policy. Supported management UI and packaged administration workflow.
PKI and users You operate CA files, issue certificates, and revoke them in your CA workflow. User and profile management is more integrated with the product’s administration model.
Cost Open-source server software; VPS, support, and administration remain your responsibility. Commercial licensing may apply; verify current terms for your deployment.
Control Maximum control over routes, NAT, firewall chains, and service hardening. More guided operation, with some choices expressed through the management layer.
Footprint A daemon, PKI material, and your chosen firewall tools. Additional management components and their associated maintenance.

The rest of this article uses the Community Edition workflow because it exposes each security and routing decision. The same network prerequisites apply when you choose a managed installation.

Design the tunnel before installing it

Use a routed TUN network

A baseline routed profile uses dev tun and a private client subnet such as 10.8.0.0/24. The VPS assigns virtual addresses from that subnet, while the server’s normal network interface carries encrypted packets to and from the internet or your private networks. This is different from a TAP bridge, which extends an Ethernet segment and has different operational requirements.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep the tunnel subnet non-overlapping with networks used by clients. If a user’s home or office already uses 10.8.0.0/24, choose another private range and change the server, firewall, routes, and client configuration together. A conflict can make a destination appear local and prevent traffic from entering the tunnel.

Decide what the tunnel should carry

  • Full-tunnel internet access: the client sends its default route through the VPS. The VPS must forward and NAT that traffic, and its egress policy must permit it.
  • Selected private subnets: push only the routes needed for internal services. Those networks need a return route to the VPN subnet, or the VPS must NAT traffic toward them.
  • VPN-only service access: allow access to services on the VPS or connected networks without changing the client’s internet default route.

Do not enable a full-tunnel route merely because the handshake works. It changes where all client traffic exits and therefore changes DNS, logging, egress filtering, and bandwidth requirements.

Choose the listener

The conventional sample uses UDP port 1194. You may select another port, but the cloud firewall, host firewall, server configuration, and every client profile must agree. UDP is the normal transport for OpenVPN; TCP is possible for particular networks but can perform poorly when layered over another TCP connection.

Build the certificate authority with Easy-RSA 3

OpenVPN’s trust model is mutual certificate authentication. A CA signs a server certificate and separate client certificates. The server verifies the client’s certificate, and the client verifies the server certificate. The CA certificate can be distributed to clients; the CA private key must not be.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

Separate CA duties from the running VPS

Easy-RSA’s documented workflow supports a CA environment separate from the VPN server. Build or initialize the PKI on a protected administration machine, removable offline system, or other location with tightly limited access. Copy only the server-side artifacts needed at runtime to the VPS. Anyone who can use the CA private key can issue a credential trusted by this deployment.

Initialize the PKI

Install the Easy-RSA package supplied for your operating system, then run its commands from the Easy-RSA directory. The following is the standard sequence; exact paths depend on the package layout:

  1. Initialize a new PKI with ./easyrsa init-pki.
  2. Create the CA with ./easyrsa build-ca. Protect the CA key with a strong passphrase unless your controlled automation requires another arrangement.
  3. Create a server key and certificate request with ./easyrsa gen-req server, then sign it with ./easyrsa sign-req server server.
  4. Create the Diffie-Hellman parameters required by the installed OpenVPN version with ./easyrsa gen-dh, unless your current package’s sample configuration specifies a different mechanism.
  5. For each device, create a distinct request, for example ./easyrsa gen-req laptop-alice, and sign it as a client with ./easyrsa sign-req client laptop-alice.

Use stable, descriptive certificate names. A name such as laptop-alice identifies one credential; it does not grant a person unlimited devices. Issue another certificate for a phone, tablet, or replacement computer so that one lost profile can be revoked without disconnecting every other device.

Copy only runtime material

The VPS normally needs the CA certificate, the signed server certificate, the matching server private key, the generated parameters required by the installed version, and the server configuration. It does not need the CA private key, the private keys for unrelated clients, or the whole Easy-RSA working directory. Set restrictive ownership and permissions on private keys, and keep encrypted backups of the CA material offline.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install OpenVPN and prepare the VPS

Install distribution packages

Use the operating system’s supported repositories rather than downloading an unverified binary. On a Debian- or Ubuntu-style system, the pattern is:

sudo apt update
sudo apt install openvpn easy-rsa

Other distributions use different package managers and may place files in different directories. Check the installed version and read its shipped sample configuration; directives can change as older options are deprecated.

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Place the server files

Many current packages use /etc/openvpn/server/ for server configurations. Place the server certificate, key, CA certificate, and required parameter file there with permissions that allow the OpenVPN service to read them but prevent ordinary users from reading private keys. Keep the CA private key outside this directory and, when practical, off the running host altogether.

Start from the official sample

Copy the sample server configuration supplied by your package and edit it instead of assembling directives from memory. A conventional routed profile contains settings equivalent to these:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
dev tun
proto udp
port 1194
server 10.8.0.0 255.255.255.0
ca ca.crt
cert server.crt
key server.key
dh dh.pem
persist-key
persist-tun

File names and the Diffie-Hellman or equivalent parameter directive must match the files and options supported by your installed release. Add route-push directives only for networks you intend clients to use. For a full tunnel, the sample commonly uses a redirect-gateway directive; pair it with deliberate DNS and egress policy rather than assuming that a route alone provides working internet access.

Drop privileges after startup

On Unix-like systems, consider directives such as user nobody and group nobody when your operating system and OpenVPN version support them. Confirm that the reduced-privilege process can still read its certificates, write its log or status files, and create the TUN interface during startup. A permission change that prevents logging can make a healthy service look broken, so test it before relying on it.

Open the listener and route traffic

Allow the listener in both firewalls

Permit UDP 1194, or your chosen port, in the VPS provider’s network firewall and in the VPS operating-system firewall. Allow administrative SSH only from trusted source addresses. If another gateway sits in front of the VPS, forward the public listener port and protocol to the VPS; opening the host firewall alone cannot make a private address reachable.

Do not expose the management interface or database services to the public internet just because the VPN port is open. Keep those services bound to private addresses or restricted by source rules.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Enable IPv4 forwarding

For clients to reach networks beyond the VPN host, the kernel must forward packets:

sudo sysctl -w net.ipv4.ip_forward=1

Persist the setting using your distribution’s sysctl configuration, then reload it through the distribution’s normal mechanism. If you intentionally support IPv6 clients, design and secure IPv6 forwarding separately; enabling IPv4 forwarding does not provide an IPv6 route.

Apply NAT only when your design needs it

Full-tunnel internet access commonly requires masquerading the VPN subnet on the VPS’s public interface. First identify the interface used for the default route with ip route get 1.1.1.1. If that interface is named eth0, an example rule is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE

Also permit forwarding between the TUN interface and the public interface in your firewall policy. Persist the rule using the firewall system supported by your distribution; a rule entered interactively can disappear at reboot. For selected private subnets, prefer explicit routes and return paths where possible instead of hiding every client behind NAT.

Check the VPS provider’s egress rules as well. A client can complete TLS authentication and receive a tunnel address while still being unable to browse because forwarding, NAT, DNS, or outbound policy is missing.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Start the service and verify the server

  1. Validate the configuration and file permissions before exposing the port.
  2. Start the service through the distribution’s service manager. A common systemd pattern for a file named server.conf is sudo systemctl enable --now openvpn-server@server; some distributions use a different unit name.
  3. Inspect the unit status and journal immediately after startup, for example sudo systemctl status openvpn-server@server and sudo journalctl -u openvpn-server@server.
  4. Confirm that a TUN device exists, the process is listening on the selected UDP port, and the host firewall has the expected rules.

A service that starts successfully has only passed the server-side configuration test. It has not proved that a remote client can reach the port or that forwarded traffic will work.

Create a profile for each client device

Each profile must contain the server’s public hostname or IP address and port, matching dev and proto values, the CA certificate, and that device’s own signed certificate and private key. A typical remote directive points to the public endpoint and selected port, such as remote vpn.example.net 1194; use the real address you control.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can distribute certificates as separate files referenced by the profile or embed them in an .ovpn file. Embedding is convenient, but the resulting file is a complete credential and must be transferred and stored like a private key. Protect it with the device’s access controls and do not send the same profile to multiple people or devices.

Only the CA certificate is shared across clients. Never reuse a client private key. If a phone is lost, revoke that phone’s certificate rather than replacing every profile.

Test in layers instead of guessing

  1. Reachability: from an external network, confirm that the VPS public address and selected UDP port are allowed by the cloud and host firewalls.
  2. TLS and certificate handshake: import one client profile and inspect the OpenVPN log for successful mutual authentication. Certificate path errors, mismatched credentials, expiry, revocation, and incorrect clocks commonly fail here.
  3. Virtual address: verify that the client receives an address from the configured tunnel subnet, such as 10.8.0.0/24, and that the server has the corresponding TUN interface.
  4. Private-network access: test a specific permitted private IP or service. Confirm return routes on that network or the intended NAT rule.
  5. Internet egress: only for a full-tunnel design, check the client’s route table, DNS resolution, VPS forwarding, NAT, and outbound firewall policy.

Keep the client and server clocks synchronized while testing. Record the exact error and the layer at which it appears; changing client routes cannot fix a blocked listener, and changing certificates cannot fix missing NAT.

Troubleshoot the common failures

Symptom Likely cause Checks and correction
No connection attempt reaches the server Wrong public address, upstream forwarding, cloud firewall, or host firewall. Verify DNS, the VPS address, protocol, port, provider rule, and local firewall. If another gateway is present, forward the listener to the VPS.
TLS or certificate error Wrong file path, mismatched CA or certificate, expired/revoked credential, or bad system time. Check the profile’s embedded or referenced files, certificate names and validity, revocation status, and clocks on both peers.
Client connects but has no private-network access Missing pushed route, missing return route, or a restrictive forwarding policy. Inspect the client route table, server forwarding rules, and the destination network’s route back to the VPN subnet.
Client connects but internet access fails Full-tunnel route was not pushed, IP forwarding is off, NAT uses the wrong interface, or egress is blocked. Check the redirect-gateway setting, net.ipv4.ip_forward, the actual default-route interface, NAT counters, and provider egress policy.
Service fails after privilege reduction The unprivileged process cannot read keys or write logs/status files. Correct ownership and permissions, then restart and inspect the journal. Keep the privilege drop only when it works with your package and configuration.
One lost device requires revoking everyone The same client certificate/key was reused. Issue one credential per device going forward; revoke the exposed certificate and distribute a replacement profile.

Revoke a client and rotate access

When a device is lost, an employee leaves, or a private key may have been copied, remove the profile from the device and revoke its certificate in the CA environment. Easy-RSA’s revocation workflow updates the certificate-revocation list (CRL). Publish the updated CRL where the server configuration expects it and reload or restart the service as required by that configuration. A revoked certificate is useful only when the running server is actually using the current CRL.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep an inventory of certificate names, issue dates, devices, and revocation dates. Back up the CA directory offline and protect those backups as carefully as the live CA key. Periodically review active profiles, VPS packages, firewall rules, and logs; remove unused credentials and test that a deliberately revoked profile can no longer authenticate.

Operational hardening checklist

  • Restrict SSH to trusted keys and source addresses; do not treat the VPN listener as a substitute for host hardening.
  • Keep the operating system, OpenVPN package, and Easy-RSA package updated through trusted repositories.
  • Store the CA private key offline when practical, with encrypted backups and limited custodians.
  • Use separate client credentials and promptly revoke lost or exposed profiles.
  • Document the tunnel subnet, listener protocol and port, pushed routes, NAT interface, and firewall rules.
  • Limit pushed routes to what each use case needs; a full-tunnel route is a deliberate traffic-policy decision.
  • Review logs for repeated authentication failures and unexpected connection sources without logging private keys or sensitive profile contents.
  • Test recovery: restore the CA backup in a controlled environment, issue a test certificate, and confirm that the server can be rebuilt without copying the CA private key to production.

When a managed installation is the better fit

Manual Community Edition deployment is appropriate when you want direct control of configuration, routing, firewalling, and certificate operations and are comfortable maintaining them. A managed Access Server deployment can be preferable when several administrators need a supported interface, centralized user lifecycle, and less hand editing. It still belongs behind a properly configured firewall, still needs a reachable address, and still requires you to understand which routes and egress policies users receive. Choose based on operational responsibility rather than assuming that a management UI fixes an incorrectly designed network.

What a successful deployment looks like

The finished system has a reachable UDP listener, a CA whose private key is protected away from the VPN host, a server certificate and key installed only where required, and one unique client certificate/key pair per device. The server creates a TUN network such as 10.8.0.0/24, forwards only the traffic you intended, and applies NAT only where your design calls for it. Logs show a valid certificate handshake, the client receives a tunnel address, permitted private services respond, and full-tunnel internet access works only after forwarding, DNS, NAT, and egress policy have each been verified.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.