Skip to content

Deployment Overview of OpenVPN on Server

Prerequisites and Basic Requirements

The deployment of OpenVPN on the server requires the following environment specifications:

  • Operating System: Ubuntu (as indicated by the package management tasks).

  • Privileges: Root access is required to execute the installation script and manage system services.

  • Domain Configuration: The server must be accessible via the hostkey.in zone.

  • Network Ports: The installation script automatically configures the necessary UDP/TCP ports for OpenVPN traffic.

FQDN of the Final Panel

The fully qualified domain name (FQDN) for the OpenVPN service follows the format defined by the zone and prefix variables:

  • OpenVPN<Server ID>.hostkey.in

  • The specific port number is determined by the OpenVPN configuration during installation.

Application Installation Process

The OpenVPN application is installed using a dedicated installation script provided by the developer. The process involves the following steps:

  1. The installation script is downloaded from the official repository to the /root directory.

  2. The system waits for any active dpkg or apt locks to be released to ensure a consistent package state.

  3. The dpkg configuration is finalized to resolve any pending package states.

  4. The installation script is executed with the install argument.

  5. The client name is set to client_hk via the CLIENT environment variable.

  6. The AUTO_INSTALL variable is set to y to allow the script to proceed without interactive prompts.

The script used for installation is located at: /root/openvpn-install.sh

The source URL for the script is: https://raw.githubusercontent.com/angristan/openvpn-install/master/openvpn-install.sh

File and Directory Structure

The installation script manages the creation and placement of necessary files. Key locations include:

  • Installation Script: /root/openvpn-install.sh

  • OpenVPN Configuration Files: Typically located in /etc/openvpn/ (managed by the script).

  • Client Configuration Files: Generated in the /root directory or a specified output location by the script.

  • Certificates and Keys: Stored in /etc/openvpn/easy-rsa/pki/ or similar directories managed by the EasyRSA tool included in the script.

Starting, Stopping, and Updating

The OpenVPN service is managed using standard system service commands. The installation script configures the service to start automatically on boot.

  • To start the service: systemctl start openvpn

  • To stop the service: systemctl stop openvpn

  • To restart the service: systemctl restart openvpn

  • To check the status: systemctl status openvpn

Updates to the OpenVPN software can be performed by re-running the installation script with the appropriate arguments or by updating the package via the system package manager, depending on the specific version installed by the script.

Available Ports for Connection

The OpenVPN installation script automatically selects and configures the necessary ports for client connections. The specific port number is displayed during the installation output and is defined in the OpenVPN server configuration file. Common default ports for OpenVPN include:

  • UDP: 1194

  • TCP: 1194 (if configured for TCP)

The exact port used is determined by the server configuration and firewall rules set during the installation process.

question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×