OpenVPN Server on a VPS: Users, Profiles and Connections
Manage your own OpenVPN server: download the ready-made profile, add and revoke users, and connect from Windows, macOS, iPhone, Android and Linux.
OpenVPN is open-source VPN software that secures connections with SSL/TLS encryption and authentication. It runs over UDP or TCP and gets through most firewalls and proxies.
When you order an OpenVPN VPS, the OpenVPN server and a user management script are installed for you, together with one ready-made client profile. You manage everything over SSH; users connect with the free OpenVPN apps.
- Operating system: Ubuntu 22.04
- Minimum server: 1 vCPU and 1 GB RAM
- Server login: root over SSH, with your server’s root password
Find your login details
When your server is ready, we email you its IP address and the root password. The same details are in your client area, under the server’s information. In the commands below, replace SERVER_IP with your server’s IP address.
Connect to the server and check OpenVPN
Log in over SSH, check that the OpenVPN service is running and look at its files. The configuration lives in /etc/openvpn/, and /root/openvpn-conf.sh is the script that manages users.
The status should show active (running).
ssh root@SERVER_IP
systemctl status openvpn@server
ls -la /etc/openvpn/Download the ready-made client profile
The server comes with one client profile, a .ovpn file in /root/. List it, then copy it to your computer, replacing PROFILE with the file’s name:
Give each person their own profile (step 4) instead of sharing this one, so you can revoke one user without affecting the others.
ls /root/*.ovpn
scp root@SERVER_IP:/root/PROFILE.ovpn ~/Downloads/Add a new user
Run the management script on the server and follow its menu:
- Choose 1, Add a new user.
- Enter a client name. Use only letters, numbers, underscores or dashes.
- Choose 1 for a profile without a password, or 2 to protect the profile’s key with a password, which you then enter twice.
- The script saves the profile as /root/UserName.ovpn, named after the client.
A password-protected profile asks for its password at every connection, so it stays safe even if the file is lost.
/root/openvpn-conf.shSend the profile to the user
Copy the new profile from the server to your computer:
The .ovpn file is the user’s key to your VPN. Send it through a secure channel, not as a plain email attachment.
scp root@SERVER_IP:/root/UserName.ovpn ./Connect from Windows
Windows users connect with OpenVPN Community Edition (OpenVPN GUI).
- Download OpenVPN Community Edition from openvpn.net and install it with the default components, including the TAP driver.
- Copy the profile to your computer, for example with the commands below in PowerShell. Enter the server’s root password when asked.
- Right-click the OpenVPN icon in the system tray and choose Import file…, then pick the .ovpn file.
- Right-click the icon again and choose Connect. Enter the profile’s password if it has one.
- The icon turns green once you are connected.
mkdir C:\OpenVPN
scp root@SERVER_IP:/root/UserName.ovpn C:\OpenVPN\Connect from macOS, iPhone, Android or Linux
Each platform has an official OpenVPN client that imports the same .ovpn file.
- macOS: install OpenVPN Connect and drag the .ovpn file into it.
- iPhone and Android: install OpenVPN Connect from the App Store or Google Play, open the .ovpn file with it (or use Import Profile > File) and tap Connect.
- Linux: install OpenVPN and start the profile with the commands below.
To check the connection, open any “what is my IP” site: it should show your server’s IP address. To disconnect, use Disconnect in the app.
sudo apt install openvpn
sudo openvpn --config UserName.ovpnRevoke a user
To remove someone’s access, run the management script again:
- Choose 2, Revoke existing user.
- Pick the user from the list.
- Confirm with y.
The script revokes the user’s certificate. They can no longer connect, even with their .ovpn file.
/root/openvpn-conf.shRevoke a certificate manually
If you prefer to work with Easy-RSA directly, list the issued certificates, revoke one, rebuild the revocation list (CRL) and restart OpenVPN:
Each .crt file in the issued folder is one user. The name you revoke must match the file name without .crt, and it is case-sensitive.
ls /etc/openvpn/easy-rsa/pki/issued/
cd /etc/openvpn/easy-rsa/
./easyrsa revoke UserName
./easyrsa gen-crl
cp pki/crl.pem /etc/openvpn/crl.pem
chmod 644 /etc/openvpn/crl.pem
systemctl restart openvpn@serverGet a server for this guide
OpenVPN VPS comes ready with everything in this guide, from $7.50/mo billed yearly.
See OpenVPN VPS plansTable of Contents
- 1.1. Find your login details
- 2.2. Connect to the server and check OpenVPN
- 3.3. Download the ready-made client profile
- 4.4. Add a new user
- 5.5. Send the profile to the user
- 6.6. Connect from Windows
- 7.7. Connect from macOS, iPhone, Android or Linux
- 8.8. Revoke a user
- 9.9. Revoke a certificate manually
Explore More VPS Hosting Options
Find the right server for your project.
Start Your NodexVPS Today
Save 50% with yearly billing. No contract, cancel any time.