pgAdmin is a management tool for PostgreSQL and EDB Postgres advanced server, in this blog post, You will install it from source code in your Windows machine. According to the official GitHub repo,
pgAdmin 4 is written as a web application in Python, using jQuery and Bootstrap for the client side processing and UI. On the server side, Flask is being utilised.
You need to install the tools below.
Create a directory in any terminal of choice, I will be using
gitbashfor this tutorial.
mkdir pgadmin && cd pgadmin
Clone the repository from GitHub by running the command below.
git clone https://github.com/pgadmin-org/pgadmin4.git
This will successfully install it.
Building the Runtime for the frontend.
To build the runtime for the frontend, enter into the directory /pgadmin4/runtime, create a new file called
dev_config.jsoncopy the contents of the file
dev_config.json.ininto this file. Inside the
dev_config.jsonfile, edit the python path to the actual path to the
python.exein your machine.
Run the command
Execute the runtime by running this command.
This will start the pgAdmin.
Configuring the Python Environment for the Backend.
To configure the python environment, from the
pgadmindirectory, create a virtual environment and activate this environment by running this command.
cd .. python -m virtualenv penv # creates a virtual environment source penv/Scripts/activate #activates the virtual environment
Upgrade to the latest version of
pipif you are not using one already, as
pgAdminrequires the latest version via this command below.
pip install --upgrade pip
Add the part to your Postgres bin directory to your environment variables by running this command, this is necessary so
pg-configcan be found for building
export PATH="$PATH:/c/Program Files/PostgreSQL/15/bin"
This path, is the path to the PostgreSQL 15 I installed via the Windows installer. You can replace 15 with any version that you have.
Install the dependencies by running this command.
pip install -r requirements.txt
Start the server by running the command below.
Starting pgAdmin 4. Please navigate to http://127.0.0.1:5050 in your browser.will be seen on the terminal, which shows the server has started Happy coding.
Please do give me a like and a follow if you enjoyed this blogpost.