Guide – How To Start – WireGuard Server on Rocky 9 on Amazon

Configuration and Connection to WireGuard Server on Rocky 9

To work, you should open ports TCP – 22, UDP – 51280-51282 in the network properties in the Amazon firewall. After purchasing and starting the VM, you should know its IP address. You can find it in the personal account of Amazon. 

To connect to the Server, you should generate a “Private Key” in advance. This can be done using the following instructions (by choosing the “file format:” option “.ppk” in point 3) Guide – How To – Create and use Key Pair to connect to a VM

  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 in 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, and click “Open”.
  • 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 username and press the Enter button
  1. Next, one of the free IP addresses will be offered, press Enter
  1. The console displays the QR code for mobile devices and the path to the config.
  1. Enter the command:

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

  1. Copy the part of the code highlighted in the screenshot 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: https://www.wireguard.com/install/ Launch the application.
  2. Click on the Import tunnel(s) from the button and select the file created earlier.
  1. Press the Activate button

Congratulations! This tutorial helped you configure the WireGuard VPN server and client. This setup lets you surf the web anonymously by keeping your traffic data private.

You can check the functionality by opening the website www.myip.com in a browser.

Website Built with WordPress.com.

Up ↑