Install and configure OpenVPN (AlmaLinux 8 and 9 and Rocky Linux 8 and 9)
Please use the “Print” function at the bottom of the page to create a PDF.
For Cloud Servers and Dedicated Servers with AlmaLinux 8 and 9 and Rocky Linux 8 and 9, which are managed in the Cloud Panel
This article explains how to install and configure OpenVPN on a server with AlmaLinux 8, AlmaLinux 9, Rocky Linux 8, or Rocky Linux 9 installed.
To use a VPN, you must install the OpenVPN software on the local PC and then configure it. In the Access section, you can download a zip file containing the required configuration file. How to install and configure OpenVPN:
Install OpenVPN
Requirements
- You have administrator rights.
- You have already created a VPN in the Cloud Panel.
- You have logged in with your local PC.
OpenVPN is not available in the standard repository. The software is available in the EPEL repository.
To install the EPEL repository, enter the following command:
[root@localhost ~]# yum install epel-release
The following message is displayed:
Is this ok [y/N] :
- Enter y and press the Enter key.
- The EPEL repository is now installed.
To install OpenVPN, enter the following command:
[root@localhost ~]# yum install openvpn
The following message is displayed:
Install 2 Packages
Total download size: 715 k
Installed size: 1.9 M
Is this ok [y/N]:- Enter y and press the Enter key.
The following message is displayed:
Importing GPG key 0x3228467C:
Userid : "Fedora (epel9) <epel@fedoraproject.org>" Fingerprint: FF8A D134 4597 106E CE81 3B91 8A38 72BF 3228 467C From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-9
Is this ok [y/N]:- Enter y.
OpenVPN is now installed.
Configure OpenVPN
How to configure OpenVPN:
- Log in to your IONOS account.
Click Menu > Servers & Cloud in the title bar .
Optional: Select the desired Server & Cloud contract.
The Cloud Panel opensClick on Network > VPN in the navigation bar on the left.
Activate the desired VPN.
To download the configuration file, click on Download in the Access area.
Save the zip file.
Note
This zip file contains the configuration file.
Install unzip. To do this, enter the following command on the server:
[root@localhost ~]# yum install unzip
Unzip the zip file in the installation directory /etc/openvpn. To do this, enter the following command:
[root@localhost ~]# sudo unzip <vpnID>.ovpn -d /PATH/DIRECTORY
Example:
[root@localhost ~]# sudo unzip vpn45BC7.ovpn -d /etc/openvpn
Note
OpenVPN is installed in the /etc/openvpn directory by default.
If you are using a local computer with a Windows operating system, you can transfer the files easily and conveniently using the WinSCP application. WinSCP is a graphical open source SFTP and FTP client for Windows. You can download WinSCP from the following page:
https://winscp.net/eng/download.php
To start OpenVPN, enter the following command:
[root@localhost ~]# openvpn /etc/openvpn/<vpnID>.ovpn
Example:[root@localhost ~]# openvpn /etc/openvpn/vpn45BC7_1.ovpn