DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Top 8 PostgreSQL GUI Software in 2021
  • 5 Key Postgres Advantages Over MySQL
  • Implementing Sharding in PostgreSQL: A Comprehensive Guide
  • Integrating Lakeflow Connect With PostgreSQL: A Developer’s Complete Hands-On Guide From the Field

Trending

  • Ujorm3: A New Lightweight ORM for JavaBeans and Records
  • How to Test a PATCH API Request With REST-Assured Java
  • Smart Deployment Strategies for Modern Applications
  • S3 Vectors: How to Build a RAG Without a Vector Database
  1. DZone
  2. Data Engineering
  3. Databases
  4. How To Run the Latest Version of PostgreSQL Using Docker

How To Run the Latest Version of PostgreSQL Using Docker

One can rely on the PostgreSQL object-relational database system to ensure data integrity, making the workflow of DevOps Developers and Engineers more productive.

By 
Charles Ituah user avatar
Charles Ituah
·
May. 04, 23 · Tutorial
Likes (1)
Comment
Save
Tweet
Share
7.1K Views

Join the DZone community and get the full member experience.

Join For Free

What Is PostgreSQL?

PostgreSQL, commonly referred to as "Postgres," is an ORDBMS that prioritizes extensibility and adherence to standards. Its main purpose as a database server is to securely store data and retrieve it upon request from software applications, whether they are on the same machine or on a network. Postgres is capable of handling workloads of varying sizes, ranging from small single-machine applications to large, internet-facing applications with multiple users. Additionally, recent versions of Postgres offer database replication for enhanced security and scalability. 

PostgreSQL is a highly versatile database management system that adheres to the SQL:2011 standard and follows the ACID compliance model, which ensures reliable and accurate data transactions. It utilizes multi-version concurrency control (MVCC) to avoid locking issues and provides immunity to dirty reads and full serializability. PostgreSQL supports a wide range of SQL queries using advanced indexing methods not available in other databases. It also offers features such as updateable views, materialized views, triggers, foreign keys, support functions, and stored procedures. Furthermore, PostgreSQL is highly extensible and offers a plethora of third-party extensions. It can also migrate data from major proprietary and open-source databases using standard SQL support and migration tools. The software's extensibility allows it to emulate many proprietary extensions through built-in and third-party open-source compatibility extensions, such as those for Oracle.

How to Setup WSL2 and Install Docker Desktop on Windows 10

In order to properly configure Docker and get PostgreSQL to work, we need to follow a process:

  1. Search for Turn Windows features on or off
  2. Tick Windows Subsystem for Linux and Virtual Machine Platform
  3. Now restart the PC
  4. Open run and type winver to check the build version 
  5. To update to WSL 2, you must be running Windows 10
    • For x64 systems: Version 1903 or later, with Build 18362 or later.
    • For ARM64 systems: Version 2004 or later, with Build 19041 or later.
  6. Download the Linux kernel update package
  7. Open PowerShell and Set WSL 2 as your default version
PowerShell
 
wsl --set-default-version 2

     8.  Check the available valid Linux distribution by running this command in PowerShell.  

PowerShell
 
wsl -l -o

      9. Install your Linux distribution of choice. In this case, I chose Ubuntu 18.04.

PowerShell
 
wsl --install -d Ubuntu-18.04

     10. Run the Ubuntu terminal and enter your UNIX username and UNIX password
     11. Install Docker Desktop Installer 4.1.1 and run Docker to start the engine.


How To Install the Latest Version of PostgreSQL

  1. Go to Docker Hub
  2. Search for Postgres
  3. Select the official Docker Image of PostgreSQL
  4. Run this command to pull Postgres which will be the latest version
Dockerfile
 
docker pull postgres


How to Run PostgreSQL in Docker 4.11


    1. Start a Postgres instance by running this command

Dockerfile
 
docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres

    2. Navigate to Docker, and Postgres should be up and running.

Open source Docker (software) PostgreSQL sql

Opinions expressed by DZone contributors are their own.

Related

  • Top 8 PostgreSQL GUI Software in 2021
  • 5 Key Postgres Advantages Over MySQL
  • Implementing Sharding in PostgreSQL: A Comprehensive Guide
  • Integrating Lakeflow Connect With PostgreSQL: A Developer’s Complete Hands-On Guide From the Field

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook