How to install OpenVPN by script, manually or via docker on a cloud VPS? The software is necessary to mask the local network without the requirement to connect via SSH or RDP.
Before rolling OpenVPN to a cloud VPS, it is worth clarifying the technical requirements. The software is installed on Linux, Windows or on dedicated servers.
What to do before installing OpenVPN on a cloud VPS
The step-by-step instruction looks like this:
Update the system. To do this, use the Sudo yum update command.
Make changes to the SELinux config (search for nano /etc/selinux/config).
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 a cloud VPS. You can do this in one of three ways: by script, manually or via docker.
To do this, we need to put a dker (if it is not yet on the project). The installation command looks like this:
apt install curl docker.io
Then 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 automatically generates the configuration required to connect to the OpenVPN server. Download is available at the link about http://Здесь specifies the IP address/.
The advantage is that everything happens almost automatically. The script itself is available from the terminal via the link https://raw.githubusercontent.com/angristan/openvpn-install/master/openvpn-install.sh .
To give him the rights to execute, you must enter in the command line:
chmod +x openvpn-install.sh
To run the script, enter the command:
./openvpn-install.sh
Then questions appear in the terminal that the administrator needs to answer (it depends on what the configuration file will be).
When the installation is completed, the script will prompt you to specify the client name and password (to be used when connecting).
To begin, we set the command:
apt install -y openvpn
The disadvantage is that you will need to work independently with configurations, settings and certificates.