Skip to main content
Background Image
  1. PostgreSQL Posts/

PgAdmin Installation and Configuration

·220 words·2 mins· ·
Ruohang Feng
Author
Ruohang Feng
Pigsty Founder, @Vonng
Table of Contents

PgAdmin4 Installation and Configuration
#

PgAdmin is a GUI designed specifically for PostgreSQL. It works very well. It can run as either a local GUI program or a web service. Since PgAdmin’s GUI components have display issues on Retina screens, this guide primarily covers how to configure and run PgAdmin4 as a web service (Python Flask).

Download
#

PgAdmin can be downloaded from the official FTP.

PostgreSQL website FTP directory

wget https://ftp.postgresql.org/pub/pgadmin3/pgadmin4/v1.1/source/pgadmin4-1.1.tar.gz
tar -xf pgadmin4-1.1.tar.gz && cd pgadmin4-1.1/

You can also download from the official Git Repo:

git clone git://git.postgresql.org/git/pgadmin4.git
cd pgadmin4

Install Dependencies
#

First, you need to install Python - either version 2 or 3 will work. Here we’ll use administrator privileges to install the Anaconda3 distribution as an example.

First create a virtual environment (though using the physical environment directly is also fine):

conda create -n pgadmin python=3 anaconda

Based on your Python version, install dependencies according to the corresponding requirements file.

sudo pip install -r requirements_py3.txt

Configuration Options
#

First run the initialization script to create the PgAdmin administrator user.

python web/setup.py

Follow the prompts to enter email and password.

Edit web/config.py to modify default configuration, mainly changing the listen address and port.

DEFAULT_SERVER = 'localhost'
DEFAULT_SERVER_PORT = 5050

Change the listen address to 0.0.0.0 to allow access from any IP. Modify the port as needed.

Related

Bash and psql Tips
·1819 words·9 mins
Some tips for interacting between PostgreSQL and Bash.
Incident Report: Uneven Load Avalanche
·1342 words·7 mins
Recently there was a perplexing incident where a database had half its data volume and load migrated away, but ended up being overwhelmed due to increased load.
Backup and Recovery Methods Overview
·4009 words·19 mins
Backup is the foundation of a DBA’s livelihood. With backups, there’s no need to panic.
PgBackRest2 Documentation
·3129 words·15 mins
PgBackRest is a set of PostgreSQL backup tools written in Perl
Pgbouncer Quick Start
·2906 words·14 mins
Pgbouncer is a lightweight database connection pool. This guide covers basic Pgbouncer configuration, management, and usage.
PostgreSQL Server Log Regular Configuration
·660 words·4 mins
It’s recommended to configure PostgreSQL’s log format as CSV for easy analysis, and it can be directly imported into PostgreSQL data tables.