How to install OpenVPN

How to install OpenVPN

OpenVPN is a free and open source software application that implements virtual private network (VPN) solutions for creating secure point-to-point or site-to-site connections in routed or bridged configurations and remote access facilities.

To install via our bash script(Centos 5)

yum install wget -y



To manually do it use the below

Here are the steps to guide you installed OpenVPN.

1.Download the required package files.

# wget

# wget

2.Install and build your download files

You may need the required repository before start your installation

# yum install rpm-build

# yum install autoconf.noarch

# yum install zlib-devel

# yum install pam-devel

# yum install openssl-devel

If you have the above dependencies installed, you can start your installation as follows:

# rpmbuild –rebuild lzo-1.08-4.rf.src.rpm

# rpm -Uvh /usr/src/redhat/RPMS/i386/lzo-*.rpm

# rpmbuild -tb openvpn-2.0.9.tar.gz

# rpm -Uvh /usr/src/redhat/RPMS/i386/openvpn-2.0.9-1.i386.rpm

3. Copy configuration files

# cp -r /usr/share/doc/openvpn-2.0.9/easy-rsa/ /etc/openvpn/

# cp /usr/share/doc/openvpn-2.0.9/sample-config-files/server.conf /etc/openvpn/

4. CA configuration

# cd /etc/openvpn/easy-rsa/

# vi vars

then scroll down to the bottom, edit as you like.





export KEY_EMAIL=””

#./vars (note a space between . . )


5. Build CA


You are about to be asked to enter information that will be incorporated

into your certificate request.

6. Building Diffie Hellman


Generating DH parameters, 1024 bit long safe prime, generator 2

This is going to take a long time

7. Copy key certificates to the required folder

#cp keys/ca.crt ../

#cp keys/dh1024.pem ../

#cp keys/ovpnsrv1.key ../

#cp keys/ovpnsrv1.crt ../

8. OpenVPN configuration

#cd ../

#vi server.conf

dev tap

;dev tun

ca ca.crt

cert ovpnsrv1.crt

key ovpnsrv1.key # This file should be kept secret

10. Startup the OpenVPN service

# service openvpn restart

# chkconfig openvpn on

Was this answer helpful?

 Print this Article

Also Read

IP/SSH is unreachable for my VPS

Please note that your KVM VPS requires an OS install before you will be able to use ssh or...

What Does Unmanaged mean?

What does unmanaged mean? To keep our server rental costs as low as possible and because most...

VPN Port Forwarding

Port-forwarding is not enabled by default on our vpn nodes although it is in now offered with our...

Backup data using rsync

Backup data using rsyncrsync:Rsync is a program for synchronizing 2 directory trees across...

Easy ruTorrent installer + Web server, FTP, Webmin (Ubuntu/Debian/Fedora/More)

All credit goes to Author brock from  original post here for reference also...