Advanced Setup Guides
Install AmneziaWG on Ubuntu 22...

Install WireGuard Client on Ubuntu 22.04 and Connecting to the server using AmneziaWG

13min

To connect to a Wideguard VPN from your local machine to a remote server using the amneziawg configuration file you previously received from the configured server, follow these steps. This guide assumes you are using Ubuntu 22.04. You’ll need to install the WireGuard software, configure it, and initiate the VPN connection. Here's how to do it:

1. Install WireGuard

Open a terminal and update your package lists:

Shell


Then install WireGuard. For Debian-based systems (like Ubuntu), use:

Shell


For Red Hat-based systems (like CentOS or Fedora), use:

Shell


2. Copy amneziawg config on Linux(Ubuntu):

Include the command:

Shell


Where:

  • username - the username of the server
  • server-ip-address - the IP address of the server
  • /root/awg/ - directory where located a wireguard config files
  • wg-client1.conf - wireguard config file
  • /etc/wireguard/ - the local directory on your Linux machine

2. Get Your WireGuard Configuration

The Amnezia wireguard configuration file must be downloaded from VPS. The .conf file, is usually in the following format:

Shell


Save this file with a .conf extension, e.g., wg0.conf.

3. Move Configuration to WireGuard Directory

Move your configuration file to WireGuard’s directory, where wg0.conf this is a client config that was previously downloaded from the server:

Shell


Ensure the file permissions are restricted to prevent unauthorized access:

Shell


4. Start the WireGuard VPN Connection

To start the VPN connection using the configuration file, run the following command:

Shell


If everything is configured properly, you'll be connected to the WireGuard VPN.

5. Verify the Connection

To check if the connection is active, use:

Shell


This command shows details about the active WireGuard connection, such as the interface name, peer details, and data transfer statistics.

6. Disconnect from the VPN

To stop the VPN connection, use:

Shell


7. Optionally Enable WireGuard on Boot

If you want the VPN to start automatically on boot, you can enable it with:

Shell


To disable it from starting on boot, use:

Shell


Troubleshooting Tips:

  • Ensure that your private key, public key, and endpoint details in the configuration are correct.
  • If you face any connection issues, check the system logs for more detailed error messages:
Shell


Following these steps, you should be able to connect to amneziawg on Ubuntu.