Jesse Madsen
We will be installing Docker Desktop and spinning up a Postgres Database container. The installation time will vary, but the whole process should take less than 20 minutes.
Docker Desktop will allow us to manage our containers. If you are new to Docker, then you can check out Dockers excellent reference guide by clicking the docker whale below.
Install Docker Desktop by downloading from Docker.
Note you must have WSL 2 setup and working for Windows.
Once you have finished installing Docker Desktop it will not start automatically. Search for Docker Desktop in your Windows start-up menu and start it.
Sign in if prompted.
First we need to open a new Windows Powershell.
docker run -d -p 5432:5432 --name postgres-sample -e POSTGRES_PASSWORD=password --restart always postgres
There will be a container ID if you are succesful.
Your Docker Desktop will have a Postgres Instance running, mapped to port 5453.
If you are not familiar with DBeaver, it is a free light weight universal database GUI interface. We will be able to connect to our new Postgress Database and run PostgresSQL query commands. Click DBeaver below to download.
After you install DBeaver, we need to set up a new connect to our Postgres Instance. Click File and Select New.
Dropdown options in the DBeaver folder and select the database connection, then Next.
Double click PostgresSQl.
Right click postgres-sample and Edit the Connection.
Setting and testing the connection we need to set/check three settings.
Last step is to test connection. There will be a Connection test pop-up if you are succesful. Note, your Docker Destop needs to be on!
Thank you for following my blog. I hope it was informative and was able to help you spin up a brand new Postgres database. If you are interested in learning more on databases, you can click the below link "My first Database Tables."
Leave a Reply