How to install pgAdmin4 on FreeBSD 12

You can download this article in PDF format to support us through the following link.

Download the guide in PDF format

turn off


pgAdmin is the leading open source feature-rich PostgreSQL management and development platform that can run on Linux, Unix, Mac OS X and Windows. It provides a powerful GUI to simplify database management and operation.

pgAdmin allows you to manage PostgreSQL 9.2 and higher. At the time of writing, the latest version of pgAdmin is v4 Migrating from Bootstrap 3 to Bootstrap 4.

Set prerequisites

As a prerequisite, you need to have:

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

Step 1: Install PostgreSQL database server

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

How to install PostgreSQL 11 on FreeBSD 12

Step 2: Update FreeBSD system

In my setup, I installed pgAdmin on the same server running PostgreSQL. But you can choose to set it on other servers.

First update the FreeBSD database database.

freebsd-update fetchfreebsd-update install

Step 3: Install Python pip and Virtualenv

pip is required to install Python packages. Follow the guide below to install it on your FreeBSD server.

How to install pip Python package manager on FreeBSD 12

Once pip is installed, please install the virtualenv package.

sudo pkg install py36-virtualenv

If you are using Python 2.7, please run:

sudo pkg install py27-virtualenv

Step 4: Install the pgAdmin suite

Create a virtual environment for pgAdmin4 by running the following command:

$ 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, it should be

virtualenv pgadmin4

Activate the created virtual environment:

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 bindings to the SQLite3 library. For python 3.6, run:

sudo pkg install py36-sqlite3

For Python 2.7, use:

sudo pkg install py27-sqlite3

Before downloading, please check the latest version of pgAdmin4. After getting the latest version of the path, please use pip command.

pip install

Since many dependencies are installed, this installation may take some time, so please be patient.

Step 5: Configure and run pgAdmin 4

After installation, a 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 versus python2.7

Change the listening address of the default server to

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

This is the line 138


The default listening port is 5050 But you can change it to the desired port.

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

Use the following command to run pgAdmin.

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

The first run will require you to enter email address with password Used for pgAdmin user account.

Step 6: Access the pgAdmin web interface

Now that we have installed and running pgAdmin4, you can access the URL by “http: // your server_ip: 5050“.

How to install pgAdmin4 on FreeBSD 12

Log in using the created user email address and password. After logging in, you need to connect to the PostgreSQL server.

How to install pgAdmin4 on FreeBSD 12

Enter the server connection name and group.

How to install pgAdmin4 on FreeBSD 12

Down “Connect” Labels provide access details-database host, database user and password.

How to install pgAdmin4 on FreeBSD 12

Save the settings to activate your connection.

How to install pgAdmin4 on FreeBSD 12

Now you can use pgAdmin for PostgreSQL database management tasks.

If you are a MariaDB user, please check: How to install MariaDB 10.3 on FreeBSD 12

How to install PHP 7.3 on FreeBSD 12

You can download this article in PDF format to support us through the following link.

Download the guide in PDF format

turn off