Setup Your Own VPN Server on Debian, Ubuntu or CentOS Server

Published on April 22, 2020 1 min read

Virtual Private Network (VPN) is a popular way to stay safe online. In this article, I’m going to share how to create your own VPN server in no more than a minute.

We’ll use OpenVPN. OpenVPN is an open-source commercial software that implements virtual private network techniques to create secure point-to-point or site-to-site connections in routed or bridged configurations and remote access facilities. Let’s get started:

Table of Contents

  1. Prerequisites
  2. Install OpenVPN
  3. Connect to the VPN
  4. Add/Remove Profile


At first, you need a server. You can buy a server from Linode, Vultr, DigitalOcean, Amazon AWS etc. The server price is low. You can check the prices. Also, you can get a free server from AWS.

Install OpenVPN

Login to your server using SSH command. We’ll use OpenVPN road warrior installer for Debian, Ubuntu and CentOS.

Run the script and follow the assistant:

sudo wget -O && bash

Once the installation is done, it will export a .ovpn file in the /root/ folder. This file contains login info for your VPN. Download this file to your mobile.

Connect to the VPN

You’ll find many OpenVPN clients for Android on Google Play Store. But I like OpenVPN for Android. Download this app on your mobile.

After downloading it from the Play Store, tap the import button in the top-right corner (it looks like a box) and select your .ovpn file.

For Windows/Mac/iOS, VPNGate has an excellent guide here.

Add/Remove Profile

You can create many config files (profile). Just run the installer again and you’ll see the option to add/remove profile like this:

What do you want to do?
   1) Add a new user
   2) Revoke an existing user
   3) Remove OpenVPN
   4) Exit
Select an option:

That’s it. Now enjoy and thanks for reading. 🙂

Monthly Newsletter

One email a month, packed with the latest tutorials, delivered straight to your inbox.
We'll never send any spam or promotional emails.

Hey, I'm Md Obydullah. I build open-source projects and write article on Laravel, Linux server, modern JavaScript and more on web development.