Skip to content
Black Friday · Get up to 89% discount Get the deal →
Linux line · question 02 of 4All 4 questions

FAQ · Linux

How to set up OpenVPN in Ubuntu?

Updated 1 min readAnswered by CopVPN

AnswerThe full answer

The simplest way to use CopVPN on Linux is the CopVPN Linux app: download the 64-bit .deb from the Linux download page. The manual steps below are a fallback.

To set up an OpenVPN server in Ubuntu, you can follow these steps:

  • Update your system

Run these commands to ensure your system is up-to-date:

sudo apt update && sudo apt upgrade -y

  • Download the installation script

Use this script to automate the setup:

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

chmod +x openvpn-install.sh

  • Run the script

Execute the script with root privileges:

sudo ./openvpn-install.sh

  1. Select UDP (recommended).
  2. Keep the default port (1194).
  3. Choose a DNS provider (e.g., Cloudflare or Google).
  4. Name your client (e.g., myvpn).
  • Finish setup

The script generates a .ovpn client file (e.g., /root/myvpn.ovpn). Transfer this file to your devices to connect to the VPN.

  • Manage the service

Start/Stop OpenVPN:

sudo systemctl start openvpn-server@server.service

sudo systemctl stop openvpn-server@server.service

Check status:

sudo systemctl status openvpn-server@server.service

Still stuck? Email contact@copvpn.com

It’s our only support address. Tell us the device and app you’re using, and what you’ve already tried.

Plans

Start free, or unlock every location

A plan unlocks every CopVPN app on your account: 85+ locations in 65+ countries, 5 protocols, and unlimited devices, up to 7 connected at once.

Get CopVPN

2 Years · $47.76 billed today

See all six plans

30-day money-back guarantee (except crypto and manual payments)We follow a no-logs policy