This guide introduces you to PiVPN for new users. It explains how it works and what you need to get started.
This guide introduces you to PiVPN for new users. It explains how it works and what you need to get started.
This guide might seem challenging, but it walks through setting up a PiVPN and sharing my experiences using it. If you already have a Raspberry Pi ready, skip the parts below. First, ensure you have a Pi in place and gather all necessary tools: a Pi model (like the Zero), an SD card (minimum 8GB), a network connection, and a computer with PuTTY or SSH client installed. Also, make sure your router has admin access.
The initial phase involves downloading Raspbian, preferably the Lite version unless you need graphical features. Be aware that the ZIP files are large—expect delays. After downloading, extract the files using an archive tool compatible with ZIP64. Flash the image to your SD card with BalenaEtcher or similar software.
Insert the SD card into your Pi and connect a keyboard and monitor temporarily to start the SSH server. Use the default credentials (username "pi", password "raspberry") to log in. Once logged in, run `sudo raspi-config` to access settings. Set up SSH by selecting "Interface Options," choosing SSH, and enabling it. Exit the GUI and power off the Pi.
Connect to your router via its client interface (e.g., "raspberrypi") and copy the assigned MAC address, assigning a static IP. This IP can be DHCP-assigned or manually set (e.g., 192.168.1.25). Reboot the Pi to apply changes.
Navigate to your router’s Port Forwarding section and open a port for your VPN (default is 1194, but customize as needed). You may also enable SSH access on port 22 if you want remote management.
Use PuTTY or your preferred SSH client to connect to the Pi using the static IP. Enter the new password you set earlier. Update the password if forgotten. Add a temporary user for added security, then remove it afterward.
After logging out, run `sudo apt-get update` to secure your system. Finally, install PiVPN by running `curl -L https://install.pivpn.io | bash`. Follow the prompts, choosing encryption strength (2048-bit recommended). Select TCP/UDP, confirm the VPN port (default 1194), and choose DH parameters if desired.
Choose a DNS provider (e.g., Cloudflare) and set up a domain if needed. Create VPN profiles with appropriate names and passwords. Use FTP to transfer your profile files to the Pi. Download OpenVPN client, connect via SSH, and configure it with your credentials.
If you encounter issues, revisit each step, ensuring configurations match your router’s instructions. This process ensures a secure, private connection for your Pi.
I noticed some gaps in my previous posts about PiVPN, especially since my system was becoming slow. Here’s what I covered instead: For a basic server setup, PiVPN offers a free VPN alternative. I’ve faced occasional problems with internet blocking preventing access, which could be resolved by adjusting the port number. Unfortunately, I’m unsure how to launch the configurator after installation. Changing a setting often requires uninstalling and reinstalling the app. It might be possible to run both PiVPN and Pi-Hole on the same Raspberry Pi, though I haven’t tested it yet. Further investigation would be needed.