Methods of payment Abuse

How to install OpenVPN on a cloud VPS

29.01.2023, 20:03

How do I install OpenVPN by script, manually or via docker on a cloud VPS? The software is needed to mask the local network without the requirement to connect via SSH or RDP.

Before rolling OpenVPN to a cloud VPS, it's worth clarifying the technical requirements. The software is installed on Linux, Windows or dedicated servers.

What to do before installing OpenVPN on a cloud VPS

The step-by-step instruction looks like this:

  1. Upgrade the system. To do this, the sudo yum update command is used.
  2. Make changes to the SELinux config (look for nano /etc/selinux/config).
  3. Install SELinux, edit the sysctl.conf file, and connect IP Expressing.

After the changes are accepted and the server is ready to work, it remains to roll OpenVPN to the cloud VPS. You can do it in one of three ways: script, manually or via docker.

Option #1. Deploy OpenVPN in a docker container

To do this, we need to install docker (if it is not on the project yet). The command for the installation looks like this:

apt install curl docker.io

Next, you need to enter the command:

docker run --name dockovpn --cap-add=NET_ADMIN 

-p 1194:1194/udp -p 80:8080/tcp 

    -e HOST_ADDR=$(curl -s https://api.ipify.org) 

    alekslitvinenk/openvpn

It will automatically generate the configuration needed to connect to the OpenVPN server. Downloading is available at the link about http://Здесь specifies ip-address/.

Option #2. Install OpenVPN on a cloud VPS with a script

The advantage is that everything happens almost automatically. The script itself is available from the terminal at the link

https://raw.githubusercontent.com/angristan/openvpn-install/master/openvpn-install.sh

To give it the rights to run, you need to type in the command line:

chmod +x openvpn-install.sh

To run the script enter the command:

./openvpn-install.sh

Next, questions appear in the terminal, which the administrator needs to answer (it depends on what the configuration file will be).

When the installation is complete, the script will offer to specify the client name and password (to be used when connecting).

Option #3. Install OpenVPN on cloud VPS manually

To begin with we set the command:

apt install -y openvpn

The minus is that you will have to work with configurations, settings and certificates yourself.