An Interest In:
Web News this Week
- April 14, 2024
- April 13, 2024
- April 12, 2024
- April 11, 2024
- April 10, 2024
- April 9, 2024
- April 8, 2024
How To Set Up an OpenVPN Server on Linux Server (Ubuntu)
You can easily follow this steps to have your own VPN in your server.
1 . Install docker in your server
sudo apt install docker.io
2 . Make a directory with this command
mkdir /opt/openvpn
3 . Clone the project from this repo (https://github.com/kylemanna/docker-openvpn) with this command
git clone https://github.com/kylemanna/docker-openvpn.git
4 . Pick a name for the $OVPN_DATA
data volume container
OVPN_DATA="ovpn-data"
5 . Initialize the $OVPN_DATA
container that will hold the configuration files and certificates. (replace VPN.SERVERNAME.COM
with your server IP)
docker volume create --name $OVPN_DATAdocker run -v $OVPN_DATA:/etc/openvpn --rm kylemanna/openvpn ovpn_genconfig -u udp://VPN.SERVERNAME.COMdocker run -v $OVPN_DATA:/etc/openvpn --rm -it kylemanna/openvpn ovpn_initpki
6 . Start OpenVPN server process
docker run -v $OVPN_DATA:/etc/openvpn -d -p 1194:1194/udp --cap-add=NET_ADMIN kylemanna/openvpn
7 . Take a rest, drink water, walk :))
8 . Generate a client certificate without a passphrase (replace CLIENTNAME with what you want!)
docker run -v $OVPN_DATA:/etc/openvpn --rm -it kylemanna/openvpn easyrsa build-client-full CLIENTNAME nopass
9 . Retrieve the client configuration with embedded certificates
docker run -v $OVPN_DATA:/etc/openvpn --rm kylemanna/openvpn ovpn_getclient CLIENTNAME > CLIENTNAME.ovpn
10 . Now you can find your .ovpn file in /opt/openvpn
11 . (Optional) Just copy files to your machine ,go to your local machine and run this command
scp root@<your-server-ip>:/opt/openvpn/CLIENTNAME.ovpn /home/azibom
If you have any questions, you can ask here:)
Share with your friends if you like
Original Link: https://dev.to/azibom/how-to-set-up-an-openvpn-server-on-linux-server-ubuntu-7e0
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To