Install Web Portal on Raspberry Pi

This page is a guide for anyone willing to install PiGuard Web Portal on a Raspberry Pi.


Table of Content

Prerequisites

  • PiGuard installed on a Raspberry Pi with SSH access and a user with sudo permissions.
  • Ensure you removed previous versions of the Web Portal.
  • Clone the repository and ensure it is up-to-date.

Raspberry Pi prerequisites

The following dependencies must be installed on the Raspberry Pi:

  • GNU make
  • Python >=3.10
  • Wireguard

Installation

1. Connect to the Raspberry Pi using SSH. Create a new folder named app (or any other name that suits you).

$ mkdir app

2. In the app folder, copy only the following subdirectories from the repository:

  • piguard_portal
  • scripts

And the following files:

  • requirements.txt
  • babel.cfg

Ensure the code is up-to-date and the current branch is the dev branch (TODO: Update for main branch).

3. You must run the following commands as root on the Raspberry Pi.

If Python3.x is installed without pip, first run:

# apt install python3-pip

Install the required dependencies:

# python3 -m pip install -r requirements.txt

If you can't install packages system-wide, you may have to run this first:

# mv /usr/lib/python3.11/EXTERNALLY-MANAGED /usr/lib/python3.11/EXTERNALLY-MANAGED.old

4. Create a new systemd service to serve the web portal by running:

# python3 scripts/create_service_file.py

5. Start the systemd service:

# systemctl daemon-reload
# systemctl enable piguard_portal.service
# systemctl start piguard_portal.service

6. Check that it is running:

# systemctl status piguard_portal.service

Last but not least

Retrieve the Raspberry Pi IP address by running in its terminal:

$ hostname -I

You should get at least one IP address. You will have to enter it in your web browser address bar in order to access the portal's login page.

⚠️ If you are not sure, try every IP address you get in your URL bar as follows:

http://<RASPBERRY_IP_ADDRESS>:8000/

What's next

Read the Getting started page to login into the platform and start using it!

It will enable you to:

  • Check your connection status.
  • Configure the network name and password.
  • Generate your VPN keys.
  • Get the VPN public key to send to Nothing2Hide.