Posts

Showing posts from January, 2021

Use Postgresql from docker

To me - it's always painful to install and configure Postgresql on local machine. As a developer, it kills much time. Another problem is to manage a list of servers when I've to work with multiple postgres version at the same time. It's better to use Docker to setup database rather than manually installing the DB server. It's super easy to install any database version with just a few steps. In this post I'm going to note down the steps I've followed to install Postgresql 9 inside a docker container. Also I'll import from an existing database to this one.   Step one: Install docker There are plenty of tutorials on this so I'm skipping it. At the end of this step you should be able to run the docker command from terminal. If you are new to docker, I'll recommend to play with it a bit so that you are familiar with the keywords: container, image, docker hub etc.   Step two: Pull the docker image We need to pull the image from docker hub to our local mach