How to Set Up Private Internet Access on Linux?

We are reader supported and may earn a commission when you buy through links on our site. Learn more.

Private Internet Access (PIA) provides diverse setup methods for Linux, including the easiest process involving installing the native PIA app for Linux

On the PIA Linux up, you can easily update the VPN, set up features like port forwarding, and uninstall the app.

Thankfully, PIA is compatible with various Linux distros such as Ubuntu, Debian, Fedora, and CentOS. So, you can always benefit from its robust security and commitment to user privacy.

Learn how to install or configure a Private Internet Access server on your Linux machines.

How to Set Up the Private Internet Access App for Linux?

Here’s how to install the PIA native Linux application:

  1. Buy a Private Internet Access subscription.
Private Internet Access Plans & Price
Image for illustration only. Design, deals, and details may differ. Click on the image for current info.
  1. Download the PIA app for Linux from the Private Internet Access website.
download pia for linux
  1. Launch the terminal on your Linux machine. I’ll use Ubuntu for this guide.
search linux terminal
  1. Type in the command “cd Downloads” to change into the directory where the PIA for Linux file is saved.
change linux directory
  1. Use the command “sh [filename of the PIA for Linux file].” In this case, I entered the command “sh pia-linux-arm64-3.3.1-06924.run.”
install pia via linux terminal
  1. Enter your system user password to continue the installation.
enter sudo password for linux terminal
  1. Once the installation is successful, it’ll display a Quick Tour/Login Window.
pia quick tour and log in button
  1. Click “Login” and enter your PIA account credentials.
  1. Click “VPN Server” to select your preferred server location. I recommend connecting to the server closest to your location for optimal performance. I chose the US – Florida server.
  2. Click the “Power Button” to establish a VPN connection.

How to Set Up PIA for Linux via Manual Connection Scripts?

Another way to set up Private Internet Access on Linux is to use manual connection scripts. While this method isn’t as simple as the PIA native Linux app setup, you can follow these steps to obtain the same results:

  1. Get a PIA subscription. Grab our time-limited discounts now!
Private Internet Access Plans & Price
Image for illustration only. Design, deals, and details may differ. Click on the image for current info.
  1. Go to PIA’s GitHub repo to get the scripts.
pia's github repository
  1. Click Code > Download Zip to download the compressed folder.
download pia's github repository
  1. Launch “Files” from the app drawer on your Linux machine.
linux files icon
  1. Locate the directory where the compressed folder you downloaded is saved. In this case, it is in the “Downloads” directory.
linux downloads folder
  1. Right-click the compressed file and select “Extract Here.”
extracting pia's github repository in download folder
  1. Launch your Linux terminal to start the installation process.
searching linux terminal
  1. Type “cd Downloads/[name of the uncompressed folder]” to change into the uncompressed folder. Here, I entered the command “cd Downloads/manual-connections-master.”
change linux directory
  1. Enter the command “sudo ./run_setup.sh” to run the script.
sudo run setup on linux terminal
  1. Enter your system administrator password.
enter linux terminal administrator password
  1. Enter your Private Internet Access username and password.
enter pia username and password
  1. If your terminal displays the error “jq could not be found,” you must install jq.
    1. To install jq, first, enter Ctrl + C to stop executing the current script. Then, run the command “sudo apt install -y jq.”
installing jq via linux terminal
  1. Once you’ve installed jq, rerun the script using the command “sudo ./run_setup.sh” and enter your PIA username/password.
script rerun on linux terminal
  1. Once the question “Do you want to use a Dedicated IP token” comes up, enter “Y” for yes or “N” for no.
pia dedicated ip token
  1. Enter “Y” for yes or “N” for no to allow or disable IPv6. I recommend disabling it, as it sometimes interferes with your VPN connection.
disabling pia ipv6
  1. Choose if you want to manually select a server or auto-connect to a server with the lowest latency.
choosing manual or auto connect server for pia
  1. Enter the maximum latency you want to allow. I’ll set mine to 100.
pia minimum latency allowed
  1. You’ll get servers with 100ms latency or less to connect to.
pia servers
  1. Select your preferred server location. I’ll choose US – California (131) for this guide.
pia us california server
  1. Press “W” to select the WireGuard protocol or “o” to choose the OpenVPN connection method. I’ll select WireGuard for this guide.
choosing pia protocol via linux terminal
  1. Your Private Internet Access is now all set up on your Linux system, and you can enjoy anonymity while browsing the internet.
pia set up successfully via linux terminal

How to Set Up PIA for Linux Using OpenVPN?

You can also use the OpenVPN setup to manually configure Private Internet Access on your Linux. Here’s a straightforward process to help you:

  1. Buy a PIA subscription.
  2. Open your Linux terminal from your app menu.
search linux terminal
  1. Type “sudo apt-get install openvpn” to install OpenVPN.
install openvpn on linux via terminal
  1. Enter your system admin password.
enter linux system admin password
  1. Enter the command “cd /etc/openvpn” to switch to the OpenVPN directory.
change directory to openvpn folder
  1. Download the PIA Linux zip file using the command “sudo wget https://www.privateinternetaccess.com/openvpn/openvpn-nextgen.zip” or “sudo curl -o openvpn.ziphttps://www.privateinternetaccess.com/openvpn/openvpn-nextgen.zip
sudo curl openvpn linux terminal
  1. Type the command “sudo unzip openvpn zip” to unzip the file.
unzip openvpn file from terminal
  1. Enter the command “sudo openvpn cofig-serverlocationname.ovpn.” In this case, I entered “sudo openvpn us_california.ovpn.”
us california openvpn server
  1. Type your Private Internet Access username and password.
enter pia username and password
  1. Once it displays “Initialization Sequence Completed,” you’ve successfully connected to PIA on your Linux system.
pia connected successfully on linux system

How to Uninstall the PIA Linux App?

Uninstalling PIA from your Linux machine is a breeze since you get an in-app installer. Here’s how:

  1. Launch the Private Internet Access native Linux app.
  2. Click the power button again to disconnect from the server location. This step is only necessary if you’re still connected to the VPN.
  1. Open Settings by clicking the three dots on the top right of the app homepage.
  1. Click “Help” from the menu on the left.
  2. Click “Uninstall Private Internet Access.”
pia help options
  1. To continue the installation process, you’ll receive a prompt from the terminal, “Proceed with uninstall.” Type “Y” and press Enter.
private internet access terminal uninstaller
  1. Once the terminal displays “Stopped existing client,” the PIA app has been stopped.
enter admin password
  1. Enter your sudo password to complete the installation.
pia uninstall successful via linux terminal

How to Uninstall PIA on Linux Through the Terminal?

If you didn’t install PIA for Linux via its app, you can uninstall the VPN through your Linux terminal. Follow these simple steps:

  1. Launch the terminal in your Linux system.
searching linux terminal
  1. Enter the command “rm -rf ~/.config/privateinternetaccess” and press Enter.
remove pia config file via linux terminal
  1. Type in “rm -rf ~/.config/PrivateInterntAccess” and press Enter.
remove pia config folder via linux terminal
  1. Finally, enter “sudo rm -rf /opt/piavpn.” You may be prompted to enter your root/admin password. Type in your password and press Enter again.
sudo remove pia vpn via linux terminal
  1. If you want to remove the PIA app icon from your Linux application menu, enter “sudo rm -rf /usr/share/application/piavpn.desktop.”
sudo remove pia desktop shortcut

The PIA app is now completely uninstalled from your Linux system.

How to Set up Port Forwarding Through PIA on Linux?

Setting up port forwarding through PIA on your Linux machine is a breeze.

Port forwarding enables remote access to your Linux system through tools like SSH (Secure Shell) or VNC (Virtual Network Computing).

You can set up the PIA port forwarding directly through the PIA Linux app or manually on the terminal.

How to Set PIA’s Port Forwarding Through Linux App?

Using the Private Internet Access app is the easiest way to set up PIA port forwarding on your Linux machine. Here’s how:

  1. Launch the PIA Linux app and click the three vertical dots at the top right of the app.
  1. Click Settings > Network. Check the “Request Port Forwarding” box.
pia network settings
  1. Return to the PIA homepage and click “VPN Server” to select a server location.
  2. Click a server with port forwarding support. Note that any server location that doesn’t support port forwarding will be greyed out. When you hover over it, you’ll get the message “Port forwarding is not available for this location.”
  1. Click the big button to initiate a VPN connection. The port forwarding detail, including VPN IP, is at the bottom right.

How to Set PIA’s Port Forwarding on Linux Manually?

If you set up the PIA VPN using Manual Configuration Scripts, you should activate port forwarding similarly.

Follow these steps to get it done:

  1. Obtain the configuration scripts from PIA’s GitHub repo.
pia github repository
  1. On the right side of the repo, click “Code” then “Download Zip.”
download pia's github repository
  1. Open “Files” on your Linux system to access the downloaded compressed folder.
linux files icon
  1. Right-click on the file and select “Extract Here” to uncompress the folder.
extracting pia's github repository in download folder
  1. In your Linux terminal, type “cd Downloads/[name of the uncompressed folder]” to change the directory to that of the folder. In this case, I entered “cd Downloads/manual-connections-master.”
change linux directory
  1. Run the configuration script using the command “sudo ./run_setup.sh.”
sudo run setup on linux terminal
  1. Enter your system administrator password.
enter linux terminal administrator password
  1. Enter your PIA username and password to continue.
enter pia username and password
  1. Enter “Y” once you get the question, “Do you want port forwarding assigned?” Then, press Enter to continue.
pia port forwarding via linux terminal

FAQs

Yes, Private Internet Access supports the WireGuard protocol on Linux. 

The easiest way to change protocol is to use the PIA native Linux app. 

You can also set the WireGuard protocol on your Linux machine using your terminal’s manual connection script.

No, Private Internet Access doesn’t support connection via Network Manager on Linux. To connect to PIA on Linux, you can use the PIA native Linux app, set up manual connection scripts, or use the OpenVPN method.

You can optimize the Private Internet Access performance on Linux by switching to the WireGuard protocol, selecting a server closest to your physical location, or getting a PIA-dedicated IP address for an extra layer of security.

Empower Your Linux Experience With PIA

Private Internet Access provides a user-friendly native app for Linux users, making the setup process seamless and straightforward.

Thankfully, you also get all the exceptional PIA features available to Windows and MacOS users via the app setup.

Join the PIA train by grabbing my exclusive discounts to save on the multiyear deal today!

PIA logo
pia devices
EXCLUSIVE February DEAL!
Our partner, Private Internet Access, offers an exclusive discount for a limited time! Don't miss out on the chance to save extra money.
OFFER EXPIRES IN:
Hours
Minutes
Seconds
TODAY!
VIEW EXCLUSIVE OFFER
Or Try Private Internet Access for FREE