Setup PostgreSQL and pgAdmin4 with Docker Compose.
- About
- Installation
- Usage
- Contributing
- Contact
This repository will show you how to setup PostgreSQL and pgAdmin4 together with Docker and how to launch it with Docker Compose.
In our case we used :
- PostgreSQL postgres:14-alpine
- pgAdmin4 dpage/pgadmin4:6.2
- docker-compose v1.29.2
- Docker v20.10.8
You can download the project by pressing the Code/Download ZIP button on GitHub or else you can type the following command in your terminal if you have Git of course.
$ git clone https://github.com/MyoDev-app/postgresql-pgadmin4-docker.git
You will have to install both Docker and Docker Compose.
- Launch the container by using the following command
$ docker-compose up
- Wait a bit
...
Creating postgres-db ... done
Creating db-management ... done
Attaching to postgres-db, db-management
...
postgres-db | CREATE DATABASE
...
db-management | ----------
db-management | Loading servers with:
db-management | User: example@pgadmin4.com
db-management | SQLite pgAdmin config: /var/lib/pgadmin/pgadmin4.db
db-management | ----------
db-management | Added 1 Server Group(s) and 1 Server(s).
...
-
Open your favorite web browser at 0.0.0.0:5050
-
Log in with
example@pgadmin4.com
as email andpsswd2
as password
Those credentials are available as environment variables in setup/.env
as PGADMIN_DEFAULT_EMAIL
and PGADMIN_DEFAULT_PASSWORD
respectively.
-
If successfully logged in click on main-databases on the Browser panel
-
Click on MyoDev main database which will make a new small window appear
-
On this small window you will have to given the PostgreSQL credentials which are
admin
as username andpsswd1
as password. -
Now the database should be accessible.
...
...