DEV Community

Max Jamesin
Max Jamesin

Posted on • Edited on

2 1

How to set up your own VPN using Amnezia

The best VPN is one you own, and there are many reasons for this: third-party service providers can monitor your traffic and store logs, their speeds can be low, and you might encounter CAPTCHAs due to the dubious reputation of IP addresses.

Here's a short guide on how to install and configure your own VPN with the Amnezia app.

Step 1. Renting a virtual server

To create your own VPN, we need a virtual private server (VPS). It makes sense to choose VPS providers in neutral jurisdictions.

A good option is PQ HOSTING, its advantages include:

  • the company is located in a relatively neutral jurisdiction with servers in over 40 locations across the world
  • port speed up to 10 Gbps
  • low prices and many payment methods, including cryptocurrencies

PQ HOSTING servers operate on KVM virtualization, and for our VPN, it will be sufficient to order a VPS with the minimum configuration: 1 vCore, 1GB RAM, 15GB NVMe, 1Gbps. If you plan to connect a large number of clients and also use the server for other purposes, it's better to choose a more powerful configuration.

When placing an order, choose the location of the VPS data center and the operating system Ubuntu 24.04 or Debian 12. After payment, you will receive the necessary credentials to access the server: IP address and root password.

Step 2. Installing Amnezia VPN

To set up your own VPN, you need to download Amnezia onto your computer or mobile phone. The program is completely free and is open-source software.

Upon the first launch of the VPN client, click 'I have the data to connect', then select 'Configure your server' and enter VPS access details (IP address and root password).

Next, simply follow the setup wizard's prompts. The program will connect to the server, install everything needed, and you will be able to use your VPN.

In the program settings, there are additional useful features:

  • Installation of various VPN protocols: WireGuard, OpenVPN, IPsec, etc.
  • Split tunneling for websites – allows you to use a VPN only for specific websites
  • Split tunneling for applications – enables VPN only for specific applications
  • KillSwitch – blocks internet access if the VPN is not working

Amnezia VPN on the Router

You can connect a router to your VPN by exporting the configuration file from Amnezia and then uploading it to the router. The router must have a built-in VPN client that supports at least one of the protocols available in Amnezia: OpenVPN, WireGuard, IPsec, or others.

It should be noted that most modern routers only support the import of configuration files for certain protocols. Usually, these are OpenVPN and/or WireGuard.

As an example, I will show how to set up a VPN connection on ASUS router, which has a built-in VPN client that supports OpenVPN:

  1. Open Amnezia and add OpenVPN protocol: Settings (3rd icon in the bottom menu) → Servers → Select the required server → 'Protocols' tab → Find 'OpenVPN' in the list and enable it
  2. Export the settings to a .ovpn file: Share (2nd icon in the bottom menu) → Protocol: OpenVPN; Connection format: Original OpenVPN format → click 'Share' → click 'Share' again → Save the .ovpn file
  3. My ASUS router has a button for importing .ovpn configuration files, so I simply go to the router's control panel and upload the previously created file: VPN → VPN Client → OpenVPN tab → Import .ovpn file

If your router does not have a similar button, you will need to manually copy and paste the settings from the .ovpn file, including the contents of the keys and certificates.

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay