How to Install pfSense Firewall on Ubuntu and CentOS? (2024)

How to Install pfSense Firewall on Ubuntu and CentOS? (1)

The pfSense software is an open-source firewall and router solution based on the FreeBSD operating system. Suitable for small and mid-range companies, the pfSense provides a low cost, dedicated firewall, and router solution for physical and virtual computer networks.

The software, which can run on either a physical or virtual computer, provides a wide range of powerful features, almost similar to what the commercial firewall devices offer. It also supports other third-party solutions such as Squid, Snort, and others to increase its capabilities further. Benefits of using pfSense firewall software include;

  • Does not require high levels of technical expertise
  • Has a web-based interface for easy configuration or upgrade or adding functionalities
  • Low total cost of ownership
  • Avoids vendor lock-in
  • Flexible deployment options, including physical hardware appliances and computers, as well as virtual machines.

Typical pfSense applications include;

  • Firewall
  • Wireless access point
  • Router
  • VPN endpoint
  • DNS/ DHCP server
  • Load balancer
  • Traffic shaper
  • Web content filter and more

Installation of pfSense

The pfSense software is an operating system itself, and you cannot install it on top of another OS. You either reserve an entire physical computer or deploy it as a virtual machine within a physical system such as a server. Virtual deployment eliminates the need for an extra computer on your network.

In this article, we will show you how to install the pfSense software on a virtual machine on either Ubuntu or CentOS. To do this, you need a machine that supports virtualization.

We will begin by creating the virtual machine in which we will then install pfSense. You can use VirtualBox, VM Ware, KVM, or any other compatible virtualization software. In this guide, we will work with VirtualBox.

As long as the machine has the VirtualBox, the installation of pfSense is the same as below, regardless of the host operating system. This means that you will follow the same steps on Ubuntu, CentOS, and other Linux distros, macOS, or Windows.

Installing pfSense on Ubuntu and CentOS using VirtualBox

Prerequisites

  • Physical or virtual computer running Ubuntu or CentOS
  • Sudo user rights
  • Virtualization software such as VirtualBox, VM Ware, KVM, Virtuozzo, Xen, etc. For the purpose of this article, we will work with Oracle’s VirtualBox.
  • Two network cards

Step 1: Download pfSense installer ISO

As you create and configure the virtual machine, you will require the pfSense ISO installer file, which we recommend you download from the official website before you begin setting up the VM.

The download page offers various options, and the particular file depends on the computer hardware and installation process.

  • Choose the Architecture, the type of installer file, and the appropriate mirror site to download from.
  • In our case, we will select AMD64 (64 bit) architecture, CD image (ISO) installer, and mirror in New York City, USA.
  • Click Download and note the location of the file.

How to Install pfSense Firewall on Ubuntu and CentOS? (2)

The file is usually compressed in gzip (gz) format, and you will need to extract it to an ISO. Note the download location since you will need this file after setting up the virtual computer.

Step 2: Create pfSense and configure Virtual machine

On your Ubuntu or CentOS server,

Open VirtualBox and click New

How to Install pfSense Firewall on Ubuntu and CentOS? (3)

Type the name you want to use for the pfSense VM, and then choose the operating system type and version. In this tutorial, we will use the following details;

  • Name: pfsvm
  • Type: BSD
  • Version: FreeBSD (64-bit)
  • Once set, click Next.

How to Install pfSense Firewall on Ubuntu and CentOS? (4)

You will be prompted to size the memory using the slider. Click Next to use the recommended memory. In this guide, we will use the recommended 1GB, out of our server’s 4GB RAM.

Create the virtual disk and choose type and size

The next step is now to create a virtual hard disk for our pfSense VM. The recommended is 16 GB but you can change it depending on your resources.

Select Create a virtual disk now, and click Create. On the Hard disk file type screen, select VMDK (Virtual Machine Disk) and click Next.

How to Install pfSense Firewall on Ubuntu and CentOS? (5)

Select the Dynamically allocated storage option and click Next to proceed. Provide a name for the virtual disk file and adjust the size or use the default as necessary. In our case, we leave the suggested name which is the same as the pfSense virtual machine name, and the recommended 16GB hard disk size. Use the slider, type the number in the box to adjust the size. Click Create.

How to Install pfSense Firewall on Ubuntu and CentOS? (6)

This will create the pfSense VM and then take you back to the VirtualBox main page.

How to Install pfSense Firewall on Ubuntu and CentOS? (7)

In the next steps, we will set up the networks, network interface cards, and bootable disk options. We will first create a network within the VirtualBox environment.

Step 3: Create and Configure VirtualBox networks

On the VirtualBox Manager, click on File and then preferences.

How to Install pfSense Firewall on Ubuntu and CentOS? (8)

If you have other networks, they will appear on the screen, and we can use them; if not, we need to create one. Click on the green + button on the right-hand side.

How to Install pfSense Firewall on Ubuntu and CentOS? (9)

This will add a NAT network with the name NatNetwork.

Ensure that the network is active. Use the button at the bottom to change the network properties. In our case, we will leave it at the default.

How to Install pfSense Firewall on Ubuntu and CentOS? (10)

Click OK to save the settings and continue. We will now add a host network. To do this, go to File, and click Host Network Manager.

Under the Host Network Manager dialog box, click Create, and then Properties to set the IP addresses for the resulting vboxnet0 internal LAN network.

How to Install pfSense Firewall on Ubuntu and CentOS? (11)

Ensure that the DHCP Serveris enabled and that it has the correct configuration.

How to Install pfSense Firewall on Ubuntu and CentOS? (12)

We have now created the network within the VirtualBox virtual environment, and we can now configure our pfSense VM network cards. The WAN adapter connects through the NAT network while the LAN will connect to the vboxnet0 network.

Step 4: Configure pfSense VM network interface adapters and connections

On the left-hand column, highlight the new pfSense virtual machine (pfsvm), click Settings, and then Network.

How to Install pfSense Firewall on Ubuntu and CentOS? (13)

Ensure that Adapter 1 is enabled and using the drop-down arrow on Attached to: field, select Nat Network. Our NatNetwork appears by default at the Name field. If you have more than one network, use the one where you want to use the pfsense firewall. Adapter 1 will work as the WAN interface card. After this, you will configure a second adapter for the LAN.

Click on Adapter 2, tick the checkbox to Enable Network Adapter. In the attached to: drop-down box, select Host-only adapter, and host network Name as vboxnet0. Click OK once set. You can also use other options such as Bridged adapter or any other depending on your requirements

How to Install pfSense Firewall on Ubuntu and CentOS? (14)

Step 5: Configure VM to start from pfSense installer disk

The next step is to configure the startup disk options. You will configure the pfSense virtual machine to start from the installer ISO disk image.

Go to Settings, and open Storage

Click on the Empty CD icon.

On the right-hand side, click the small arrow next to the CD icon.

Click on the Choose Virtual Optical Disk File option.

How to Install pfSense Firewall on Ubuntu and CentOS? (15)

Navigate to the location where you saved the downloaded pfSense ISO installer file. In our case, it is in the Downloads folder.

Select the pfSense ISO installer file and click open.

How to Install pfSense Firewall on Ubuntu and CentOS? (16)

This CD part will change from Empty to the name of the pfsense iso file.

Click OK.

How to Install pfSense Firewall on Ubuntu and CentOS? (17)

Step 6: Install pfSense software on the virtual computer

After configuring the virtual drive, clicking OK will take you back to the VirtualBox Manager’s main page.

With the pfSense VM (pfsvm) highlighted, click start.

How to Install pfSense Firewall on Ubuntu and CentOS? (18)

The VM starts from the pfSense bootable ISO virtual CD and begins the installation process. For this guide, we will use the default values. You can always change these after the setup is complete.

How to Install pfSense Firewall on Ubuntu and CentOS? (19)

To accept the distribution notice terms. Click Accept.

How to Install pfSense Firewall on Ubuntu and CentOS? (20)

Enter OK to continue with the default Install pfSense option.

How to Install pfSense Firewall on Ubuntu and CentOS? (21)

Select the keyboard map you prefer. Press Enter to continue with the default US keymap settings.

How to Install pfSense Firewall on Ubuntu and CentOS? (22)

Choose how you want to partition your disk. Use the recommended Auto (UFS) guided installation option.

How to Install pfSense Firewall on Ubuntu and CentOS? (23)

The installation will begin. Wait until it completes.

How to Install pfSense Firewall on Ubuntu and CentOS? (24)

Once the installation is complete, you will be asked whether you want to make changes or not. For now, choose the default No unless you want to modify some options.

How to Install pfSense Firewall on Ubuntu and CentOS? (25)

The installation is now complete, and you need to restart the system. Before doing so, eject the installer CD for the computer to start from the pfSense installed on the hard disk.

To eject the disk, navigate to Devices, Optical Drives, and click on the Remove disk from virtual drive.

How to Install pfSense Firewall on Ubuntu and CentOS? (26)

Click Force Unmount.

How to Install pfSense Firewall on Ubuntu and CentOS? (27)

With the disk ejected, select Reboot and press Enter to restart the pfSense firewall virtual machine.

Step 7: Access and configure pfSense Firewall

After reboot, the pfSense VM will give the output below if the installation was successful. You can now customize the firewall.

How to Install pfSense Firewall on Ubuntu and CentOS? (28)

  • From the command prompt using the respective numbers
  • Through a web GUI using another computer on the same network and LAN connection
  • Web GUI over the internet and WAN interface.

Step 8: Access pfSense using web GUI

The web GUI provides an easier method and options. To access the pfSense through a web browser, you need a machine on the same network. Open the web browser and type the LAN IP address. In our case, it is 192.168.1.1

How to Install pfSense Firewall on Ubuntu and CentOS? (29)

Type in the username as admin and password as pfSense and click SIGN IN. This will give you a wizard that guides you through the initial setup process.

Follow the steps and change where necessary. Initial settings include the admin account password and LAN interface.

Once complete, click Finish.

How to Install pfSense Firewall on Ubuntu and CentOS? (30)

After clicking Finish, you need to accept the No Commercial Distribution agreement, after which you see the pfSense status dashboard. With the initial setup complete, you can now access the menu and modify a wide range of parameters. This includes the Interfaces, Firewall, VPN, and other features.

How to Install pfSense Firewall on Ubuntu and CentOS? (31)

What’s next?

Learn more about pfSense here. If you are not interested in spending time on installation, then you may consider getting a cloud VM with pfSense pre-installed.

How to Install pfSense Firewall on Ubuntu and CentOS? (2024)

FAQs

How to install pfSense firewall on Ubuntu? ›

  1. Step 1: Download pfSense installer ISO. ...
  2. Step 2: Create pfSense and configure Virtual machine. ...
  3. Step 3: Create and Configure VirtualBox networks. ...
  4. Step 4: Configure pfSense VM network interface adapters and connections. ...
  5. Step 5: Configure VM to start from pfSense installer disk.
Nov 30, 2022

What are the requirements for pfSense installation? ›

The minimal hardware requirements include a 64-bit amd64 (x86-64) compatible CPU, 512 MB of RAM, 8 GB of free hard disk space, at least one compatible network interface, and a bootable USB drive with at least 1 GB of space for installation.

Is there anything better than pfSense? ›

We have compiled a list of solutions that reviewers voted as the best overall alternatives and competitors to Netgate pfSense, including Check Point Next Generation Firewalls (NGFWs), Sophos Firewall, WatchGuard Network Security, and FortiGate NGFW.

How to install firewall in CentOS? ›

Install Firewalld on Linux with the Terminal
  1. Install Firewalld on CentOS / Fedora. sudo yum install firewalld.
  2. Install Firewalld on Arch / Manjaro. sudo pacman -S firewalld.
  3. Install Firewalld on Gentoo. emerge net-firewall/firewalld.
Mar 21, 2024

How to install firewall in Ubuntu? ›

How to Set Up a Firewall with UFW on Ubuntu
  1. Prerequisites.
  2. Setup Ubuntu firewall with UFW.
  3. Step 1 — Making Sure IPv6 is Enabled.
  4. Step 2 — Setting Up Default Policies.
  5. Step 3 — Allowing SSH Connections.
  6. Step 4 — Enabling UFW.
  7. Step 5 — Allowing Other Connections.
  8. Step 6 — Denying Connections.
Feb 27, 2024

How to install firewall step by step? ›

How To Configure a Firewall
  1. Secure the firewall. ...
  2. Establish firewall zones and an IP address structure. ...
  3. Configure access control lists (ACLs) ...
  4. Configure other firewall services and logging. ...
  5. Test the firewall configuration. ...
  6. Manage firewall continually.

How to install firewall in Linux? ›

Configuring a firewall in Linux
  1. Step 1 – Begin with strengthening your Linux security. ...
  2. Step 2 – Configure Iptables. ...
  3. Step 3 – Blocking the connections. ...
  4. Step 4 – Decide the firewalls ports you want to close. ...
  5. Step 5 – Decide the firewall ports to be left open. ...
  6. Step 6 – Save the firewall's configuration for Linux.

How do I connect to pfSense for the first time? ›

The first time a user logs into the pfSense® software GUI, the firewall presents the Setup Wizard automatically. The first page of the wizard is shown in Figure Setup Wizard Starting Screen. Next to proceed. Using the setup wizard is optional.

What operating system is pfSense built on? ›

The pfSense® software project is a free network firewall distribution based on the FreeBSD operating system with a modified kernel and third-party free software packages for extra capabilities.

Does pfSense need an OS? ›

pfSense is an operating system based on FreeBSD. So, installing pfSense (and FreeBSD) is the same as installing Linux. You can't install it on top of some other operating system's disk layout. It requires its own unique disk configuration (same as Linux or OpenBSD).

How to install pfSense on Linux server? ›

Step 1: Download & Install pfSense on Dedicated Server

Navigate to the official pfSense website and download the version of your choice. We recommend that you always use the latest stable release version. Login to your Dedicated Server's iDRAC and use the Virtual Console to upload/attach the . iso file of pfSense.

What are the disadvantages of pfSense? ›

Challenging web GUI setup and management: Non-expert users may find it challenging to set up and manage the web GUI, particularly when it comes to assigning WAN and LAN interfaces. Limited API and scripting capabilities: Some reviewers have highlighted the lack of an API for making changes in pfSense.

Which firewall is better than pfSense? ›

OPNsense​ OPNsense is the best open-source and free firewall alternative to pfSense Software. OPNsense is a user-friendly, open-source, FreeBSD firewall and router. Most of the same capabilities are available in this fork of pfSense Software.

Do I need a router if I have pfSense? ›

If you want to connect your home or business LAN to another network or the Internet, you will need at least one router.

Which command is used for install firewall on Ubuntu? ›

Yes, UFW was introduced in Ubuntu 8.04 LTS, and it comes pre-installed in later versions, including 18.04. However, it is disabled on the default settings. To enable it, enter the sudo ufw enable command. Other UFW features are also disabled by default, such as IPv6 support and logging.

How do I make my firewall active in Ubuntu? ›

ufw - Uncomplicated Firewall
  1. Enable or disable ufw. To enable ufw , run the following command from a terminal prompt: sudo ufw enable. ...
  2. Open or close a port. ...
  3. Add or remove a rule. ...
  4. Allow access from specific hosts. ...
  5. The --dry-run option. ...
  6. Check the status. ...
  7. ufw application integration. ...
  8. IP masquerading with ufw.

How do I setup a firewall in Linux terminal? ›

Configuring a firewall in Linux
  1. Step 1 – Begin with strengthening your Linux security. ...
  2. Step 2 – Configure Iptables. ...
  3. Step 3 – Blocking the connections. ...
  4. Step 4 – Decide the firewalls ports you want to close. ...
  5. Step 5 – Decide the firewall ports to be left open. ...
  6. Step 6 – Save the firewall's configuration for Linux.

Top Articles
Latest Posts
Article information

Author: Gov. Deandrea McKenzie

Last Updated:

Views: 5664

Rating: 4.6 / 5 (66 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Gov. Deandrea McKenzie

Birthday: 2001-01-17

Address: Suite 769 2454 Marsha Coves, Debbieton, MS 95002

Phone: +813077629322

Job: Real-Estate Executive

Hobby: Archery, Metal detecting, Kitesurfing, Genealogy, Kitesurfing, Calligraphy, Roller skating

Introduction: My name is Gov. Deandrea McKenzie, I am a spotless, clean, glamorous, sparkling, adventurous, nice, brainy person who loves writing and wants to share my knowledge and understanding with you.