Home Linux ServerTools How to install WireGuard on Ubuntu 20.04

How to install WireGuard on Ubuntu 20.04

by Thạch Phạm
Published: Last Updated on
A+A-
Reset
anh 64

Like OpenVPN or IPSec, WireGuard is a free VPN system that helps you establish an encrypted connection between the client and the server via an Internet connection. WireGuard operates at layer 3, designed as a virtual network interface of the Kernel for Linux. WireGuard was created as an alternative to IPSec in most use cases and relied on TLS-based solutions like OpenVPN, while WireGuard is more secure, faster, and easier to use.

In this article, AZDIGI will guide you to install WireGuard on Ubuntu 20.04, please follow along.

Requirements:

  • Linux server (In this article, I will install on Ubuntu version 20.04)
  • Public IP

WireGuard installation steps

Step 1: Update the system

Before installing, update your system to the latest version with the following command:

AZDIGI Tutorial
apt update && sudo apt upgrade -y
    

Step 2: Install WireGuard with the script

After updating the system, create a new folder and download the Wireguard script.

AZDIGI Tutorial
mkdir vpn && cd vpn
wget https://git.io/wireguard -O install.sh
chmod +x install.sh
./install.sh
    

After running the script, you will get the message below, please enter the following information:

AZDIGI Tutorial
Welcome to this WireGuard road warrior installer!

What port should WireGuard listen to?
Port [51820]: 
install WireGuard on Ubuntu 20.04

Step 4: Download the WireGuard configuration file to your server

With step 3, you can connect and use WireGuard. However, I will write this extra step to help you download the configuration file directly from the browser to the client’s computer. To do this, please run the following command:

AZDIGI Tutorial
root@vpn:~# cd /root && python3 -m http.server
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
    

Then you access the browser, enter server-ip:8000 to view the configuration file and download it. If you do not have access to port 8000, then the port is not open on the firewall system. Please refer to the following article to open it:

anh 63

Step 5: Setup & use WireGuard

1. Set up & use WireGuard on the computer

Before setting up, you need to have the WireGuard application. And you can download WireGuard from the WireGuard homepage for operating system platforms:

  • Download the WireGuard application on Windows here
  • Download the WireGuard application on MacOS here

After downloading and installing the WireGuard software application on the client computer, click the + sign => select Import Tunnel(s) from File to add configuration.

anh 60

And to use it, you just need to click

  • Activate: Activate use
  • Deactivate: Deactivate use
CleanShot 2022 05 07 at 10.40.07

2. Set up & use WireGuard on mobile

WireGuard is also available on mobile devices. To download, please visit the corresponding link below:

  • Download the WireGuard app on AppStore here
  • Download WireGuard app on Google Play here
anh 61

Next, open the WireGuard mobile application and select the + sign. Then you choose configuration options such as:

  • Create from QR code: Scan the QR code as in Step 3
  • Create from file or archive: Import the configuration file as in Step 4
anh 62

Step 6: Check the internet connection

After the connection is complete, I will access the Internet to check if it works and if the IP is correct.

CleanShot 2022 05 07 at 19.26.52@2x

So AZDIGI has completed the steps to install WireGuard on Ubuntu 20.04. Wishing you success!

You can refer to other user manuals at the link below

If you need assistance, you can contact support in the ways below:

Đánh giá

Tham gia nhóm hỗ trợ Server - Hosting

Tham gia nhóm Hỗ trợ Server - Hosting & WordPress để cùng nhau hỏi đáp và hỗ trợ các vấn đề về WordPress, tối ưu máy chủ/server.

Tham gia ngay

Bài viết cùng chuyên mục

AZDIGI – Không chỉ là đơn vị hàng đầu trong lĩnh vực Web Hosting và Máy chủ, chúng tôi mong muốn mang lại những kiến thức bổ ích nhất và luôn cập nhật thường xuyên cho cộng đồng người đam mê thiết kế website, công nghệ,…

Vui lòng không sao chép nội dung nếu chưa xin phép. Designed and Developed by PenciDesign