This is the 7th day of my participation in the November Gwen Challenge. Check out the details: The last Gwen Challenge 2021

PostgreSQL includes two powerful management tools, pgAdmin and Navicat. The former is free and open source, and the latter is available only for a fee. There are many ways to install pgAdmin, including using the installation package of each system or using the container after installation. In this article, Docker Compose is used to build an environment to quickly start pgAdmin.

A, pgAdmin

PgAdmin is PostgreSQL’s most popular, rich open source management and development platform, and is the most advanced open source database in the world. PGAdmin can be used on Linux, UNIX, MacOS, and Windows to manage PostgreSQL and EDB Advanced Server 9.5 and later.

PGAdmin 4 is a complete version of PGAdmin, built using Python and JavaScript/jQuery. It can be installed in the following ways.

PgAgent is a PostgreSQL job planner that can be managed using pgAdmin.

Docker Compose create Docker Compose file and run it

First create the docker-comemess.yml file and fill it with the following:

Version: '3.8' services: pgadmin: container_name: pgadmin4_container image: dpage/pgadmin4 restart: always environment: PGADMIN_DEFAULT_EMAIL: [email protected] PGADMIN_DEFAULT_PASSWORD: root ports: - "5050:80"Copy the code

In this case, our service name is pgadmin, and for convenience we use the markup format for such a service container_name changes the default container name to pgadmin4_container.

Then, run the following command in the same directory as the docker-comemage.yml file.

docker compose up
Copy the code

We’ll get the entire application up and running with the Docker compose up command. Next, let’s connect pGADmin4 to our PostgreSQL database server.

3. Configure the database connection service

First, access http://{yourhost}:5050/ from your browser. Use [email protected] and root as the login passwords.

Click Servers > Create > Server to Create a new Server. Fill in the data for name, hostname/address, username and password.

After the configuration is complete and the connection is successful, you can enjoy it out of the box.