Guidance on usage: Wireguard VPN Server on Rocky 8 on Amazon

Wireguard VPN Server on Rocky 8 ensures efficient and secure VPN connectivity for your workloads. Its lightweight design provides seamless performance in any environment.

Built for efficiency, optimized for your needs — get started instantly.

Configuration and Connection to the Wireguard VPN Server on Rocky 8

Connecting to the Server and Creating a User

After purchasing and starting the VM you should know its IP address. You can find it in your Amazon personal account.

To work, TCP port 22 and UDP ports 51280-51282 must be open in the Amazon firewall network properties.

Before connecting to the server, you must generate a “Private Key” in advance. This can be done by following the instructions in the guide, “Guidance on usage: Key Pair Setup for Seamless VM Access” (be sure to select the “.ppk” option in step 3).

  1. Connecting to the VM using the PuTTY application. You can download it at the following link – Download
    • Go to section SSH on the left panel, and then to Auth
  • In the “Auth” section, click “Browse” and specify the path to the .ppk file you received earlier.
  • Go to the home page of “Session”, enter the IP address of the VM (1), and click “Open” (2).
  • In the opened console you will need to enter the login rocky.
  1. Next, you need to enter the following command to create a user

$ sudo addvpnuser

  1. Enter the user name and press Enter button
  1. Next, one of the free IP addresses will be offered, press Enter
  1. The console will display QR codes for mobile devices and the path to the config file.
  1. Enter the following command to open the configuration file:

$ sudo cat /etc/wireguard/usercfg/wg0.”user name”.conf

  1. Copy the highlighted part of the code using Ctrl + C.
  1. Create a blank text document and paste the copied part of the code into it using Ctrl + V.
  1. Press File, then Save as.
  1. In the line Save as type, select All files from the drop-down list. In the File name line, enter the file name and the “.conf” extension. Save the document by clicking on the Save button.

Connection to Wireguard Server

  1. Next, you need to install the Wireguard app. Download link – Installation – WireGuard. Launch the application.
  1. Click on the “Import tunnel(s) from file” and select the file you created earlier.
  1. Press the Activate button
  1. Congratulations! This tutorial helped you configure the WireGuard VPN server and client. This setup allows you to surf the web anonymously by keeping your traffic data private.

You can check the change in your IP by visiting What Is My IP before and after connecting to the WireGuard server.