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
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

[DZone Research] Observability + Performance: We want to hear your experience and insights. Join us for our annual survey (enter to win $$).

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • Top 8 PostgreSQL GUI Software in 2021
  • How I Stopped Coding Repetitive Service Components with Kong
  • 5 Key Postgres Advantages Over MySQL
  • Using Envoy Proxy’s PostgreSQL and TCP Filters to Collect Yugabyte SQL Statistics

Trending

  • Unlocking Data Insights and Architecture
  • Performance Optimization Strategies in Highly Scalable Systems
  • Top 8 Conferences Developers Can Still Attend
  • CI/CD Docker: How To Create a CI/CD Pipeline With Jenkins, Containers, and Amazon ECS
  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.

Charles Ituah user avatar by
Charles Ituah
·
May. 04, 23 · Tutorial
Like (1)
Save
Tweet
Share
5.45K 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
  • How I Stopped Coding Repetitive Service Components with Kong
  • 5 Key Postgres Advantages Over MySQL
  • Using Envoy Proxy’s PostgreSQL and TCP Filters to Collect Yugabyte SQL Statistics

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

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

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: