VOOZH about

URL: https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-16-04?comment=47004

⇱ How To Set Up an OpenVPN Server on Ubuntu 16.04 | DigitalOcean


How To Set Up an OpenVPN Server on Ubuntu 16.04

Published on May 4, 2016
Not using Ubuntu 16.04?
Choose a different version or distribution.
Ubuntu 16.04
👁 How To Set Up an OpenVPN Server on Ubuntu 16.04

Introduction

Want to access the Internet safely and securely from your smartphone or laptop when connected to an untrusted network such as the WiFi of a hotel or coffee shop? A Virtual Private Network (VPN) allows you to traverse untrusted networks privately and securely as if you were on a private network. The traffic emerges from the VPN server and continues its journey to the destination.

When combined with HTTPS connections, this setup allows you to secure your wireless logins and transactions. You can circumvent geographical restrictions and censorship, and shield your location and any unencrypted HTTP traffic from the untrusted network.

OpenVPN is a full-featured open source Secure Socket Layer (SSL) VPN solution that accommodates a wide range of configurations. In this tutorial, we’ll set up an OpenVPN server on a Droplet and then configure access to it from Windows, OS X, iOS and Android. This tutorial will keep the installation and configuration steps as simple as possible for these setups.

Note: If you plan to set up an OpenVPN server on a DigitalOcean Droplet, be aware that we, like many hosting providers, charge for bandwidth overages. For this reason, please be mindful of how much traffic your server is handling.

See this page for more info.

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

About the author

Former Senior Technical Writer at DigitalOcean, specializing in DevOps topics across multiple Linux distributions, including Ubuntu 18.04, 20.04, 22.04, as well as Debian 10 and 11.

Still looking for an answer?

Was this helpful?

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Thanks! BTW, if not working for some one this script may do the trick: https://github.com/Nyr/openvpn-install

Works great, thanks !!

But if I want more than one client to connect, how do I create login for another one?

Thanks for making an updated guide for the new LTS release!!

If anyone else is having trouble with iOS setup using OpenVPN Connect, you need to remove all of the [inline] options (ca, cert, key, tls-auth) and just leave the embedded certificates there. I chose to just comment the lines out in the config, but you can delete them as well.

You could also use this, deploy an OpenVPN Endpoint with a single command. https://github.com/ttlequals0/autovpn

If you want a GUI – Pritunl is great also, as is OpenVPN Access Server.

OpenVPN still defaults to BF-CBC which hasn’t been broken yet but as a good practice it would be best to use AES-128-CBC; you will at least get an advantage since many CPUs hardware optimize AES, not to mention it’s got more eyeballs looking at it and is ‘battle hardened’.

Using the additional directive “auth SHA256” will use SHA2 instead of SHA1 for message authentication; the latter is now considered cryptographically broken.

More hardening tips: https://blog.g3rt.nl/openvpn-security-tips.html

Great tutorial…on my Androids I am getting “Error reading multiple files referenced by profile: [inline], [inline], [inline], [inline]”…how can I correct that?

is there a solution if the net provider here prevents UDP connection ?

I’ve strictly followed this guide on a newly crested Ubuntu 16.04 system, altough I had to leave out the [inline] directives (I commented out those lines) to be able to get the ovpn profile working on iOS. I can now succesfully set up a connection from an iPad to the server, however once OpenVPN is connected, I can’t actually browse the web. The syslog en ufw.log files don’t seem to report anything unexpected. How can I best approach debugging this issue?

Thanks!

Can you add a Username & Password to the openvpn config? So that not everyone can logon who has the config

👁 Creative Commons
This work is licensed under a Creative Commons Attribution-NonCommercial- ShareAlike 4.0 International License.
  • Deploy on DigitalOcean

    Click below to sign up for DigitalOcean's virtual machines, Databases, and AIML products.

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and AI-native businesses

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

© 2026 DigitalOcean, LLC.Sitemap.
Dark mode is coming soon.