docker run -p 5432:5432 --name myPostgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres:alpine
The default password = postgres
Create a folder, for example: ‘C:/data/pg’
docker run -p 5432:5432 --name myPostgres -e POSTGRES_PASSWORD=mysecretpassword -v C:/data/pg:/var/lib/postgresql/data -d postgres:alpine
docker run -p 5050:80 --name pgadmin4 -e PGADMIN_DEFAULT_EMAIL=”steven.d.hondt.sdh@gmail.com” -e PGADMIN_DEFAULT_PASSWORD=”pass” dpage/pgadmin4:latest
The application will be running on:
PgAdmin4 > Servers > New Server
Host name / address: PC-NAME / IPv4 address
Port: 5432
Username: postgres
Password: pass
We can get the Host name or IPv4 address of our machine easily with following command:
- Windows
ipconfig /all
- Linux
ip a