Setup guide

OpenVPN Setup for Linux

Complete guide to configuring OpenVPN on your Linux system.

← Back to Support Documentation

📋 Before You Begin

Ensure you have your CodaMail VPN credentials ready. You’ll need your VPN username and password (different from your email login) to connect to our secure VPN servers.

Important: All VPN and proxy servers are under the cotse.net domain. The codamail.com domain is exclusively for email services.

📦 Step 1: Install OpenVPN

Distribution-Specific Installation

  • Red Hat / Fedora / CentOS: sudo dnf install openvpn (or sudo yum install openvpn on older versions).
  • Ubuntu / Debian: sudo apt update && sudo apt install openvpn
  • openSUSE: sudo zypper install openvpn
  • Arch Linux: sudo pacman -S openvpn

📥 Step 2: Download Configuration Files

Download one or more of the following OpenVPN configuration files to your Linux system:

London Server

Server: london.cotse.net

Config File: london.ovpn

Location: United Kingdom

Chicago Server

Server: chicago.cotse.net

Config File: chicago.ovpn

Location: United States (Illinois)

Amsterdam Server

Server: amsterdam.cotse.net

Config File: amsterdam.ovpn

Location: Netherlands

💻 Step 3A: Command Line Setup (Recommended)

Configuration Preparation

  • Create a directory for VPN configurations: mkdir ~/vpn-configs
  • Move your downloaded .ovpn files to this directory: mv ~/Downloads/*.ovpn ~/vpn-configs/

Create Credential File

  • Create a file to store your VPN credentials: nano ~/vpn-configs/auth.txt
  • Add your credentials (one per line):
    your-vpn-username
    your-vpn-password
  • Secure the file: chmod 600 ~/vpn-configs/auth.txt

Update Configuration File

  • Edit your .ovpn file to use the credential file: nano ~/vpn-configs/london.ovpn
  • Add this line: auth-user-pass auth.txt
  • Save and exit the editor.

🖥️ Step 3B: NetworkManager GUI Setup (Alternative)

Install NetworkManager OpenVPN Plugin

  • Ubuntu/Debian: sudo apt install network-manager-openvpn-gnome
  • Fedora: sudo dnf install NetworkManager-openvpn-gnome
  • openSUSE: sudo zypper install NetworkManager-openvpn-gnome
  • Arch: sudo pacman -S networkmanager-openvpn

Import Configuration

  • Open your network settings (varies by desktop environment).
  • Click “+” or “Add Connection”.
  • Select “Import a saved VPN configuration”.
  • Browse to your .ovpn file and import it.
  • Enter your VPN username and password.
  • Click “Save” or “Apply”.

🚀 Step 4: Connect to VPN

Command Line Connection

  • Connect to the VPN server: sudo openvpn --config ~/vpn-configs/london.ovpn
  • The connection will run in the foreground.
  • Press Ctrl+C to disconnect.
  • For background operation: sudo openvpn --config ~/vpn-configs/london.ovpn --daemon

NetworkManager Connection

  • Click on the network icon in your system tray.
  • Look for “VPN Connections” section.
  • Select your imported VPN configuration.
  • The connection will be established automatically.

⚙️ Advanced: System Service Setup

Create Systemd Service (Optional)

  • Copy config to system directory:
    sudo cp ~/vpn-configs/london.ovpn /etc/openvpn/client/
    sudo cp ~/vpn-configs/auth.txt /etc/openvpn/client/
  • Enable and start the service:
    sudo systemctl enable openvpn-client@london
    sudo systemctl start openvpn-client@london

Service Management

  • Check status: sudo systemctl status openvpn-client@london
  • Stop service: sudo systemctl stop openvpn-client@london
  • View logs: sudo journalctl -u openvpn-client@london

🔥 Firewall Configuration

UFW (Ubuntu)

  • Allow OpenVPN traffic: sudo ufw allow 1194/udp
  • Enable forwarding if needed for other devices.

Firewalld (Fedora / CentOS)

  • Allow OpenVPN service: sudo firewall-cmd --add-service=openvpn --permanent
  • Reload firewall: sudo firewall-cmd --reload

iptables (Manual)

  • Allow OpenVPN ports as needed.
  • Configure NAT rules for routing.

🌍 Server Selection Guide

Performance Recommendations

  • London: Optimal for European users, excellent global connectivity.
  • Chicago: Best for North American users, central US location.
  • Amsterdam: Great for European users, strong privacy laws.

Network Optimization

  • Default Port: Config files use port 1194/UDP by default.
  • Alternative Ports Available: If blocked, servers also listen on:
    • UDP: 20, 123, 31482 (bypasses most firewalls).
    • TCP: 443, 80, 993 (works on restrictive networks).
  • Edit the .ovpn file to change remote server-address 1194 udp to use any alternative port.
  • Example: remote london.cotse.net 443 tcp for HTTPS port.

Testing Server Performance

  • Use ping to test latency: ping london.cotse.net
  • Test speed after connecting: curl -s https://fast.com
  • Monitor bandwidth usage: vnstat -i tun0

🔧 Troubleshooting

Common Linux-specific issues and solutions:

  • Permission Denied: Always run OpenVPN with sudo for system-level access.
  • TUN Device Issues: Load tun module: sudo modprobe tun
  • DNS Resolution: Check /etc/resolv.conf after connecting.
  • Routing Problems: Verify with: ip route show
  • Authentication Failed: Check username/password in auth.txt file.
  • Connection Timeout: Verify server connectivity: telnet server-address 1194

Distribution-Specific Issues

  • SELinux (RHEL/CentOS): May need to set appropriate contexts.
  • AppArmor (Ubuntu): Check for OpenVPN profile restrictions.
  • Network Manager Conflicts: Disable NM control of interfaces if needed.
  • Systemd Issues: Check service logs with journalctl.

Network Diagnostics

  • Check interfaces: ip addr show
  • Monitor connection: tail -f /var/log/openvpn.log
  • Test external IP: curl ifconfig.me
  • DNS test: dig @8.8.8.8 google.com

📞 Need Help?

If you need additional assistance with OpenVPN setup on Linux or encounter any issues not covered in this guide, please contact our support team at helpdesk@codamail.com.

We’re here to help ensure your VPN connection works perfectly and keeps your Linux system browsing secure and private.