Installing, running and managing postgres in local-machine for development is not difficult anymore. Here is a simple way to get all at one place e...
For further actions, you may consider blocking this person and/or reporting abuse
Hi thanks for this article but when I do this. PGAdmin gets installed and started but when I try to access it on browser with localhost:5050 but it is not working. It shows site can't be reached.
Ensure the docker container is up and running :
docker ps -a
Yes it is running and shows that open 0.0.0.0: , but still not able to access on browser.
It looks like you missed to give port while running the pgadmin ?
I have given the port too, still it doesn't work.
you are missing. -d flag. the in order to run in deamon mode you need to dive -d flag -
docker run --rm -d -p 5050:5050 thajeztah/pgadmin4
Thats really well written, good job 👏
Hey great article! But why not use Docker for production environment?!
Its not about using docker for production environment.
As the DB is hosted in a container and not attached to any volume, once we delete the container (like
docker rm <container_id>
), the data in DB will be lost permanently.Which will not be the way a production app should work.
I agree with Marcos...nice article J Shree! :-)
It might also be helpful to show folks how to save their data even after running
docker rm <container_id>
. This is how I normally accomplish this:First, create a local directory to hold the data:
Then start PostgreSQL using a volume mount so the container will store the data in this newly created local directory:
Using this method, you can be safe in knowing that even if you accidentally run
docker rm <container_id>
that you can restart PostgreSQL again and have all of you data just as you left it previously.Hope this helps!
The reason you have to create a volume (which is mapped to your container) is to locally persist your data so that in the event you stop/restart your container, you can always have your data. So, your database stays though you will need the container running in order to access it.
May thanks for this...
I am about to switch to M1 mac. Is a separate ARM version required?
Very useful, thank you so much
Nice article
Great Stuf Thanks!
How to find the ipaddress of the psql server for pgAdmin?:
Do this: docker inspect postgresql-container | grep IPAddress