Installing PostgreSQL on MacOS
Oct 14, 2025 in Uncategorized by admin
- Download and install Docker Desktop for macOS from the official Docker website
- Start docker environment and after start docker, Via terminal, Pull the PostgreSQL Docker Image
docker pull postgres
- After that, add postgreSQL user in docker
docker run -d --name mypostgres -p 5432:5432 -e POSTGRES_PASSWORD=your_secure_password postgres
-d: Runs the container in detached mode (in the background).
--name mypostgres: Assigns the name “mypostgres” to your container (you can choose a different name).
-p 5432:5432: Maps the container’s port 5432 to the host’s port 5432, allowing you to connect from your Mac.
-e POSTGRES_PASSWORD=your_secure_password: Sets the password for the default postgres user. Replace your_secure_password with a strong, secure password.
postgres: Specifies the Docker image to use.