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:
- Log in to your Gcore Cloud account. If you donāt have a GCore Cloud account yet, sign up.
- Go to Cloud and select Projects.
- 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.
- In your project, click Create Instance. Hereās what youāll see:
- Select one of the available regions.
- In the Image section, select Marketplace. Click the Openvpn Latest image.
- 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.)
- 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ā.
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:
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.
- Open the OpenVPN client.
- Import the configuration file you downloaded in Step 2.
- Once imported, 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: