# WireGuard VPN \[Easy]

## Entry

WireGuard is a modern solution for creating secure virtual private networks (VPNs). It is an easy-to-use, fast and reliable tool that provides a high level of data security. WireGuard uses advanced cryptographic protocols and algorithms to protect your connection, making it one of the safest VPNs available today.

{% hint style="success" %}
This instruction uses Ubuntu 20.04
{% endhint %}

{% hint style="info" %}
Recommended Specifications:

CPU: 1 vCore\
RAM: 512 MB\
Storage: 1 GB\
Network Speed: 100Mbps+\
\
This information is referenced and does not require much attention, as any available tariff plan is suitable for using WireGuard VPN on our virtual servers.
{% endhint %}

## Connect to the server

Connect to your server. If necessary, you can use our[ detailed instructions](https://wiki.spacecore.pro/vds-dedicated/how-to-use-vps-vds#connect) to perform this operation.

## WireGuard installation

Update the list of packages and system repositories.

```
apt-get update
```

The next step is to check the presence or install Curl.

```
apt-get install curl -y
```

Next, use the command to install the Docker software. The download and installation happens automatically.

```
curl -sSL https://get.docker.com | sh
```

Wait about 1 minute (time depends on network speed and server performance). The following message indicates that the Docker has been successfully installed.

<figure><img src="/files/WpmCYZbjxxt2zGBmhflt" alt=""><figcaption></figcaption></figure>

After the installation is complete, use the template provided below and modify it to set the required values.

{% hint style="warning" %}
«🚀YOUR\_SERVER\_IP» — the address of the server on which WireGuard VPN is being installed.\
«🚀YOUR\_ADMIN\_PASSWORD» — the password that will be used to access the Web Control Panel.

It is necessary to change the whole value, which is specified in quotation marks, without leaving unnecessary spaces or Emoji.
{% endhint %}

```
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-easy
```

{% hint style="warning" %}
Make sure that your password contains only numbers and/or letters. The presence of other characters can lead to script execution error.&#x20;

An example of an **incorrect password** is u>N#uG\_3Z=5pS'cn;&#x20;

An example of a **suitable password** - QJQcc7cAdTY85sp7
{% endhint %}

The screenshot below shows a valid request to run the command according to the data for our server.

<figure><img src="/files/bTp5QaSD66iPbLs6IN54" alt=""><figcaption></figcaption></figure>

Wait for the installation and make sure that no errors occurred during it. Almost done! Next you need to go to the browser at «**IP:51821**», where «**IP**» is the address of your server. The next page will open, where you should enter the password you specified when using the command to install WireGuard.

<figure><img src="/files/gHxyDeRXedtDF855Z9ZD" alt=""><figcaption></figcaption></figure>

After authorization, use the button to create a new **VPN** user.

<figure><img src="/files/OCpNNrAN3TDfz0Gx16mc" alt=""><figcaption></figcaption></figure>

Specify any suitable name and press «**Create**».

<figure><img src="/files/JcptcqbfB29vDSYx73Yz" alt=""><figcaption></figcaption></figure>

Great! First user created. There are several ways we can connect to our VPN network.

## Using

### Download File . conf

To load the configuration file, use the appropriate button next to the user you created.

<figure><img src="/files/95ro7lc3ZsQ1wiifjWic" alt=""><figcaption></figcaption></figure>

You can use the downloaded file to configure the connection to a VPN on any available device, whether computer or router. That’s all it takes to connect.

On your computer, you can add this file to [WireGuard VPN](https://www.wireguard.com/install/) using the appropriate button.

<figure><img src="/files/F3pQjapOgKEsCkudCjZ4" alt=""><figcaption></figcaption></figure>

If all is done correctly, after adding and activating the tunnel, you will see an active transfer of incoming and outgoing traffic.

<figure><img src="/files/BNXxpNrGRYawbJlljQSX" alt=""><figcaption></figcaption></figure>

### Scan the QR

This method is especially convenient for devices with a camera (🧐and suddenly you decide to use your computer’s webcam?)

To use this method you just need to click on the QR-code display button.

<figure><img src="/files/yFL0VPp4nZqTYj5NXNZP" alt=""><figcaption></figcaption></figure>

Then scan it with your device.

<figure><img src="/files/9dgXCvNRuGdqMQLlStMN" alt=""><figcaption></figcaption></figure>

Tunnel added and ready for use!

<figure><img src="/files/eAImyJRR5jsYYs4H8koz" alt=""><figcaption></figcaption></figure>

## Monitoring

For each user of your VPN in the control panel, you can see the activity information as well as the traffic consumed in real time.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://spacecore.gitbook.io/wiki/en/vpn-and-privacy/wireguard-vpn-easy.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
