Problem with creating server in pgadmin 4, unable to connect to server [closed]

Опубликовано: 27 Июль 2026
на канале: Emrah KAYA
150
0

Hello everyone! I hope this video has helped solve your questions and issues. This video is shared because a solution has been found for the question/problem. I create videos for questions that have solutions. If you have any other issues, feel free to reach out to me on Instagram:   / ky.emrah  

Below, you can find the text related to the question/problem. In the video, the question will be presented first, followed by the answers. If the video moves too fast, feel free to pause and review the answers. If you need more detailed information, you can find the necessary sources and links at the bottom of this description. I hope this video has been helpful, and even if it doesn't directly solve your problem, it will guide you to the source of the solution. I'd appreciate it if you like the video and subscribe to my channel!Problem with creating server in pgadmin 4, unable to connect to server [closed]




I am trying to create a server and a db in pgadmin 4.
The error message is Unable to connect to server:
connection failed: connection to server at "127.0.0.1", port 5432 failed: Connection refused Is the server running on that host and accepting TCP/IP connections

connection failed: connection to server at "127.0.0.1", port 5432 failed: Connection refused Is the server running on that host and accepting TCP/IP connections

I created a docker-compose:

version: '3.8'
services:
postgres:
image: postgres:13 # Version de PostgreSQL
container_name: postgres_container
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: admin
POSTGRES_DB: postgres
volumes:
postgres_data:/var/lib/postgresql/data
../src/scripts/data/init.sql:/docker-entrypoint-initdb.d/init.sql # Montez le script
ports:
"5432:5432"
pgadmin:
image: dpage/pgadmin4:latest # Image officielle de pgAdmin 4
container_name: pgadmin_container
environment:
PGADMIN_DEFAULT_EMAIL: [email protected] # Email de connexion à pgAdmin
PGADMIN_DEFAULT_PASSWORD: admin # Mot de passe pour pgAdmin
ports:
"8080:80" # Expose l'interface pgAdmin sur le port 8080
depends_on:
postgres
volumes:
pgadmin_data:/var/lib/pgadmin
volumes:
postgres_data:
pgadmin_data:

version: '3.8'
services:
postgres:
image: postgres:13 # Version de PostgreSQL
container_name: postgres_container
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: admin
POSTGRES_DB: postgres
volumes:
postgres_data:/var/lib/postgresql/data
../src/scripts/data/init.sql:/docker-entrypoint-initdb.d/init.sql # Montez le script
ports:
"5432:5432"
pgadmin:
image: dpage/pgadmin4:latest # Image officielle de pgAdmin 4
container_name: pgadmin_container
environment:
PGADMIN_DEFAULT_EMAIL: [email protected] # Email de connexion à pgAdmin
PGADMIN_DEFAULT_PASSWORD: admin # Mot de passe pour pgAdmin
ports:
"8080:80" # Expose l'interface pgAdmin sur le port 8080
depends_on:
postgres
volumes:
pgadmin_data:/var/lib/pgadmin
[email protected]
volumes:
postgres_data:
pgadmin_data:
Then I used a init.sql in the right path and docker-compose up.
init.sql
This question has found an answer


Tags: postgresql,docker,pgadmin-4Source of the question:
https://stackoverflow.com/questions/7...

Question and source license information:
https://meta.stackexchange.com/help/l...
https://stackoverflow.com/