Contact Form

Name

Email *

Message *

Cari Blog Ini

Pgadmin Docker

Deploying pgAdmin 4 with Docker

Introduction

In this article, we'll guide you through the steps of setting up PostgreSQL and pgAdmin 4 in a Docker environment.

Prerequisites

* Docker installed and running * A PostgreSQL database

Deploying pgAdmin 4

PgAdmin can be deployed in a container using the image at Docker Hub. A Docker Container containing pgAdmin running in server mode over HTTP or HTTPS is available at Docker Hub.

To deploy pgAdmin 4, run the following command:

``` docker run -d -p 8080:80 --name pgadmin4 dpage/pgadmin4 ```

This command will deploy a container named "pgadmin4" that runs pgAdmin 4 on port 8080.

Linking pgAdmin 4 with PostgreSQL

To make Pgadmin installed with Docker work along with Postgesql we should link them with the Docker network command.

To link the pgAdmin 4 container with the PostgreSQL database, run the following command:

``` docker network connect postgresql pgadmin4 ```

This command will connect the pgAdmin 4 container to the "postgresql" network, which is where the PostgreSQL database is running.

Accessing pgAdmin 4

Once the pgAdmin 4 container is deployed and linked to the PostgreSQL database, you can access it by opening your browser and navigating to the following URL:

``` http://localhost:8080 ```

You will be prompted to enter a username and password. The default username and password for pgAdmin 4 is "admin".

Conclusion

In this article, we've shown you how to deploy pgAdmin 4 in a Docker environment and link it to a PostgreSQL database. This can be a useful way to manage your PostgreSQL databases and make them accessible from anywhere.


Comments