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

  • Email, SSL
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to set a Reverse DNS (rDNS)

Currently this can't be done by clients. Please submit a support ticket with the: IPv4/Ipv6...

Install openvpn client on Ubuntu/Debian based OS

Install network-manager-openvpn-gnome from Ubuntu Software Center (usually this is hidden from...

What Does Unmanaged mean?

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

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

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

Display OS information

Run the "uname -a" command in SSH to display the active kernel version, to view your OS's Distro...