Theme editor

Guide Linux Easy WireGuard VPN Setup on Ubuntu 24.04 (Quick Script Guide)

  • Thread starter Thread starter CL4Y
  • Start date Start date
  • Views 346

CL4Y

Keyboard Ninja
Administrator
Thread owner

🚀 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.
  • root access (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

jetto-WireGuard-vpn-install-1.gif


🛠️ 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 systemd service to keep WireGuard running.
  • Generate your first client configuration file (usually saved as a .conf file in the root directory).
You can then use this .conf file with any WireGuard client (for your phone or computer) to connect to your new VPN.

jetto-WireGuard-vpn-install-2.gif


👤 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
The script will detect that WireGuard is already installed and present you with a menu of options, including "Add a new client" and "Remove a client."

jetto-WireGuard-vpn-install-3.gif
 
Last edited:
Thread owner
You now have a high-performance, secure WireGuard VPN running on your Ubuntu 24.04 server. This script method saves a significant amount of time and simplifies the entire setup and management process.
 
It’s a very nice and helpful explanation for those who are curious and want to try it out.
 
Back
Top