According to the Freedom House index, global internet freedom has declined for the 12th year in a row. This has been exacerbated by countries like Russia, Iran, and Libya which increased their internet censorship in 2022. In over 53 countries, people have faced severe legal repercussions for expressing their opinions online.
It’s no wonder why VPN use is on the rise worldwide. At CyberGhost, for example, we had an average of 142,000 active connections in 2021, an increase from just 66,000 in 2019.
While you can use free and paid VPNs, you can also build one yourself. Why would you want to learn how to create a VPN at home? It could be for various reasons. You probably want to know how VPNs work, have more control over your data, or find out how building a server yourself can help you save money. Whatever your reasons are, we’ve got step-by-step guides on how to create your own VPN server whether you’re using a Windows or Mac PC.
I tried to keep things simple and affordable when writing this post. That’s why I’ll focus only on solutions that use tools you already have at home and require little to no money or technical know-how.
Even though it’s possible, creating your own VPN server takes time, effort, and, in some cases, money. It also comes with some limitations. If you’re only after enjoying the privacy and security VPNs offer, you can install CyberGhost VPN instead. It’s fast, easy to set up, and only costs a few dollars per month!
Why create your own VPN at home
It’s easy to get a VPN these days, so why would you want to build your own VPN server? Perhaps you’re just curious or love tinkering with things. In that case, learning how to create a VPN at home will keep you pretty busy.
Here are more reasons why you might want to set up your own VPN:
- It’s affordable. You can create your own VPN at home with free tools and devices you already own. You can, for example, set up your router or spare computer as your server.
- It boosts your online privacy. Unwanted third parties like your ISP, cybercriminals, and government authorities could snoop on your online activity without your consent. Use a VPN to encrypt your traffic, so you can keep what you do online private as it should be.
- It lets you access your computer from anywhere. Want to access your files or connected devices at home while you’re away? You can do this with a VPN. The VPN connects you to your home network, so you can view files and control devices like your smart cameras wherever you go.
How to create a VPN at home
You have several options if you want to create your own VPN, including using your router, computer, or virtual machine in the cloud. Take a look at these easy-to-follow guides on how to create a VPN at home in the sections below. I’ve split the steps based on whether you want to set up your Windows PC, Mac computer, or router as your VPN server.
You might find them difficult to follow at first if you don’t have any networking experience or if you never tinker with your devices. Don’t worry, though. Just follow along with the steps and you should have your own working VPN in less time than it takes your grandma to figure out online shopping.
Create a VPN for Free on Windows 11
Let’s start with a tutorial on how to create a VPN at home on Windows. The easiest way to do this is to use Windows’ built-in tool to create your own VPN server. I tested this feature on a Windows 11 computer, but the steps should be similar for earlier versions of the OS. Again, create a server on a Windows machine you can always leave online.
You can also run an OpenVPN server on your Windows machine. I decided not to cover it, because this method can get complicated pretty quickly and I wouldn’t recommend it if you’re new at setting up a VPN server. Instead, I’ll focus on the built-in tool to help you get started.
This simplicity comes at a price, though, since this option uses a VPN protocol called PPTP. It’s less secure than more modern protocols like OpenVPN and WireGuard®, so secure your VPN connections with a strong password.
With that out of the way, follow these steps to create your own VPN at home on Windows 11:
- Open Network Connections. Click the Start icon, type ‘Network Connections’, and then click View Network Connections.
- Press Alt+F, and then choose New Incoming Connection…
- Select the user accounts you want to allow to connect to your computer via a VPN. Alternatively, click Add someone to create a new user, then enter a username, full name, and a strong password.
- Click OK, and then Next.
- Click on Through the Internet as the means of connecting to your computer via VPN. Click Next.
- Choose the type of networking software that will be enabled for incoming connections. Check File and Printer Sharing for Microsoft Networks if you’d like connected users to be able to view files and use printers you shared on the network.
- Click Allow access. A notification confirming your action will appear.
- Check your external IP. Go to a website like whatismyipaddress.com which lets you check your IP address. Take note of your IPv4 address — you’ll need this to be able to connect devices to your VPN server from outside your home network.
- Your VPN server is set up!
How to Connect to Your Windows VPN Server
Once you’ve set up your Windows VPN server, you’ll now have to check if you can access it with a different device. In this example, I connected to my homemade server using a Windows computer. Follow these steps to get connected:
- Click on the Start icon, type “VPN settings” (without quotation marks), and then hit Enter.
- Click Add VPN in the VPN connections option.
- In the Add a VPN connection window, do the following:
- Choose Windows (built-in) as your VPN provider.
- Enter the connection name — any name will do.
- In the Server name or address field, enter the IPv4 address given to you in Step 8 of the “Create a VPN for Free on Windows 11” section.
- Select PPTP as your VPN type.*
- Choose to sign in with a username and password, and then enter the same username and password you created in Step 3 of the “Create a VPN for Free on Windows 11” section.
- Click Save.
- Connect to the VPN server you created.
*This depends on the protocols your router supports. Most support PPTP, but you can try one of the other protocol options to see if it works.
Caution: PPTP is largely considered an obsolete VPN protocol. It’s nearly 30 years old and the United States’ National Security Agency and cybercriminals have cracked it, making PPTP a security risk. A safer solution would be a VPN service like CyberGhost. We use the best and latest VPN protocols when it comes to speed and security, including OpenVPN, IKEv2, and WireGuard®.
How to Create a VPN at Home with macOS
macOS users used to be able to create their own VPN server with Apple’s macOS Server app. Unfortunately, the company has since discontinued this, so you can no longer natively build a VPN server on Mac. You can, however, create your own VPN server in the cloud, which we’ll cover next.
Create Your Own VPN Server in the Cloud
You can host your VPN in the cloud if you’re using a Mac or prefer this method for its additional security benefits. Here, you’ll build a virtual machine (VM) where you can create your server.
Although a lot of providers offer this option, I’ve chosen Google Cloud in this post for several reasons. First, you likely have a Gmail account already, which you can use to create a Google Cloud account. It’s also fairly easy to set up as you’ll see below. Finally, you can try it out for free.
Here’s how you can create your own VPN service on Google Cloud:
- Create a Google Cloud account. You can use your existing Gmail account to log in or create a new one. Either way, you’ll get free credits if you’re a new Google Cloud user.
- Go to the Google Cloud Marketplace. Search for OpenVPN, and click Launch.
- Name your server deployment.
- Choose the zone/location of your VPN. The options here are quite limited compared to a paid VPN like CyberGhost, but it still lets you choose a location you like.
- Choose your machine type. The smallest and cheapest one will do if you only have basic VPN requirements. Google Cloud has an article on machine types if you want to learn more.
- Click Deploy, to create your VM.
- Make your IP address static. To do this, go to Computer Engine > VM instances.
- Next, click on the instance of the VM you created.
- Click Edit.
- On the network interface page, go to the External IPv4 address section, choose Ephemeral, and then click Create IP Address.
- Enter the IP address’ name (you can leave the description text box blank), click Reserve, Done, and Save.
- Go to Deployment Manager > Deployments. Next, choose the server deployment you just created, then click on SSH. This opens a terminal window.
- Do the following steps in the terminal:
- Create a root password. Type “sudo passwd root” (without quotation marks). Next, enter your new password, retype it to confirm, and then hit the Enter key. A confirmation message will appear once you’ve successfully created a password.
- Log in to the VPN server. In the next line, type “su root” (without quotation marks) to log in, and then enter your password.
- Change your OpenVPN password. Type “passwd openvpn” (without quotation marks), and then enter and reenter your new password. Make sure the password is at least 16 characters long with a combination of uppercase and lowercase letters, numbers, and symbols.
- Exit from the terminal.
- Return to Deployment Manager > Deployments. Choose your deployment, and then click on the Admin URL link.
- Read the license agreement, then click Agree.
- Click on Configuration > VPN Settings.
- Select Yes, in the Should client Internet traffic be routed through the VPN? option.
- Go to DNS Settings, and then select Yes only for the Have clients use specific DNS servers option. Next, enter the Primary and Secondary DNS Servers you wish to use. You can use Google’s DNS (i.e., 22.214.171.124, 126.96.36.199) or Cloudflare’s DNS (i.e., 188.8.131.52, 184.108.40.206), for example.
- Click Save Settings, and then click Update Running Server.
- Next, go to Configuration > Network Settings. Make sure the value of Hostname or IP Address is the same as the IP address in the address bar. Otherwise, change it, then click Save Settings and Update Running Server.
- Restart the VPN. Click on Status > Status Overview, click Stop VPN services, and then confirm. Click Start VPN services to restart the VPN.
Testing Your Google Cloud-hosted VPN
Now for the fun part: testing your cloud-hosted VPN. First, you need to install OpenVPN Connect on your device.
- Go to Google Cloud’s Deployment Manager. Click on the site address link.
- Log in with your OpenVPN credentials.
- Download and install the appropriate OpenVPN Connect installer for your platform.
Installing OpenVPN Connect on macOS or Windows:
- Click on the installer file. Follow the installation instructions, and then close the window.
- Open OpenVPN Connect. Go through the onboarding process, read the data collection, use, and retention policy, and then click Agree.
- Turn on the toggle and log in using your credentials.
- Accept the self-signed certificate.
- You’re connected! Go to Google and type ”what’s my ip” to verify OpenVPN Connect is working. Your new IP address should appear.
Create a VPN Server in Your Router
You can buy a router with built-in capabilities that support turning it into a VPN server or that can connect to a VPN service like CyberGhost. You can also add VPN capabilities to your current router if it supports “flashing” or changing its firmware with a custom one. Popular custom firmware are DD-WRT and OpenWRT.
The actual steps for flashing your router will depend on your specific brand and model, but will more or less follow these steps:
- Download custom firmware. Confirm compatibility between your router and preferred firmware, and then download it.
- Connect your computer to your router. Do this via a wired connection. If your computer doesn’t have an Ethernet port, you can buy a USB to Ethernet adapter for a few dollars.
- Log into your router. Open a browser and enter your router’s address (typically 192.168.1.1 or 192.168.0.1). Log in with the username and password.
- Install the firmware. Find the page for upgrading your router’s firmware. Then, follow the custom firmware’s specific installation instructions.
- Reboot the router. Once the installation is done, restart your router and log in as you did in Step 3.
- Set up your VPN server. Look for the VPN tab in the router’s menu, choose OpenVPN, and set up the VPN server and the devices that will connect to it (called “clients”). Follow your chosen firmware’s instructions to do this.
- Check if your VPN server works. Connect your device to your router and Google your IP address. The VPN server’s address should be displayed.
Always perform a DNS leak test after setting up your VPN. This confirms your connection is secure, so no one can snoop on your online activity. Use our free DNS leak test to check if your VPN works.
The downsides of creating your own VPN server
VPNs are a fantastic way to control your privacy online, especially if you create your own server. There are drawbacks to this, though, including the following:
- Bandwidth caps and connection speed limits
Commercial VPNs are able to offer excellent connection speeds and unlimited bandwidth because of their infrastructure. CyberGhost VPN, for example, has 10 Gbps servers, which deliver enough bandwidth for 4K streaming, low lag gaming, and fast torrenting. We also don’t cap your bandwidth, so you can use our fast VPN as much as you like without being throttled.
On the other hand, your homemade VPN’s connection speed will depend on your internet plan at home. You need at least a gigabit fiber connection, because anything slower will hamper your VPN’s performance.
Also, choose a plan without data caps. Otherwise, you’ll quickly eat up your monthly data allocation if you use your server for streaming or transferring large files.
- Fixed location
It’s difficult to change your location when you set up your own VPN. This can be a deal-breaker if you want a server that lets you switch to overseas locations. You’ll be better off just paying for a service with thousands of servers worldwide. CyberGhost VPN, for example, has a global network of servers across 91 countries.
- The time and effort required
You can set up some VPN servers quite easily, like Windows’ built-in VPN. The downside is it only uses the PPTP protocol, which is less secure than modern VPN protocols like OpenVPN. To build a more secure server, you need a bit of technical know-how and patience to pull this off.
You also have to run security checks regularly on your homemade server, such as a DNS leak test, to confirm it works as it should. Considering how complex setting up your own VPN server can be if you’re not tech savvy, you could be more prone to security risks. Things like a weak password or a wrong VPN configuration could easily compromise your setup.
It takes work to set up your own VPN server. Unless you’re willing to invest the time and resources, it might be better to get a paid VPN instead.
- The lack of a host of other features
Unlike commercial VPNs, you likely won’t be able to do much with your home VPN setup aside from changing your IP address. CyberGhost VPN, for example, offers privacy-focused settings, which prevent third parties from seeing your online activity. These include our DNS leak protection and automatic Kill Switch that temporarily cuts you off from the internet if your VPN is disconnected. We also constantly upgrade our infrastructure to give you fast speeds and more servers options worldwide.
Want an Easy Way to Get a VPN? Subscribe to a VPN Service.
Not everyone has the time and patience to create their own VPN server, and that’s okay. That’s why subscription-based VPN services like CyberGhost exist, among other equally good reasons.
CyberGhost VPN takes care of everything, from setting up and maintaining the VPN server network to providing a user-friendly VPN client. All you need to do is subscribe to CyberGhost VPN and connect to one of our servers. It should take about 5 minutes.
If it’s speed you’re after, our server infrastructure has you covered. We have dedicated servers for activities like streaming and gaming, so slow connection speeds won’t get in the way of your fun.
Certainly. You can buy a router with built-in VPN capability or flash one with a custom firmware. You can then set it up as a VPN server or connect it to a subscription service like CyberGhost VPN. You can also set up a server on your Windows computer or host it in a cloud provider like Google Cloud for Windows or Mac.
Check out our full guide on how to create a VPN server on Windows and Google Cloud for more information.
Yes, you can. If you’re wondering how to create your own VPN for free, you can install free custom firmware like DD-WRT and OpenWRT on a compatible router. Windows also lets you create a built-in VPN server within the OS without paying for anything.
Be warned, though — creating your own VPN can be complicated and risky unless you know what you’re doing. Simplify protecting your online security with a paid VPN like CyberGhost. It comes with military-grade encryption and VPN apps for all your devices. Try it out today risk-free with our 45-day money-back guarantee.
It depends on factors like your goals (e.g., accessing your home network from anywhere) and setup (e.g., using a dedicated device as a server). Free options include creating a VPN server in your spare Windows machine or installing custom firmware on your current router.
Paid ones, on the other hand, include buying a router with built-in VPN capability, hosting one in the cloud, or buying a dedicated PC for extra performance and security. You could also subscribe to CyberGhost VPN. It’s cheaper and easier to use if you want to be protected or access global servers without any technical know-how.
It takes a bit of patience and technical know-how to run your own VPN. Prepare to read and watch a lot of tutorials to help you get started.
You’ll have limited server options too, especially on your home router or computer. This isn’t ideal if you want a VPN to change your IP address and access geo-restricted content. Security can be an issue too. One wrong setting or a weak password could expose your home network to cybercriminals.
Avoid these issues with a premium VPN like CyberGhost, which has servers across the world and uses the latest VPN protocols and military-grade encryption.