🚀 Why WireGuard?
Setting up a VPN (Virtual Private Network) is the best way to secure your internet traffic and protect your privacy. WireGuard® is a modern, extremely fast, and secure VPN protocol that has become a favorite for its simplicity.This guide will show you how to get a WireGuard VPN server running on Ubuntu 24.04 in just a few minutes using a popular and well-maintained automated script.
📋 Prerequisites
Before we start, you will need:- An Ubuntu 24.04 server.
rootaccess (or a user with sudo privileges) to your server.
💻 Step 1: Download the Installation Script
We will use a fantastic script created by Angristan on GitHub. This script automates the entire installation process.First, log in to your server as
root. Then, download the script and make it executable by running the following commands one by one:
Bash:
curl -O https://raw.githubusercontent.com/angristan/wireguard-install/master/wireguard-install.sh
Bash:
chmod +x wireguard-install.sh
🛠️ Step 2: Run the Script and Follow the Prompts
Now, simply run the script to begin the installation:
Bash:
./wireguard-install.sh
The script will guide you through the process. It will ask you a few questions, such as the public IP address of your server, the port you want to use, and the name for your first client.
Once you answer the prompts, the script will automatically:
- Install the WireGuard kernel module and tools.
- Configure the server's network settings and firewall.
- Create a
systemdservice to keep WireGuard running. - Generate your first client configuration file (usually saved as a
.conffile in therootdirectory).
.conf file with any WireGuard client (for your phone or computer) to connect to your new VPN.👤 Step 3: How to Add or Remove Clients
Managing your VPN is just as easy as installing it. If you need to add a new client (for example, for a different device) or revoke an existing client's access, you don't need to edit any complex files.Just run the script again!
Bash:
./wireguard-install.sh
Last edited: