Self-Hosting a VPN on a VPS: benefits, risks & setup


In the virtual world dominated by the Software as a Service (SaaS) model, most people outsource digital needs to third parties. While using Spotify instead of setting your own music player is comfortable, the same does not necessarily apply to Virtual Private Networks (VPNs).

Outsourcing your online privacy protection to a third-party business is a trust-based relationship. There are excellent VPNs worth your money, but you can also set up a VPN on a Virtual Private Server (VPS). This way, you control your online data flow and its software and hardware environments.

I'll alert you upfront that setting up a VPN on a VPS requires some technical know-how. I wouldn't take this path before learning some Linux command lines. Otherwise, it's a cost-effective and reliable way of having a VPN solely for you. In this article, I'll explain this method's pros and cons, and link to easy-to-follow VPN setup on VPS guides.

ADVERTISEMENT

Why set up a personal VPN on a VPS?

As with most DIY solutions, many choose it for the freedom and control it offers. A VPS carves out dedicated CPU, RAM, and bandwidth just for you, no neighbors competing for resources. That means that all the resources (CPU, RAM, bandwidth, IP address) are reserved solely for you.

The best VPS hosting services also let you scale server resources if you demand more VPN connections. For example, one of our top VPS picks, Liquid Web, offers an affordable 1GB of RAM VPS plan, which is sufficient for a single VPN connection. But you can scale it all the way up to 32GB of RAM with 10 TB bandwidth, which isn't possible with third-party commercial VPNs.

Liquid Web for VPN hosting

I found Liquid Web to be one of the best choices for personal VPN hosting. It provides one VPN connection for free, and upgrading to a paid plan with all its benefits starts at just $3.50/month. I also recommend it for self-hosting beginners and enthusiasts, as Liquid Web provides easy-to-follow guides for setting up a VPN on different operating systems.

The benefits of self-hosting a VPN on a VPS

As an online privacy proponent, I often side with VPN service providers. But I'll admit that some commercial VPNs gave me plenty of room for doubt over the last decade working in the field.

In 2020, seven VPNs were caught logging user data while stating otherwise. A year later, we reported free VPN user data leaks, so I understand the urge to take matters into your own hands and self-host instead. Here's a list of self-hosting VPN benefits if you choose to do so.

ADVERTISEMENT
  • Freedom of choice. You can choose VPS hardware resources according to your needs. You can also choose a VPN protocol, which also determines the encryption algorithm. You can specify allowed ports, which is beneficial for developers who need to customize their application access privileges and control online data flow.
  • Save money. VPN subscription prices may add up to quite a sum over the years. In the long run, you will save money by self-hosting on a cheaper VPS plan. Keep in mind that you can also use a VPS for other purposes, like secure file storage, a website, and other application hosting, or even create private gaming servers.
  • Better connection speed. Commercial VPNs share servers between multiple users, so you may experience slowdown during rush hours. On the contrary, self-hosting VPS bandwidth will always be reserved solely for you and your approved VPN connections, providing a smoother and more stable performance.
  • Dedicated IP address. The majority of VPNs (and Internet Service Providers) charge extra for a dedicated, unchanging IP address. Meanwhile, VPS offers a static IP address by default, which you can use to secure banking applications, unblock streaming services' libraries, or manage social media accounts with an extra layer of online privacy.
  • Ensure no-logs. Because you control your VPN, you can set up genuine zero-logs policies, voiding all your online activities after each browsing session. Although most commercial VPNs claim to be no-logs, as you have seen, some simply use it as a trap to lure users and steal their data.

The risks of VPN self-hosting on a VPS

As the saying goes, with great power comes great responsibility. Because you will be the sole owner of your personal VPN application, securing and managing it falls on your shoulders. Here are the self-hosting risks and challenges you may encounter.

  • No customer support. You can only contact the VPS provider's customer support, but they cannot advise you on proprietary VPN software. If there's something wrong with your VPN setup not related to the server issues, you will have to solve it on your own or scout online forums for some volunteer help.
  • Technical skills requirements. As you will shortly see, setting up a VPN on a VPS is easier than it may sound. But keep in mind, you are configuring an online privacy protection software. It's best to familiarize yourself with the basic Linux command lines. Also, you must interact with the server using an SSH (Secure Shell) client, and VPN knowledge is paramount for choosing the right protocol and encryption algorithm.
  • Risks of downtime. The best commercial VPNs have thousands of servers, so if one goes down, you can simply connect to another. That's not the case with VPS self-hosting, where server downtime can deny access to the single VPN connection you have.
  • VPS logging. Although you can be sure your personal VPN does not log any data, a VPS owner can still snoop on your online activities. They may get your original IP address, the amount of data transferred (even if it's encrypted), and connection types. If you store any unencrypted data on a VPS, it is also available to the VPS owner if they choose to inspect it.
  • Time investment. Setting up a VPN on a VPS for the first time requires some effort. But you will spend even more time upkeeping and updating it, which is paramount to your VPN cybersecurity. It becomes quicker the more skill you have, but nowhere near to nearly-instant consumer-centric VPN connection.

Self-hosting vs third-party VPN comparison

I can count as many benefits as setbacks, but this is not a better-or-worse comparison. Rather, these are two approaches to protecting your online data flows, each with its uniqueness, for better or worse.

Before I go into the best practices of self-hosting a VPN on a VPS, take a look at the table below for the method's side-by-side comparison.

FeatureSelf-hosted VPNThird-party VPN
Technical knowledgeAt least basic Linux command line, VPN protocol, and server administration knowledgeDoes not require
PriceUsually cheaper with more use casesUsually more expensive with more limited applications
CustomizationHighly customizableLimited customization options
PerformanceDepends on VPS specifics, usually fasterDepends on VPN server statistics and concurrent users, usually slower
Feature varietyMust be configured individuallyA wide range of built-in features
Dedicated IP addressBy defaultAt an extra charge
Customer supportDoes not provideUsually 24/7 customer support

If you have some tech know-how, time, and ambition, your self-hosted VPN can perform better while costing less. However, it requires your continuous attention, like applying updates or upgrading the encryption algorithm to a more secure version.

Meanwhile, third-party VPNs do it for you, but also limit your freedom. In most cases, you can switch between a few protocols, turn on a Kill Switch, and some VPNs offer port forwarding. Also, you cannot upgrade server hardware, so, in my book, this is primarily a customization versus comfort choice.

ADVERTISEMENT

Best VPN self-hosting practices

You are probably eager to set up your own VPN if you're in this section already. Although the exact steps depend on your chosen VPS service, here are my tips to start as smoothly as possible.

  • Choose a VPS provider. This is the most important first step. Make sure your VPS offers sufficient hardware power for your VPN demands. Also, inspect its logging policies and jurisdiction, preferably outside of the 14-eyes countries. Look for features like automatic backups, DDoS protection, and root access privileges.
  • Secure the server. Make sure that you update the server to patch any vulnerabilities before setting up a VPN. For communication, use the SSH client with an SSH key, instead of a password, for authentication. Use sudo privileges instead of a single root-level user. I recommend following this informative Liquid Web guide for step-by-step instructions and command lines.
  • Choose VPN protocol. VPN protocols determine encryption, authentication, connection speed, and setup complexity. In many cases, you will choose between OpenVPN, which is more customizable, and WireGuard, which is usually faster and easier to deploy. Refer to our VPN protocol guide for more information.
  • Post setup security. Although optional, I recommend verifying your self-hosted VPN security. Check for DNS and IP address leaks. Back up your VPN configuration, which will restore it in case the VPS experiences any serious issues. Lastly, set up automatic updates so that you don't forget one or waste time applying them manually.

Final verdict: self-hosted vs third-party VPN

Ten years ago, I would have found it hard to recommend self-hosting a VPN due to technical difficulties. For example, the WireGuard protocol gained traction only in 2020.

Before that, OpenVPN was considered the standard VPN protocol, which is much harder to implement due to a 17.5x larger code base (4000 WireGuard vs 70,000 OpenVPN). Right now, tech-savvy online privacy proponents can use more developed tools, like automated protocol installation scripts, to streamline VPN self-hosting.

But you must also consider that it will still require more time than just subscribing to and installing a third-party VPN. If you aim to stream some US Netflix or bypass basic geographical restrictions, I'd opt for this option.

However, if you want to customize the VPN to overcome more serious blocks, like deep packet inspection, self-hosting customization provides tools to adapt to specific situations. In the end, it depends on your needs, and both methods are a great step forwards towards your online data safety.

FAQ

ADVERTISEMENT

ADVERTISEMENT

Leave a Reply

Your email address will not be published. Required fields are markedmarked