How to Install PiVPN on Debian

Updated on November 21, 2023
How to Install PiVPN on Debian header image

Introduction

An easy way to set up a VPN server on Debian is with PiVPN. PiVPN is an installer and wrapper for OpenVPN. It creates simple commands for you to control your VPN Server.

Create User

First, create a new user. This user can have any name, but for this example we will use "vpn".

adduser vpn

Installing PiVPN

Run the command found on the PiVPN website as root.

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

While it is installing you will see a few prompts, and for most users you should keep the settings to the default. It will automatically find your new user and add it as the default storage for the VPN profiles.

Usage

Now that the installation is complete, you can add and remove VPN profiles. To add a profile run the following.

pivpn add

Enter the name and password of the profile you wish to have. The profile is then stored in the home directory of the "vpn" user. You could also add a user without a password.

pivpn add nopass

If you wish to revoke a user, use the following command, replacing example with the user to be removed.

pivpn revoke example

Conclusion

To connect to the VPN, all you need is the *.ovpn files stored in /home/vpn/ovpns. Copy these to your clients of choice using the method of your choice, install the OpenVPN client and import the file.