Prerequisites
Before starting, ensure you have:
Server Requirements
- • RamNode VPS (1-2GB RAM recommended)
- • Ubuntu 22.04/24.04 or newer
- • Root SSH access
- • Public IPv4 address
Optional Setup
- • Domain name (e.g., vpn.yourdomain.com)
- • Firewall knowledge
- • Basic Linux command line skills
Launch Instance
Create a RamNode VPS instance with the following specifications:
Recommended Instance Configuration:
- • Memory: 1-2GB RAM (sufficient for most users)
- • OS: Ubuntu 24.04 or newer
- • Storage: 25GB SSD (default is fine)
- • Network: Note your public IPv4 address
After launching, optionally create a hostname for easier connection:
vpn.yourdomain.com → YOUR_SERVER_IP💡 Pro Tip: Using a hostname makes it easier to remember and manage your VPN connection.
Download Installation Script
SSH into your server and download the OpenVPN installation script:
ssh root@your-server-ipgit clone https://github.com/angristan/openvpn-install.git
cd openvpn-install
cp openvpn-install.sh /usr/local/bin/openvpn-admin
chmod 700 /usr/local/bin/openvpn-adminℹ️ This script simplifies OpenVPN installation and provides ongoing management capabilities.
Run the Installer
Execute the installation script and configure your OpenVPN server:
openvpn-adminThe installer will prompt you for configuration options:
⚠️ Important: When prompted to create the first user, press Ctrl+C to exit - we'll configure private network routing first.
Configure Private Network Access
If you want VPN clients to access your cloud's private network, configure routing:
nano /etc/openvpn/server.confAdd this line to enable access to your private network:
push "route 10.24.0.0/16 255.255.0.0"systemctl restart openvpnConfigure the client template to route private network traffic:
nano /etc/openvpn/client-template.txtroute 10.24.0.0 255.255.0.0Enable NAT and IP forwarding:
# Enable NAT (replace ens3 with your network interface)
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o ens3 -j MASQUERADE
iptables-save
# Enable IP forwarding
echo 'net.ipv4.ip_forward=1' >> /etc/sysctl.conf
sysctl -p📝 Note: Replace 10.24.0.0/16 with your actual private network range, and ens3 with your network interface (check with ip a).
Create Client Configurations
Create configuration files for each VPN user:
openvpn-adminSelect option (1) to "Add a new User" and provide:
Client Configuration Options:
- Client name: Enter a unique username (e.g., "john-laptop")
- Password protection: Choose [y] for additional security (recommended)
- Password: Set a strong password for the client certificate
✅ Success: Client configuration file will be saved to /root/ folder. Each user needs their own unique configuration file.
Client Setup Instructions
Install OpenVPN clients on various devices:
Testing Your Connection
Verify your VPN connection is working correctly:
Connection Tests:
- • Check your public IP address
- • Test DNS resolution
- • Verify private network access
- • Test internet connectivity
Useful Commands:
- •
curl ifconfig.me- Check IP - •
nslookup google.com- Test DNS - •
ping 10.24.0.1- Private network
# Before connecting to VPN curl ifconfig.me # After connecting to VPN (should show server IP) curl ifconfig.me🎉 Success: If your IP address changed to your server's IP, your VPN is working correctly!
Server Management
Manage your OpenVPN server and users:
# Add new users
openvpn-admin
# Check server status
systemctl status openvpn
# View connected clients
cat /etc/openvpn/openvpn-status.log
# Restart OpenVPN service
systemctl restart openvpnManagement Options via openvpn-admin:
- • Add new users
- • Revoke user certificates
- • Remove OpenVPN installation
- • View server configuration
