Russia
A complete beginner-friendly guide to setting up your own secure OpenVPN server on a VPS using a simple automated command.
by Hamza
OpenVPN is one of the most trusted open-source VPN solutions for securing internet traffic, protecting privacy, and creating encrypted connections between your device and a remote server.
By installing OpenVPN on your own VPS, you gain full control over your VPN server instead of depending on shared third-party VPN services. This means better privacy, dedicated resources, and more flexibility.
If you want a fast and reliable server for your VPN setup, try our VPS at Retzor and start building your private VPN server today.
OpenVPN does not require a powerful server. A small VPS is enough for personal browsing, remote access, and secure internet usage.
| Resource | Recommended Minimum |
|---|---|
| RAM | 512 MB or higher |
| CPU | 1 vCPU |
| Storage | 10 GB SSD |
| Operating System | Ubuntu 22.04 or 24.04 recommended |
First, connect to your server using SSH. Replace your-server-ip with your real VPS IP address.
Example:
Before installing OpenVPN, update your server packages to improve security and compatibility.
Now run the automated OpenVPN installer. This command downloads the script and starts the installation process automatically.
If your server does not have wget installed, you can use curl instead:
The installer will ask a few questions. For most users, the default settings are fine.
| Option | Recommended Choice |
|---|---|
| Protocol | UDP |
| Port | 1194 |
| DNS | Cloudflare or Google DNS |
| Client Name | myvpnclient |
After installation, the script creates a client configuration file ending in .ovpn . This file is required to connect your device to the VPN.
Download it to your local computer using:
Install an OpenVPN client on your device, import the .ovpn file, and click connect.
| Device | Recommended Client |
|---|---|
| Windows | OpenVPN GUI |
| macOS | Tunnelblick or OpenVPN Connect |
| Android | OpenVPN Connect |
| iPhone / iPad | OpenVPN Connect |
After connecting, check your public IP address. It should match your VPS server IP instead of your home or office internet IP.
You can run the installer again anytime to manage your VPN users.
| Action | Purpose |
|---|---|
| Add Client | Create a new VPN user profile. |
| Revoke Client | Remove access for an old user. |
| Remove OpenVPN | Uninstall OpenVPN from the VPS. |
If your VPS uses UFW firewall, allow the default OpenVPN UDP port.
| Issue | Solution |
|---|---|
| VPN connects but no internet | Enable IP forwarding and check firewall rules. |
| Cannot connect to server | Verify VPS IP, port 1194 UDP, and client file. |
| Slow VPN speed | Use UDP, choose a closer VPS location, or upgrade bandwidth. |
Installing OpenVPN on a VPS with one command is one of the easiest ways to create your own private VPN server. With an automated installer, you do not need advanced Linux knowledge or complicated manual configuration.
A self-hosted OpenVPN server gives you better privacy, secure browsing, encrypted traffic, and full control over your VPN environment.
Ready to build your own VPN? Try our VPS at Retzor and install OpenVPN in just a few minutes.