OpenVPN Installation Guide
This guide walks you through installing and configuring an OpenVPN server using a community script. It also covers creating client profiles and connecting from devices.
1. Download the Installation Script
Run the following command to download the OpenVPN installer script:
2. Make the Script Executable
Grant execution permissions to the script:
3. Run the Installer
Execute the script to install OpenVPN and create your first client profile.
Accept the default settings when prompted.
Provide a name for your first client (e.g., Client1
).
Manage Additional Clients
To create additional clients, simply rerun the script:
You can repeat this process for as many devices as you need.Tip
If you plan to connect multiple devices, give each profile a descriptive name
(e.g., laptop
, phone
, tablet
) to make management easier.
4. Configure Port Forwarding
Log into your router and forward the port chosen during installation (default is 1194/UDP, unless you selected TCP).
Warning
Without port forwarding, external clients will not be able to connect to your VPN.
Warning
Exposing ports directly to the internet increases your attack surface. Always ensure your server is patched and protected with strong credentials.
5. (Optional) Copy Client Configuration
By default, client profiles are stored in /root/. For easier access, copy your client file to your home directory:
Replace
Client1.ovpn
with the actual client profile name you provided.
6. Import Client Configuration
-
Install the OpenVPN client on your device (Windows, macOS, Linux, iOS, or Android) from openvpn.net/client.
-
Import the .ovpn file you generated.
-
Connect to your VPN using the client app.
Note
On mobile devices, you can use the official OpenVPN Connect app from the App Store (iOS) or Play Store (Android).
✅ Next Steps
- Test your VPN connection from outside your home network.
Tip
Test your connection by visiting https://whatismyipaddress.com to confirm your public IP matches your VPN server.
-
Add additional clients by rerunning the installer.
-
Secure your server by keeping your system updated.
📚 References
Nyr’s OpenVPN Install Script (GitHub)
Installing and Using the OpenVPN Client
Follow the steps below to install the OpenVPN client and upload your configuration file on different devices.
Android
- Open the Google Play Store.
- Search for OpenVPN Connect and install it.
- Open the app and allow the requested permissions.
- Tap OVPN Profile → Import Profile from File.
- Select the
.ovpn
configuration file from your phone (Downloads or email). - Tap Add → then tap Connect.
Windows
- Go to OpenVPN Client Downloads.
- Download the OpenVPN Connect for Windows installer.
- Run the installer and complete the setup wizard.
- Launch OpenVPN Connect.
- On the main screen, click Upload File under Have a configuration file instead (.ovpn)?.
- Browse and select your
.ovpn
configuration file. - Once imported, the profile will appear in the client. Click Connect to start the VPN.
macOS
- Go to OpenVPN Client Downloads.
- Download the OpenVPN Connect for macOS installer.
- Open the
.dmg
file and drag the OpenVPN Connect app into your Applications folder. - Launch OpenVPN Connect.
- Click File → Import Profile and select your
.ovpn
configuration file. - Click Connect.
iPhone (iOS)
- Open the App Store on your iPhone.
- Search for OpenVPN Connect and install it.
- Email or AirDrop your
.ovpn
configuration file to your iPhone. - Tap the
.ovpn
file → choose Open in OpenVPN. - In the OpenVPN Connect app, tap Add to import the profile.
- Tap Connect to start the VPN.