WireGuard – Installation and setup on your own server
WireGuard is a modern solution for creating secure virtual private networks (VPN). It is an easy-to-use, fast and reliable tool that provides a high level of security when transferring data. WireGuard uses advanced cryptographic protocols and algorithms to protect your connection, making it one of the most secure VPN options available today.
System requirements
INFO
This guide uses the Ubuntu 20.04 OS. Recommended technical specifications:
- CPU: 1 vCore
- RAM: 512 MB
- Storage: 1 GB
- Network speed: 100Mbps+
This information is for reference, since any available virtual server plan will do for using WireGuard VPN.
Installation process
Preparing the server
- Connect to your server via SSH.
- Update the list of system packages and repositories:
apt-get update- Install Curl, if it is missing:
apt-get install curl -yInstalling Docker
Use the following command to install Docker automatically:
curl -sSL https://get.docker.com | shThe process will take about 1 minute, depending on the network speed and server performance.
.png)
Installing WireGuard
After Docker has been installed successfully, use the following template, replacing the variables with your own values:
docker run -d \
--name=wg-easy \
-e WG_HOST=🚀YOUR_SERVER_IP \
-e PASSWORD=🚀YOUR_ADMIN_PASSWORD \
-v ~/.wg-easy:/etc/wireguard \
-p 51820:51820/udp \
-p 51821:51821/tcp \
--cap-add=NET_ADMIN \
--cap-add=SYS_MODULE \
--sysctl="net.ipv4.conf.all.src_valid_mark=1" \
--sysctl="net.ipv4.ip_forward=1" \
--restart unless-stopped \
weejewel/wg-easyWhere:
🚀YOUR_SERVER_IP– the IP address of your server🚀YOUR_ADMIN_PASSWORD– the password for accessing the web control panel
Important: Use only letters and numbers in the password. Special characters may cause errors when the script runs.
Example of a correct password: QJQcc7cAdTY85sp7
Example of an incorrect password: u>N#uG_3Z=5pS'cn;
.png)
Configuring WireGuard
Access to the web panel
After a successful installation, open http://IP:51821 in your browser, where IP – the address of your server. Enter the password you set during installation.
.png)
Creating a user
- In the web interface, click the "New Client" button.
- Enter a username and click "Create".
.png)
.png)
Connecting to the VPN
Method 1: Using a configuration file
- Click the download button next to the created user to get the configuration file (
.conf). - Download the official WireGuard client for your operating system.
- Import the downloaded file into the WireGuard client.
- Activate the tunnel.
.png)
.png)
.png)
Method 2: Scanning a QR code
- Click the QR code button next to the user.
- Install the official WireGuard app on your mobile device.
- In the app, select the option to scan a QR code.
- Scan the code displayed in the web interface.
- Activate the connection.
.png)
.png)
.png)
Monitoring
The WireGuard web interface lets you track user activity and the amount of traffic consumed in real time. The connection status and current activity are displayed for each user.
WireGuard provides reliable protection of your data with minimal resource usage, which makes it an ideal choice for creating secure connections between devices and protecting your internet traffic from prying eyes.
.png)
Our resources
Telegram channel: https://t.me/
F3 Cloud: https://f3cloud.com