Setting up custom VPS

circle-info

This setup is primarily designed for Raspberry Pi, but it also supports any Debian-based Linux distribution.

  • For the best performance and lowest latency, we recommend renting a VPS from a hosting provider located in your country.

  • When setting up the VPS, make sure to select Debian or Ubuntu as the operating system and confirm that the server offers enough bandwidth.

  • After your hosting provider gives you the server’s IP address and login credentials, you can connect to it using SSH. Once logged in, update the system packages and then proceed with the setup.

Install PiVPN

Official sources: https://www.pivpn.io/arrow-up-right and https://github.com/pivpn/pivpnarrow-up-right

1

Run command in terminal:

curl -L https://install.pivpn.io | bash
2

Press Enter to confirm until next step.

3

Select yes .

4

Select your user.

5

Select WireGuard.

6

Confirm default port 51820

7

Select DNS provider.

  • We recommend CloudFlare or Google. Use arrows and press space to confirm selection.

8

Choose static IP or DNS

  • If your server uses a static IP address, select the IP option.

  • If you’re using a hostname or have configured Dynamic DNS, choose the DNS option and enter the hostname.

9

Enable security patches.

10

Select No to "Reboot now?"

11

Update VPN's IP address range (optional)

  • We recommend updating your VPN’s IP address range by editing the file:

/etc/pivpn/wireguard/setupVars.conf
  • Locate the line that starts with pivpnNET and replace the default randomly generated subnet with a custom range, for example: 10.10.10.0

12

Run installation command again

curl -L https://install.pivpn.io | bash
13

Select Repair .

14

Run PiVPN

  • Run PiVPN using command:

pivpn -d
  • If the diagnostic detects an issue (such as the missing iptables MASQUERADE rule), type Y when prompted. This will automatically fix the problem that prevents VPN clients from accessing the internet.

15

Reboot your system

Creating Clients

  • You will need a separate config for each client (Jetson, Ground stations, Android devices…)

  • To create a new config use:

pivpn -a
  • This will prompt you to choose a virtual ip address and name for this client. We recommend keeping a similar structure:

    • 10.10.10.2 – 10.10.10.9 Ground stations

    • 10.10.10.10 – 10.10.10.250 Jetsons

  • The generated client configurations are stored in ~/configs.

  • Copy the appropriate file to each Jetson device as: /etc/wireguard/air.conf

  • Copy the corresponding file to your ground station as: /etc/wireguard/ground.conf

For Android devices

  • You can use the WireGuard app’s Scan from QR code feature.

  • Run:

  • Select a client, and a QR code will be displayed in your terminal, ready to scan.

Last updated