Run an OpenVPN Server on Ubuntu Using a Gcore OpenVPN Instance

In this tutorial, we will explain how to run an OpenVPN server on Ubuntu using a preconfigured Gcore Cloud OpenVPN instance. The main advantage of this approach is that it saves you time and effort: your VPN server is ready for use in just 2-5 minutes. You simply need to create an instance, download the OpenVPN configuration, and install the OpenVPN client on your device. No manual manipulations are required in the command line.

What Is OpenVPN?

OpenVPN is an open-source Virtual Private Network (VPN) application. It is a powerful tool that allows you to connect securely to your server from anywhere in the world and use this server as a VPN.

How to Run and Use OpenVPN

Step 1. Create a Virtual Machine with an OpenVPN Server

First, let’s create a virtual machine with an OpenVPN server:

  1. Log in to your Gcore Cloud account. If you don’t have a GCore Cloud account yet, sign up.
  2. Go to Cloud and select Projects.
  3. Click Create project; fill in the Name field. Projects are groups of separate Cloud resources, and these groups are isolated from one another. The isolation gives you the ability to set user rights for each project.
  4. In your project, click Create Instance. Here’s what you’ll see:
Figure 1: Create an instance
  1. Select one of the available regions.
  2. In the Image section, select Marketplace. Click the Openvpn Latest image.
Figure 2: Select “Openvpn Latest”
  1. Set the following parameters:
  • App Template Configuration: external URL if you have a domain.
  • Type: we recommend 1vCPU / 2GB RAM.
  • Volume: choose any volume type with 10GB.
  • Network: set by default to a public IP.
  • Firewall: select “Default” with the “Add application ports to firewall group” flag.
  • SSH Key: choose your public SSH key or generate a new one.
  • Instance name: openvpn-server (or whatever you want.)
  1. Now you’ve completed the set up steps, click Create Instance. The virtual machine will appear in the “Instances” list. Wait until the virtual machine’s “Creating” status changes to “Power On”.
Figure 3: The process of creating the virtual machine

Step 2. Download the OpenVPN Configuration to your Device

Wait for five minutes after the virtual machine is powered on. You can then download the OpenVPN configuration, which will allow you to connect to the OpenVPN server.

On your device, type the virtual machine’s public IP address in the address bar of the browser, as follows:

http://<your_public_ip_address>

For example:

http://202.78.166.105

Press “Enter.” Here’s what you’ll see:

Figure 4: Download the OpenVPN configuration

Confirm by clicking “Allow.” The configuration file will be downloaded.

Step 3. Download an OpenVPN Client

Download the OpenVPN client to your device. Navigate to the OpenVPN page Community Downloads, select the appropriate installer for your operating system, and follow the installation instructions.

Once the client is installed, you can use the OpenVPN configuration that you downloaded in Step 2 to connect to your OpenVPN server.

Step 4. Apply the OpenVPN Configuration and Check How It Works

Next, we can apply the OpenVPN configuration. For this example, we will use screenshots from the macOS installer.

  1. Open the OpenVPN client.
  2. Import the configuration file you downloaded in Step 2.
Figure 5: Import the configuration file
  1. Once imported, connect to the OpenVPN server.
Figure 6: Connect to the OpenVPN server

Congratulations! You have successfully connected to the OpenVPN server. You can now use it to make secure connections anywhere in the world.

Conclusion

In this tutorial, we explained how to run an OpenVPN server on Ubuntu. Check out our other articles dedicated to setting up different types of software on Gcore Cloud instances:

Subscribe and discover the newest
updates, news, and features

We value your inbox and are committed to preventing spam