fbpx

Run Pgadmin on Docker Compose

To run pgAdmin on Docker Compose, you can follow these steps:

  1. Install Docker and Docker Compose on your system if you haven’t already.

  2. Create a docker-compose.yml file in a new directory and add the following contents to it:

 
				
					version: '3'
services:
  pgadmin:
    image: dpage/pgadmin4
    environment:
      - PGADMIN_DEFAULT_EMAIL=pgadmin@example.com
      - PGADMIN_DEFAULT_PASSWORD=secret
    ports:
      - "80:80"

				
			

This file defines a pgadmin service that will be run using the dpage/pgadmin4 Docker image. It also sets the default email and password for the pgAdmin user, and exposes the pgAdmin web interface on port 80.

  1. In the same directory, run the following command to start the pgAdmin service:
				
					docker-compose up -d

				
			

This command will start the pgadmin service in the background.

  1. To access the pgAdmin web interface, open a web browser and go to http://localhost. You should see the pgAdmin login page. Use the default email and password that you specified in the docker-compose.yml file to log in.

  2. Once you are logged in, you can use the pgAdmin interface to connect to a Postgresql database and manage it.

  3. To stop the pgAdmin service, run the following command in the same directory:

				
					docker-compose down

				
			

Go to browser and type ip/hostname of your docker compose host with port :80 like https://localhost:80. Enter the username and password which you have mention in docker compose yaml file.

Share:

Facebook
Twitter
Pinterest
LinkedIn

Social Media

Most Popular

Get The Latest Updates

Subscribe To Our Weekly Newsletter

No spam, notifications only about new products, updates.

Categories