Domain Search Form
£11.98
£33.98
£24.98
£49.98

How to set up and configure your own OpenVPN server on a Virtual Private Server (VPS)

Written by Giraffe Hosting Limited
Published 8 November 2023
How to Install and Configure OpenVPN on VPS
Published: 8 November 2023
Category: 
Written by: Giraffe Hosting Limited
OpenVPN is a versatile, open-source software that facilitates secure point-to-point or site-to-site network connections via routed or bridged configurations. Esteemed for its security prowess, OpenVPN leverages cutting-edge cryptographic protocols, rendering it an ideal solution for personal and corporate cybersecurity needs. This tutorial is designed to assist you in configuring a bespoke VPN on a Giraffe […]

Table of Contents

OpenVPN is a versatile, open-source software that facilitates secure point-to-point or site-to-site network connections via routed or bridged configurations.

Esteemed for its security prowess, OpenVPN leverages cutting-edge cryptographic protocols, rendering it an ideal solution for personal and corporate cybersecurity needs.

This tutorial is designed to assist you in configuring a bespoke VPN on a Giraffe Hosting Limited Virtual Private Server (VPS).

Advantages of Operating Your Own VPN

Operating a personal VPN confers superior oversight of your internet security and allows for customization to meet your specific requirements.

This approach guarantees autonomy over server selection, software installation, and data management, thereby bypassing the need to entrust your sensitive information to external VPN providers.

Choosing the Right VPS

The appropriate VPS for your OpenVPN should be chosen based on the number of expected users, usage patterns, and the server's physical location for best performance. Giraffe Hosting Limited offers hosting options in the UK and the US.

Bandwidth limitations are non-issues with Giraffe Hosting Limited, as they provide unlimited bandwidth with their VPS packages.

Recommended configurations vary by usage:

Individual Usage:

CPU: A single core is typically adequate. RAM: 512MB to 1GB will suffice. Storage: A 25GB SSD is enough to manage software and logs.

Small Group or Family:

CPU: 1-2 cores recommended. RAM: 1GB to 2GB. Storage: A 30GB SSD or larger.

Business or Extensive Group Use:

CPU: 2-4 cores, more if needed for larger groups. RAM: At least 2GB, more for increased demand. Storage: 50GB SSD or more, particularly if extensive logs are necessary.

Installing OpenVPN on a VPS

Post VPS acquisition, proceed with OpenVPN installation:

Once you’ve purchased your VPS, it’s time to install the OpenVPN script.

Access your server via SSH, and using wget (or curl), you can fetch the script and then execute it:

wget https://git.io/vpn -O openvpn-install.sh
sudo bash openvpn-install.sh

Configuration prompts

The installation script will assist you in configuring your VPN with the following steps:

  1. You will be prompted to enter the public IP of your server, which can be located in the ‘Account Information’ section of the VPS overview in the Giraffe Hosting Control Panel. Usually, the script accurately pre-fills this information, allowing you to simply confirm by pressing Enter.
  2. The script will then ask you to choose a communication protocol. UDP comes highly recommended for this purpose.
  3. Subsequently, you will need to decide on a port to use, with 1194 set as the standard default.
  4. Following this, you’ll have the option to select your preferred DNS service provider.
  5. To conclude, you will need to provide a name for your client, which should be memorable to you as it will serve as the identifier for your connection.

Generating the .ovpn file

Once you've guided the setup through its series of prompts, the script assumes control and efficiently generates a .ovpn file. This file, automatically named using the client identifier you provided, will be placed within the home directory of the user profile that executed the script.

Additional Tips and Advice:

  • Ensure you choose a distinctive client identifier that is both meaningful and secure, as this name will be crucial for identifying your VPN profile.
  • After the .ovpn file is created, it's wise to secure it with the appropriate permissions, as it contains sensitive connection details.
  • Regularly back up this .ovpn file in a secure location, separate from your server, to prevent loss of access in case of system failures.
  • Review the .ovpn file's contents to familiarize yourself with the configuration settings, which can be helpful for troubleshooting any connection issues that may arise.
  • Keep the software that interacts with the .ovpn file up to date on your device to ensure compatibility and security.
  • If you're planning to use VPN on multiple devices, consider renaming the .ovpn files appropriately for each device to maintain clarity.
  • Always disconnect from the VPN when it's not in use to maintain optimal security and performance of your network.

To utilize your VPN on a specific device, you must first install the OpenVPN client software on that device.

Here’s how to get started and import your configuration:

Download the OpenVPN client onto the device where you plan to use the VPN, and then execute the following steps to import the VPN configuration file into the client interface.

You can download the OpenVPN client for your operating system from https://openvpn.net/client/.

Steps to Import the Configuration File:

  1. In the OpenVPN client interface, locate and click the ‘+’ sign found typically in the bottom right corner.
  2. Choose the ‘File’ option, use the browse function to find and select the .ovpn file you have previously saved.
  3. Assign a distinctive profile name for this particular VPN connection and then click ‘Connect’.

Now, you should transfer the .ovpn file to any other device where you wish to use the VPN. When you import this file into the OpenVPN client on the new device, your VPN connection will be ready for use.

For the transfer of the .ovpn file from your server to another device, several methods are available:

  • For devices running Linux or macOS, use the Secure Copy Protocol (SCP) with a command in the terminal.
  • Windows users may prefer SFTP clients such as WinSCP or FileZilla for a graphical interface to facilitate the transfer.

Additional Information:

  • Always ensure the device's firewall settings don't block the necessary VPN ports.
  • Consider using a password manager to store complex passwords if your VPN requires one for additional security.
  • Keep your VPN client software updated to patch any vulnerabilities and keep your connection secure.
  • Familiarize yourself with the settings within the OpenVPN client, as tweaking these can optimize your VPN performance or resolve potential connection issues.
  • If you're using the VPN on a public network, be extra cautious and ensure you're connected to your VPN before transmitting any sensitive information.
  • For added privacy, regularly change the profile names and passwords associated with your VPN connections.

Secure Copy Protocol (SCP) – for Linux/Mac:

On your local machine, use the terminal and the scp command:

scp username@your_server_ip:/path/to/clientname.ovpn /local/path/where/you/want/to/save/

SFTP Clients – for Windows:

Applications like WinSCP or FileZilla allow you to securely transfer files over SFTP.

Connect to your server using your credentials, navigate to the directory where the .ovpn file is, and then drag and drop it to your local machine.

Adding more clients or revoking access

Should you need to scale up your VPN network by adding additional users, or if you find it necessary to withdraw access permissions, the process is straightforward. Just execute the openvpn-install.sh script once more on your server.

When you rerun the script, it presents you with a set of choices: you can either register a new client to your network, effectively revoking previous access permissions, or you can remove the OpenVPN software entirely from your system. This flexibility allows you to manage your network’s access dynamically and ensure that only authorized users can connect to your VPN.

Additional Considerations:

  • Regularly review your list of clients and their access rights to maintain optimal security.
  • Keep a record of all active clients in case you need to audit access privileges or troubleshoot network issues.
  • When revoking access, ensure you also update your security protocols to prevent unauthorized access through old credentials.
  • Consider automating the process of adding and revoking clients if you frequently need to update access to your VPN.
  • Always follow the best practices for security by updating the OpenVPN software whenever a new version is available.

Wrapping Up

Undoubtedly, this approach simplifies the VPN configuration journey, serving as a boon for individuals who may not be well-versed in the intricacies of VPN technology or those in search of a swift setup procedure.

It is imperative to bear in mind that the true efficacy of a VPN extends beyond its initial implementation; it resides in consistent and diligent maintenance. Regular updates to your server and VPN software are crucial to ensuring robust security and optimal performance. Failing to maintain updates can leave your network vulnerable to security threats.

Moreover, periodic reviews of your VPN's performance and security protocols can help you stay ahead of potential issues, while also keeping pace with evolving cybersecurity threats. Proactive management of access rights, along with an understanding of the latest encryption standards, can further reinforce the security of your VPN.

In essence, treat your VPN setup as a living system, requiring ongoing care and attention to thrive in an environment that is constantly changing. By doing so, you can maintain a secure, efficient, and reliable VPN service.


Virtual Private Server Hosting: VPS solutions for your VPN and More...

Launch your applications using our cost-effective virtual server hosting solutions, where quality meets value without any trade-offs.

Our top-tier VPS offerings are designed to cater to a wide range of needs, featuring:

  • Blazing-fast performance thanks to our all-SSD storage, ensuring swift load times and responsive processing for all your applications.
  • Truly unlimited bandwidth without any restrictions or throttling, providing you with seamless connectivity and data transfer capabilities.
  • A variety of deployment options, including standard distributions, one-click applications, or your own custom images, giving you the flexibility to tailor your environment to your specific needs.
  • A unified, user-friendly control panel that simplifies server management, making it accessible even for those with minimal technical expertise.
  • An eco-conscious hosting solution fully powered by renewable energy sources, allowing you to minimize your carbon footprint without compromising on efficiency.

Discover why our VPS Hosting stands out as the optimal solution for everything ranging from individual ventures to the most demanding enterprise applications. Experience the fusion of reliability, scalability, and sustainability with our VPS hosting services.

Choose Giraffe Hosting Limited for your Domain Registration, Cloud Hosting, WordPress Hosting, and Virtual Private Server Hosting; Powered by renewable energy, contributed to sustainable growth.
Copyright © Giraffe Hosting Limited. 2007 – 2025 All rights reserved.
Explore
Services
Support