Set up PiVPN on Ubuntu 22.04 – Easy Steps

In this guide, we intend to teach you how to set up PiVPN on Ubuntu 22.04. PiVPN is a lightweight OpenVPN server designed to run on Raspberry Pi 2 or 3. It gives you access to your home network through a secure connection over the internet. Plugging a Raspberry Pi into your router acts somewhat like a bridge between mobile devices and your network.

You can use Pi VPN to:

  • Access your files, music, and movies from anywhere
  • Encrypt your mobile internet connection
  • Print on your home printers from your laptop
  • Bypass firewalls and website restrictions at work and abroad
  • Hide your mobile IP address
  • Connect with your home cameras and smart devices

You can now proceed to the following steps from the Orcacore website to Set up PiVPN on Ubuntu 22.04.

Steps To Set up PiVPN on Ubuntu 22.04

To Set up PiVPN on Ubuntu 22.04, you must log in to your Ubuntu 22.04 server as a root user.

The installation of PiVPN is easy and takes a few minutes.

Steps To Set up PiVPN on Ubuntu 22.04

Step 1 – Install PiVPN on Ubuntu 22.04

First, you need to update your local package index with the following command:

sudo apt update

Then, you need to create a new user for your PiVPN. To do this, run the following command, you can choose your desired name:

adduser vpn

Then, run the following command to install PiVPN as the root user:

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

During the installation try to keep the settings the default. Then, it will automatically find your new user and add it as the default storage for the VPN profiles.

When your installation is completed let’s see how to use it.

Step 2 – Use PiVPN on Ubuntu 22.04

At this point, you are ready to Add and Remove VPN profiles.

Add a Client with PiVPN

To add a profile, use the PiVPN command on Ubuntu 22.04:

pivpn add

You will be asked to enter a name for the client.

Output
Enter a Name for the Client: orca
::: Client Keys generated
::: Client config generated
::: Updated server config
::: WireGuard reloaded
======================================================================
::: Done! orca.conf successfully created!
::: orca.conf was copied to /home/vpn/configs for easytransfer.
::: Please use this profile only on one device and create additional
::: profiles for other devices. You can also use pivpn -qr
::: to generate a QR Code you can scan with the mobile app.
======================================================================

List PiVPN Clients

To view the list of the PiVPN profiles on Ubuntu 22.04, run the command below:

pivpn list
Output
::: Clients Summary :::
Client      Public key                                        Creation date
orca        e09wkbgxH+QD9ImxTmK5AhLbLyNAWODwrzhPRz5uKDg=      20 Nov 2022, 12:50, UTC
::: Disabled clients :::

Remove a PiVPN Client

Anytime you decide to remove a user, you can use the command below:

pivpn remove orca
Output
Do you really want to delete orca? [y/N] y
::: Updated server config
::: Client config for orca removed
::: Client Keys for orca removed
::: Successfully deleted orca
::: WireGuard reloaded

To get more information about PiVPN options, you can run the command below:

pivpn --help
Output
::: Control all PiVPN specific functions!
:::
::: Usage: pivpn <command> [option]
:::
::: Commands:
:::    -a, add              Create a client conf profile
:::    -c, clients          List any connected clients to the server
:::    -d, debug            Start a debugging session if having trouble
:::    -l, list             List all clients
:::   -qr, qrcode           Show the qrcode of a client for use with the mobile app
:::    -r, remove           Remove a client
:::  -off, off              Disable a client
:::   -on, on               Enable a client
:::    -h, help             Show this help dialog
:::    -u, uninstall        Uninstall pivpn from your system!
:::   -up, update           Updates PiVPN Scripts
:::   -bk, backup           Backup VPN configs and user profiles

Conclusion

At this point, you have learned to Set up PiVPN on Ubuntu 22.04. As you saw, it is so easy to set up and use. Hope you enjoy it.

Also, you may like these articles:

Set up WireGuard VPN Server on Debian 11

OpenVPN Installation and Configuration on AlmaLinux 9

Install and Configure WireGuard on AlmaLinux 9

Set up and Configure PPTP VPN on Linux

Set Up and Configure an OpenVPN on Centos 7

FAQs

What is PiVPN?

PiVPN is a simple and open-source tool that allows users to easily install and configure a VPN server on Linux. Typically it is used on a Raspberry Pi, but it can also be installed on other Linux distributions like Ubuntu. Also, it supports WireGuard and OpenVPN.

How do I configure PiVPN with WireGuard or OpenVPN?

During the installation from the installer, you will be prompted to choose WireGuard or OpenVPN.

How do I uninstall PiVPN from Ubuntu?

To uninstall PiVPN, you can run: pivpn -u
This will remove the PiVPN setup but leave some configuration files that can be manually deleted.

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Leave a Reply

Stay informed and not overwhelmed, subscribe now!