Introduction

WireGuard is a modern and efficient VPN protocol that offers a combination of ease-of-use and strong encryption. This guide will show you how to set up a WireGuard VPN server using a simplified installation command, suitable for any Ubuntu or Debian system.

Prerequisites

  • A server running Ubuntu 20.04 or Debian 10 or newer.
  • Root access or a user with sudo privileges.
  • Basic knowledge of Linux commands and SSH access to your server.

One-Step Installation

You can install WireGuard and configure your VPN server with just one command. Execute the following command on your server:

wget https://git.io/wireguard -O wireguard-install.sh && sudo bash wireguard-install.sh

Script Execution and Configuration

The script automatically performs several tasks:

  • Installs any necessary dependencies.
  • Generates server and client cryptographic keys.
  • Sets up the WireGuard server and creates a client configuration file.

During the process, you will be prompted to:

  • Confirm the server’s IP addresses for the VPN setup.
  • Name your first client device.
  • Select a DNS provider to handle DNS requests for the VPN.

Using the VPN

Once the installation and configuration are complete:

  • The script will provide the location and details of the client configuration file.
  • Transfer this file to your client devices (such as smartphones or laptops).
  • Use any WireGuard-compatible client application to import the configuration file and connect to your VPN.

Adding More Clients

If you need to add more clients later, you can run the same script again:

sudo bash wireguard-install.sh

Select the option to add a new client, and follow the prompts. The script will generate new client configuration files as needed.

Conclusion

This simplified approach allows you to set up a fully functional WireGuard VPN server in a single step, making it extremely straightforward for users of all technical levels. The setup enhances your internet security, privacy, and enables remote access to network resources.