pgAdmin is the leading Open Source feature-rich PostgreSQL administration and development platform that runs on Linux, Unix, Mac OS X, and Windows. It provides a powerful GUI which ease your Database management and operations.

install pgadmin 4 freebsd 12

pgAdmin allows you to manage PostgreSQL 9.2 and above. As of this writing, the latest release of pgAdmin is v4 which had migration from Bootstrap 3 to Bootstrap 4.

Setup Pre-requisites

As a pre-requisite, you need to have:

  • FreeBSD server
  • PostgreSQL server installed
  • User account with sudo privileges

Step 1: Install PostgreSQL database server

For the installation of PostgreSQL database server, refer to our previous guide:

How to Install PostgreSQL 11 on FreeBSD 12

Step 2: Update FreeBSD system

In my setup, I’m installing pgAdmin on the same server running PostgreSQL. But you have an option of setting it up on a different server.

First update the FreeBSD Repository Database.

freebsd-update fetch
freebsd-update install

Step 3: Install Python pip & Virtualenv

pip is required for installing Python packages. Install it on your FreeBSD server by following below guide.

How to Install pip Python package manager on FreeBSD 12

Once pip is installed, install virtualenv package.

sudo pkg install py36-virtualenv

if you’re using Python 2.7, then run:

sudo pkg install py27-virtualenv

Step 4: Install pgAdmin packages

Create a virtual environment for pgAdmin4 by running:

$ virtualenv-3.6 pgadmin4
Using base prefix '/usr/local'
New python executable in /home/vagrant/pgadmin4/bin/python3.6
Also creating executable in /home/vagrant/pgadmin4/bin/python
Installing setuptools, pip, wheel…done.

For Python 2.7, this should be

virtualenv pgadmin4

Activate the Virtual environment created:

source pgadmin4/bin/activate

If it fails, use:

source pgadmin4/bin/activate.csh

Install Python dependencies for pgAdmin:

pip install pyopenssl cryptography pyasn1  ndg-httpsclient 

Then install the standard Python binding to the SQLite3 library. For python 3.6, run:

sudo pkg install py36-sqlite3

For Python 2.7, use:

sudo pkg install py27-sqlite3

Check for the latest release of pgAdmin4 before downloading. Once you get the path to latest release, install it with the pip command.

pip install

This installation may take some time as a number of dependencies are installed, so be patient.

Step 5: Configure and run pgAdmin 4

After the installation, configuration file should be created for pgAdmin 4.

cp ./pgadmin4/lib/python3.6/site-packages/pgadmin4/ ./pgadmin4/lib/python3.6/site-packages/pgadmin4/

For Python 2.7, replace python3.6 with python2.7

Change the default server Listen address on to

vim ./pgadmin4/lib/python3.6/site-packages/pgadmin4/

This is around line 138


The default listen port is 5050 but you can change it to your desired port.

The default port on which the app server will listen if not set in the environment by the runtime

Use following command to run pgAdmin.

$ sudo python ./pgadmin4/lib/python3.6/site-packages/pgadmin4/
NOTE: Configuring authentication for SERVER mode.
Enter the email address and password to use for the initial pgAdmin user account:
Email address: [email protected]
Password: <Enter Password>
Retype password: <Confirm Password>
pgAdmin 4 - Application Initialisation
Starting pgAdmin 4. Please navigate to in your browser.

The first run will ask you to Enter the email address and the password to use for the pgAdmin user account.

Step 6: Access pgAdmin Web Interface

Now that we have pgAdmin4 installed and running, you can access its web dashboard by visiting the URL “http://your_server_ip:5050“.

install pgAdmin freebsd 12 login

Login with created user email address and password. After login, you’ll need to connect to your PostgreSQL server.

install pgAdmin freebsd 12 01

Enter server connection name and group.

install pgAdmin freebsd 12 02

Under “Connection” tab, provide access details – DB host, DB user and Password.

install pgAdmin freebsd 12 03

Save the settings to activate your connection.

install pgAdmin freebsd 12 04

You can now enjoy using pgAdmin for your PostgreSQL database management tasks.

If you’re a MariaDB user, check: How to Install MariaDB 10.3 on FreeBSD 12

How to Install PHP 7.3 on FreeBSD 12

Your support is our everlasting motivation,
that cup of coffee is what keeps us going!

As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.


Please enter your comment!
Please enter your name here