SlideShare a Scribd company logo
12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment
https://hevodata.com/learn/docker-postgresql/ 1/15
3 Easy Steps to Install Docker
PostgreSQL Environment
Ishwarya M on Data Integration, Database Management Systems • February 7th, 2022 •
WRITE FOR HEVO
One of the most important phases of the Software Development Life Cycle
(SDLC) is Data Processing. This involves actions like Data Joining, Data
Cleaning, Data Filtering, and more. Usually, developers use Database
Management Applications like MySQL and PostgreSQL to implement Data
Processing Operations. Besides, while developing such applications,
developers work with several temporary software that get employed at
different phases of their SDLC.
To run different applications and processes, developers use Docker as a
containerization platform. It omits the need to install and run applications in
different environments. Developers can perform Data Processing Operations
using any Database Management System (DBMS) like PostgreSQL by pulling in
their respective Docker Image files from the Docker Hub.
In this blog, you will learn about the process of setting up a Docker PostgreSQL
environment. We’ll show how you can install, configure, and run PostgreSQL on
Docker in 3 simple steps. Read on to get started.
Table of Contents
Prerequisites for Setting Up Docker PostgreSQL Environment
What is PostgreSQL?
What is Docker?
12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment
https://hevodata.com/learn/docker-postgresql/ 2/15
3 Steps to Setup Docker PostgreSQL Environment
Step 1: Download and Install Docker
Step 2: Download Docker PostgreSQL Image
Step 3: Install PGAdmin on Docker
Conclusion
Prerequisites for Setting Up Docker PostgreSQL
Environment
A fundamental understanding of Data Processing Operations and Database
Management Systems (DBMS) like PostgreSQL.
What is PostgreSQL?
Image Source: PostgreSQL
Developed in the late 1980s, PostgreSQL is an Open-Source Relational
Database Management System (RDBMS) with more than 30 years of active
development history. Although PostgreSQL has object-oriented features for
handling unstructured data, it is widely used as a Relational Database.
PostgreSQL supports both SQL and JSON to implement relational and non-
relational queries on data present inside databases. In other words, with
PostgreSQL, you can write SQL commands to process data present in tables
that belong to the respective database servers. Because of its vast features
and functionalities, PostgreSQL is reportedly ranked 4th among the most
popular databases worldwide.
In case, if your website or application uses lots of reading queries, we
recommend you replicate your primary database (Master-Slave Replication).
For more details, check out this blog piece here- How To Achieve PostgreSQL
Master-Slave Replication?
12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment
https://hevodata.com/learn/docker-postgresql/ 3/15
What is Docker?
Image Source: Docker
Developed by Solomon Hykes in 2013, Docker is an Open-Source software tool
that allows you to quickly build, test, manage, and deploy applications. It carries
multiple containers that comprise all executable packages and dependencies
required to run an application. Docker Containers are built using Docker
Images, a template that comprises all the parameters and instructions required
to run a particular application.
You can access different Docker Containers by signing up on an online cloud
repository called Docker Hub. From the Docker Hub, you can easily pull or
download pre-configured Docker Containers, like Docker PostgreSQL
Container to execute specific applications based on your requirements.
If you are a software developer, you can also upload and share your own
applications in the form of Docker images that can be used by other Docker
users to try and execute your application.
 Simplify your Data Analysis with Hevo’s No-code Data
Pipeline
Hevo Data, a No-code Data Pipeline, helps load data from any Data
Source such as Databases, SaaS applications, Cloud Storage, SDKs, and
Streaming Services and simplifies the ETL process. It supports 100+ Data
Sources including 40+ Free Sources. It is a 3-step process by just
selecting the data source, providing valid credentials, and choosing the
destination. Hevo loads the data onto the desired Data
Warehouse/Destination like Google BigQuery, Snowflake, Amazon
Redshift, and Firebolt and enriches the data transforming it into an
analysis-ready form without having to write a single line of code.
12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment
https://hevodata.com/learn/docker-postgresql/ 4/15
It’s a completely Automated Pipeline that offers data to be delivered in
real-time without any loss from Source to Destination. Its fault-tolerant
and scalable architecture ensure that the data is handled in a secure,
consistent manner with zero data loss and supports different forms of
data. The solutions provided are consistent and work with different BI
Tools as well.
GET STARTED WITH HEVO FOR FREE
Check out why Hevo is the best:
Minimal Learning: Hevo, with its simple and interactive UI, is
extremely simple for new customers to work on and perform
operations.
Hevo Is Built To Scale: As the number of sources and the volume of
your data grows, Hevo scales horizontally, handling millions of records
per minute with very little latency.
Secure: Hevo has a fault-tolerant architecture that ensures that the
data is handled securely and consistently with zero data loss.
Schema Management: Hevo takes away the tedious task of schema
management & automatically detects the schema of incoming data
and maps it to the destination schema.
Incremental Data Load: Hevo allows the transfer of data that has
been modified in real-time. This ensures efficient utilization of
bandwidth on both ends.
Live Support: Our team is available round the clock to extend
exceptional support to its customers through Chat, Email, and Support
Calls.
Live Monitoring: Hevo allows you to monitor the data flow and check
where your data is at a particular point in time.
SIGN UP HERE FOR A 14-DAY FREE TRIAL!
3 Steps to Setup Docker PostgreSQL Environment
In the sections below, we show you a step-by-step process to install, set up,
and run Docker PostgreSQL Environment.
Step 1: Download and Install Docker
12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment
https://hevodata.com/learn/docker-postgresql/ 5/15
Image Source: Self
Before starting the application setup process for Docker PostgreSQL
Environment, you are required to download and install Docker on your local
machine. To download the application, visit the official website of Docker. On
the welcome page of the Docker website, click on the “Get-Started” option.
You will be redirected to the download page, where you can download the
Docker version according to your operating system specifications.
Select the preferred option to start the downloading process. After the Docker
setup file is downloaded, install it on your local machine by following the
installation steps.
Image Source: Self
Next, you can sign in on Docker Hub, from where you can access the Docker
Image files. This will be used to run external applications like PostgreSQL.
Step 2: Download Docker PostgreSQL Image
There are two different ways to download Docker PostgreSQL Image that
allows you to set up PostgreSQL on Docker. One is by directly accessing it from
the Docker Hub’s website. The other method is by pulling the Docker
PostgreSQL Image from default Command Line Interface (CLI) tools like
Command Prompt or Power Shell.
If you are opting for method one:
To download Docker PostgreSQL Image, visit Docker Hub using your
previously created user account.
12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment
https://hevodata.com/learn/docker-postgresql/ 6/15
On the welcome page, you can find a search bar at the top. Type
“PostgreSQL” to get the Docker Image of the respective application. You can
find various Docker Images related to the PostgreSQL database.
On clicking on the appropriate file, you will be redirected to a new page where
you can find the command used to access the Docker Image file. Copy and
make a note of the respective command. Run this into your Command Prompt
to install the PostgreSQL instance.
Another way to pull Docker PostgreSQL Image is by accessing it using the
Command Prompt instead of reaching its website. To do so, follow these steps:
Open a new command window, and run the command given below.
docker pull postgres
To obtain the list of existing Docker Images, run the following command.
docker images
In the next step, you can enter the command you copied from the Docker
Hub in the Command Prompt.
docker run --name some-postgres -e
POSTGRES_PASSWORD=mysecretpassword -d postgres
The above-given command should be customized and added with the
necessary parameters to work properly for setting up PostgreSQL on
Docker.
docker run --name postgresql -e POSTGRES_USER=myusername -e
POSTGRES_PASSWORD=mypassword -p 5432:5432 -v
/data:/var/lib/postgresql/data -d postgres
In the command given above,
PostgreSQL is the name of the Docker Container.
-e POSTGRES_USER is the parameter that sets a unique username to the
Postgres database.
12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment
https://hevodata.com/learn/docker-postgresql/ 7/15
-e POSTGRES_PASSWORD is the parameter that allows you to set the
password of the Postgres database.
-p 5432:5432 is the parameter that establishes a connection between the
Host Port and Docker Container Port. In this case, both ports are given as
5432, which indicates requests sent to the Host Ports will automatically
redirect to the Docker Container Port. In addition, 5432 is also the same port
where PostgreSQL will be accepting requests from the client.
-v is the parameter that synchronizes the Postgres data with the local folder.
This ensures that Postgres data will be safely present within the Home
Directory even if the Docker Container is terminated.
-d is the parameter that runs the Docker Container in the detached mode,
i.e., in the background. If you accidentally close or terminate the Command
Prompt, the Docker Container will still run in the background.
postgres is the name of the Docker image that was previously downloaded
to run the Docker Container.
Now, execute docker ps -a to check the status of the newly created
PostgreSQL container.
Image Source: DEV Comminity
On executing the command, you get the output, as shown in the above image.
It shows that Docker Container is running successfully on port 5432. You can
start and stop the newly created Docker Container by running the following
commands.
For starting the Docker Container:
docker start postgresqldb
For stopping the Docker Container:
docker stop postgresqldb
There you have it. You have now successfully created a Docker Container
running the PostgreSQL Environment.
12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment
https://hevodata.com/learn/docker-postgresql/ 8/15
Step 3: Install PGAdmin on Docker
At this stage of setting up the Docker PostgreSQL Environment, your
PostgreSQL is active and running on the respective ports. Now, you have to
install the PGAdmin, a web-based GUI tool used to manage PostgreSQL
databases and services. You can install PGAdmin to check whether your
Docker Containers are working fine and execute SQL queries on databases
present in PostgreSQL.
To download PGADmin, perform these steps:
Visit Docker Hub and search for PgAdmin. You can find various Docker
Images to run PGAdmin. Select the appropriate one and copy the Docker
pull command (Follow this link to get the “Docker pull” command, which
pulls the PGAdmin4 version. You can also get the respective PGAdmin
versions according to your preferences).
Execute the pull command to start PGAdmin.
docker pull dpage/pgadmin4:latest
After downloading the image, run the container by executing the command
given below.
docker run --name my-pgadmin -p 82:80 -e
'PGADMIN_DEFAULT_EMAIL=user@domain.local' -e
'PGADMIN_DEFAULT_PASSWORD=postgresmaster'-d dpage/pgadmin4
In the above-given command, my-pgadmin is the name of the Docker
PostgreSQL PGAdmin Container. PGADMIN_DEFAULT_EMAIL and
PGADMIN_DEFAULT_PASSWORD are the username and password for the
Docker PostgreSQL container, respectively.
Following this, open your browser and search for the web address
http://localhost:8081/. It will redirect you to the welcome page of the
PGAdmin 4 Web Instance.
12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment
https://hevodata.com/learn/docker-postgresql/ 9/15
Image Source: DEV Comminity
On the welcome page, it will ask you to enter the username and password of
PGAdmin 4.
Enter the credentials you defined while running the Docker Container of
PGAdmin.
Image Source: DEV Comminity
Upon logging in with PGAdmin 4, you will see the main page where you
have to set up a connection between the GUI tool and the Postgres server.
Click on the “Add New Server” icon on the main page. It will open a new
dialogue box asking you to fill two mandatory fields, such as “General” and
“Connection.”
12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment
https://hevodata.com/learn/docker-postgresql/ 10/15
Image Source: DEV Comminity
In the General tab, provide a name to uniquely identify the connection
between PostgreSQL and PGAdmin 4. Then, fill the Server group by
selecting the Server options from the drop-down menu.
Now, switch to the Connection tab under the same dialogue box and fill the
required fields.
Image Source: DEV Comminity
Before filling in the connection details, you have to execute the following
command to get the required information about connection settings.
docker inspect postgresql -f “{{json .NetworkSettings.Networks
}}”
12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment
https://hevodata.com/learn/docker-postgresql/ 11/15
The above-given command will display your connection details in JSON
format.
In the connection tab, you can fill in the Hostname/address details according
to the docker inspect command’s output.
Fill the port value as 5432 that runs the Docker PostgreSQL Container and
provide the name of the database as postgres. Then, fill the username and
password fields with the credentials you created while running the PGAdmin
container.
After providing all required details, click on the “Save” button.
Image Source: DEV Comminity
Now, your PGAdmin is connected to the Docker Postgres instance. You can see
the newly created instance in the left side panel that confirms that the
connection is successfully established between PGAdmin and Postgres.
In the PGAdmin dashboard, you can fully manage the PostgreSQL Instance that
runs on the Docker Container and completely manage Docker PostgreSQL
Environment. You can also query the PostgreSQL database by writing
commands using the “Query Tool” from the PGAdmin dashboard.
Using following the above-mentioned steps, you have successfully installed
and set up a Docker Postgres Instance on Docker.
Conclusion
In this article, you learned about Docker PostgreSQL Container, how to install,
set up, and run the Docker Postgres Instance on your Docker. Since this blog
mainly focused on managing Postgres instances using the web-based tool or
interface called PGAdmin, you have learned the GUI way of interacting with
Postgre instances on Docker. However, you can also use CLI (Command Line
12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment
https://hevodata.com/learn/docker-postgresql/ 12/15
Interface tools) to connect with the PSQL server for executing queries on
databases present in PostgreSQL.
If you would like to export data from a source of your choice like PostgreSQL
into your desired database/destination like a data warehouse, then Hevo Data
is the right choice for you!
VISIT OUR WEBSITE TO EXPLORE HEVO
Hevo Data provides its users with a simpler platform for integrating data from
100+ sources for Data Migration and Analysis. It is a No-code Data Pipeline
that can help you combine data from multiple sources. You can use it to
transfer data from multiple data sources such as PostgreSQL into your Data
Warehouses like Google BigQuery, Snowflake, Amazon Redshift, or Firebolt.
It provides you with a consistent and reliable solution to manage data in real-
time, ensuring that you always have an analysis-ready format in your desired
destination.
Want to take Hevo for a spin? SIGN UP for a 14-day free trial and experience
the feature-rich Hevo suite first hand. You can also have a look at the
unbeatable pricing that will help you choose the right plan for your business
needs.
Share your experience of learning about how to install and set up Docker
PostgreSQL environment! Let us know in the comments section below!
Getting Started with Hevo - An Overview
Getting Started with Hevo - An Overview
No-code Data Pipeline for your Data
Warehouse
TRY FOR FREE
12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment
https://hevodata.com/learn/docker-postgresql/ 13/15
Docker PostgreSQL Docker PostgreSQL Container
Continue Reading
Can Goktug Ozdem on Data Integration, Modern Data Stack
The Reign of Modern Data Stack: History, Components, and Use
Cases
Sanchit Agarwal on Azure Data Factory, Data Integration, Data Warehouse, Database
Management Systems, Microsoft Azure, Oracle, Synapse
Oracle to Azure 101: Integration Made Easy
12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment
https://hevodata.com/learn/docker-postgresql/ 14/15
Become a Contributor
You can contribute any number of in-depth posts on all things
data.
WRITE FOR HEVO
Bring Real-Time Data from Any
Source into your Warehouse
GET STARTED FOR FREE
Talk to a Product Expert
Your Work Email

PLATFORM
Product
Integrations
Pricing
Free Trial
Changelog
Upcoming Features
Status
CONCEPTS
ETL
Amazon Redshift
Google BigQuery
Snowflake
COMPARISON
GUIDES
ETL Tools
Data Pipeline Tools
Data Integration
Tools
Redshift vs
BigQuery
BigQuery vs
Snowflake
Snowflake vs
Redshift
TUTORIALS
Redshift ETL
BigQuery ETL
Snowflake ETL
Change Data
Capture
WRITE FOR HEVO
You can contribute any number of in-depth posts on all things data.
Know More
12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment
https://hevodata.com/learn/docker-postgresql/ 15/15
© Hevo Data Inc. 2022. All Rights Reserved.
 

More Related Content

Similar to 3 Easy Steps to Install Docker PostgreSQL Environment.pdf

HPC Cloud Burst Using Docker
HPC Cloud Burst Using DockerHPC Cloud Burst Using Docker
HPC Cloud Burst Using Docker
IRJET Journal
 
Devops interview questions 1 www.bigclasses.com
Devops interview questions  1  www.bigclasses.comDevops interview questions  1  www.bigclasses.com
Devops interview questions 1 www.bigclasses.com
bigclasses.com
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101
Naukri.com
 
Modern Travelling Sales Man- Solution through travel time interpolation
Modern Travelling Sales Man- Solution through travel time interpolationModern Travelling Sales Man- Solution through travel time interpolation
Modern Travelling Sales Man- Solution through travel time interpolation
Rahul Sahai
 
Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14
Simon Storm
 
Containerization
ContainerizationContainerization
Containerization
Suryadeep Chatterjee
 
Deploying Web Apps with PaaS and Docker Tools
Deploying Web Apps with PaaS and Docker ToolsDeploying Web Apps with PaaS and Docker Tools
Deploying Web Apps with PaaS and Docker Tools
Eddie Lau
 
Dockerization of Azure Platform
Dockerization of Azure PlatformDockerization of Azure Platform
Dockerization of Azure Platform
nirajrules
 
Docker DANS workshop
Docker DANS workshopDocker DANS workshop
Docker DANS workshop
vty
 
Deploying DC/OS on Premises with Juju
Deploying DC/OS on Premises with JujuDeploying DC/OS on Premises with Juju
Deploying DC/OS on Premises with Juju
Tom Barber
 
Stored-Procedures-Presentation
Stored-Procedures-PresentationStored-Procedures-Presentation
Stored-Procedures-PresentationChuck Walker
 
Why NBC Universal Migrated to MongoDB Atlas
Why NBC Universal Migrated to MongoDB AtlasWhy NBC Universal Migrated to MongoDB Atlas
Why NBC Universal Migrated to MongoDB Atlas
Datavail
 
Improving build solutions dependency management with webpack
Improving build solutions  dependency management with webpackImproving build solutions  dependency management with webpack
Improving build solutions dependency management with webpack
NodeXperts
 
Docker In Brief
Docker In BriefDocker In Brief
Docker In Brief
Ritu Kamthan
 
Common primitives in Docker environments
Common primitives in Docker environmentsCommon primitives in Docker environments
Common primitives in Docker environments
alexandru giurgiu
 
Accelerate your development with Docker
Accelerate your development with DockerAccelerate your development with Docker
Accelerate your development with Docker
Andrey Hristov
 
Accelerate your software development with Docker
Accelerate your software development with DockerAccelerate your software development with Docker
Accelerate your software development with Docker
Andrey Hristov
 
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdfNode.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
lubnayasminsebl
 
Docker primer and tips
Docker primer and tipsDocker primer and tips
Docker primer and tips
Samuel Chow
 
Azure from scratch part 3 By Girish Kalamati
Azure from scratch part 3 By Girish KalamatiAzure from scratch part 3 By Girish Kalamati
Azure from scratch part 3 By Girish Kalamati
Girish Kalamati
 

Similar to 3 Easy Steps to Install Docker PostgreSQL Environment.pdf (20)

HPC Cloud Burst Using Docker
HPC Cloud Burst Using DockerHPC Cloud Burst Using Docker
HPC Cloud Burst Using Docker
 
Devops interview questions 1 www.bigclasses.com
Devops interview questions  1  www.bigclasses.comDevops interview questions  1  www.bigclasses.com
Devops interview questions 1 www.bigclasses.com
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101
 
Modern Travelling Sales Man- Solution through travel time interpolation
Modern Travelling Sales Man- Solution through travel time interpolationModern Travelling Sales Man- Solution through travel time interpolation
Modern Travelling Sales Man- Solution through travel time interpolation
 
Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14
 
Containerization
ContainerizationContainerization
Containerization
 
Deploying Web Apps with PaaS and Docker Tools
Deploying Web Apps with PaaS and Docker ToolsDeploying Web Apps with PaaS and Docker Tools
Deploying Web Apps with PaaS and Docker Tools
 
Dockerization of Azure Platform
Dockerization of Azure PlatformDockerization of Azure Platform
Dockerization of Azure Platform
 
Docker DANS workshop
Docker DANS workshopDocker DANS workshop
Docker DANS workshop
 
Deploying DC/OS on Premises with Juju
Deploying DC/OS on Premises with JujuDeploying DC/OS on Premises with Juju
Deploying DC/OS on Premises with Juju
 
Stored-Procedures-Presentation
Stored-Procedures-PresentationStored-Procedures-Presentation
Stored-Procedures-Presentation
 
Why NBC Universal Migrated to MongoDB Atlas
Why NBC Universal Migrated to MongoDB AtlasWhy NBC Universal Migrated to MongoDB Atlas
Why NBC Universal Migrated to MongoDB Atlas
 
Improving build solutions dependency management with webpack
Improving build solutions  dependency management with webpackImproving build solutions  dependency management with webpack
Improving build solutions dependency management with webpack
 
Docker In Brief
Docker In BriefDocker In Brief
Docker In Brief
 
Common primitives in Docker environments
Common primitives in Docker environmentsCommon primitives in Docker environments
Common primitives in Docker environments
 
Accelerate your development with Docker
Accelerate your development with DockerAccelerate your development with Docker
Accelerate your development with Docker
 
Accelerate your software development with Docker
Accelerate your software development with DockerAccelerate your software development with Docker
Accelerate your software development with Docker
 
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdfNode.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
 
Docker primer and tips
Docker primer and tipsDocker primer and tips
Docker primer and tips
 
Azure from scratch part 3 By Girish Kalamati
Azure from scratch part 3 By Girish KalamatiAzure from scratch part 3 By Girish Kalamati
Azure from scratch part 3 By Girish Kalamati
 

Recently uploaded

Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
Kamal Acharya
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
Kamal Acharya
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
MuhammadTufail242431
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
Intella Parts
 

Recently uploaded (20)

Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
 

3 Easy Steps to Install Docker PostgreSQL Environment.pdf

  • 1. 12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment https://hevodata.com/learn/docker-postgresql/ 1/15 3 Easy Steps to Install Docker PostgreSQL Environment Ishwarya M on Data Integration, Database Management Systems • February 7th, 2022 • WRITE FOR HEVO One of the most important phases of the Software Development Life Cycle (SDLC) is Data Processing. This involves actions like Data Joining, Data Cleaning, Data Filtering, and more. Usually, developers use Database Management Applications like MySQL and PostgreSQL to implement Data Processing Operations. Besides, while developing such applications, developers work with several temporary software that get employed at different phases of their SDLC. To run different applications and processes, developers use Docker as a containerization platform. It omits the need to install and run applications in different environments. Developers can perform Data Processing Operations using any Database Management System (DBMS) like PostgreSQL by pulling in their respective Docker Image files from the Docker Hub. In this blog, you will learn about the process of setting up a Docker PostgreSQL environment. We’ll show how you can install, configure, and run PostgreSQL on Docker in 3 simple steps. Read on to get started. Table of Contents Prerequisites for Setting Up Docker PostgreSQL Environment What is PostgreSQL? What is Docker?
  • 2. 12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment https://hevodata.com/learn/docker-postgresql/ 2/15 3 Steps to Setup Docker PostgreSQL Environment Step 1: Download and Install Docker Step 2: Download Docker PostgreSQL Image Step 3: Install PGAdmin on Docker Conclusion Prerequisites for Setting Up Docker PostgreSQL Environment A fundamental understanding of Data Processing Operations and Database Management Systems (DBMS) like PostgreSQL. What is PostgreSQL? Image Source: PostgreSQL Developed in the late 1980s, PostgreSQL is an Open-Source Relational Database Management System (RDBMS) with more than 30 years of active development history. Although PostgreSQL has object-oriented features for handling unstructured data, it is widely used as a Relational Database. PostgreSQL supports both SQL and JSON to implement relational and non- relational queries on data present inside databases. In other words, with PostgreSQL, you can write SQL commands to process data present in tables that belong to the respective database servers. Because of its vast features and functionalities, PostgreSQL is reportedly ranked 4th among the most popular databases worldwide. In case, if your website or application uses lots of reading queries, we recommend you replicate your primary database (Master-Slave Replication). For more details, check out this blog piece here- How To Achieve PostgreSQL Master-Slave Replication?
  • 3. 12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment https://hevodata.com/learn/docker-postgresql/ 3/15 What is Docker? Image Source: Docker Developed by Solomon Hykes in 2013, Docker is an Open-Source software tool that allows you to quickly build, test, manage, and deploy applications. It carries multiple containers that comprise all executable packages and dependencies required to run an application. Docker Containers are built using Docker Images, a template that comprises all the parameters and instructions required to run a particular application. You can access different Docker Containers by signing up on an online cloud repository called Docker Hub. From the Docker Hub, you can easily pull or download pre-configured Docker Containers, like Docker PostgreSQL Container to execute specific applications based on your requirements. If you are a software developer, you can also upload and share your own applications in the form of Docker images that can be used by other Docker users to try and execute your application.  Simplify your Data Analysis with Hevo’s No-code Data Pipeline Hevo Data, a No-code Data Pipeline, helps load data from any Data Source such as Databases, SaaS applications, Cloud Storage, SDKs, and Streaming Services and simplifies the ETL process. It supports 100+ Data Sources including 40+ Free Sources. It is a 3-step process by just selecting the data source, providing valid credentials, and choosing the destination. Hevo loads the data onto the desired Data Warehouse/Destination like Google BigQuery, Snowflake, Amazon Redshift, and Firebolt and enriches the data transforming it into an analysis-ready form without having to write a single line of code.
  • 4. 12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment https://hevodata.com/learn/docker-postgresql/ 4/15 It’s a completely Automated Pipeline that offers data to be delivered in real-time without any loss from Source to Destination. Its fault-tolerant and scalable architecture ensure that the data is handled in a secure, consistent manner with zero data loss and supports different forms of data. The solutions provided are consistent and work with different BI Tools as well. GET STARTED WITH HEVO FOR FREE Check out why Hevo is the best: Minimal Learning: Hevo, with its simple and interactive UI, is extremely simple for new customers to work on and perform operations. Hevo Is Built To Scale: As the number of sources and the volume of your data grows, Hevo scales horizontally, handling millions of records per minute with very little latency. Secure: Hevo has a fault-tolerant architecture that ensures that the data is handled securely and consistently with zero data loss. Schema Management: Hevo takes away the tedious task of schema management & automatically detects the schema of incoming data and maps it to the destination schema. Incremental Data Load: Hevo allows the transfer of data that has been modified in real-time. This ensures efficient utilization of bandwidth on both ends. Live Support: Our team is available round the clock to extend exceptional support to its customers through Chat, Email, and Support Calls. Live Monitoring: Hevo allows you to monitor the data flow and check where your data is at a particular point in time. SIGN UP HERE FOR A 14-DAY FREE TRIAL! 3 Steps to Setup Docker PostgreSQL Environment In the sections below, we show you a step-by-step process to install, set up, and run Docker PostgreSQL Environment. Step 1: Download and Install Docker
  • 5. 12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment https://hevodata.com/learn/docker-postgresql/ 5/15 Image Source: Self Before starting the application setup process for Docker PostgreSQL Environment, you are required to download and install Docker on your local machine. To download the application, visit the official website of Docker. On the welcome page of the Docker website, click on the “Get-Started” option. You will be redirected to the download page, where you can download the Docker version according to your operating system specifications. Select the preferred option to start the downloading process. After the Docker setup file is downloaded, install it on your local machine by following the installation steps. Image Source: Self Next, you can sign in on Docker Hub, from where you can access the Docker Image files. This will be used to run external applications like PostgreSQL. Step 2: Download Docker PostgreSQL Image There are two different ways to download Docker PostgreSQL Image that allows you to set up PostgreSQL on Docker. One is by directly accessing it from the Docker Hub’s website. The other method is by pulling the Docker PostgreSQL Image from default Command Line Interface (CLI) tools like Command Prompt or Power Shell. If you are opting for method one: To download Docker PostgreSQL Image, visit Docker Hub using your previously created user account.
  • 6. 12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment https://hevodata.com/learn/docker-postgresql/ 6/15 On the welcome page, you can find a search bar at the top. Type “PostgreSQL” to get the Docker Image of the respective application. You can find various Docker Images related to the PostgreSQL database. On clicking on the appropriate file, you will be redirected to a new page where you can find the command used to access the Docker Image file. Copy and make a note of the respective command. Run this into your Command Prompt to install the PostgreSQL instance. Another way to pull Docker PostgreSQL Image is by accessing it using the Command Prompt instead of reaching its website. To do so, follow these steps: Open a new command window, and run the command given below. docker pull postgres To obtain the list of existing Docker Images, run the following command. docker images In the next step, you can enter the command you copied from the Docker Hub in the Command Prompt. docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres The above-given command should be customized and added with the necessary parameters to work properly for setting up PostgreSQL on Docker. docker run --name postgresql -e POSTGRES_USER=myusername -e POSTGRES_PASSWORD=mypassword -p 5432:5432 -v /data:/var/lib/postgresql/data -d postgres In the command given above, PostgreSQL is the name of the Docker Container. -e POSTGRES_USER is the parameter that sets a unique username to the Postgres database.
  • 7. 12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment https://hevodata.com/learn/docker-postgresql/ 7/15 -e POSTGRES_PASSWORD is the parameter that allows you to set the password of the Postgres database. -p 5432:5432 is the parameter that establishes a connection between the Host Port and Docker Container Port. In this case, both ports are given as 5432, which indicates requests sent to the Host Ports will automatically redirect to the Docker Container Port. In addition, 5432 is also the same port where PostgreSQL will be accepting requests from the client. -v is the parameter that synchronizes the Postgres data with the local folder. This ensures that Postgres data will be safely present within the Home Directory even if the Docker Container is terminated. -d is the parameter that runs the Docker Container in the detached mode, i.e., in the background. If you accidentally close or terminate the Command Prompt, the Docker Container will still run in the background. postgres is the name of the Docker image that was previously downloaded to run the Docker Container. Now, execute docker ps -a to check the status of the newly created PostgreSQL container. Image Source: DEV Comminity On executing the command, you get the output, as shown in the above image. It shows that Docker Container is running successfully on port 5432. You can start and stop the newly created Docker Container by running the following commands. For starting the Docker Container: docker start postgresqldb For stopping the Docker Container: docker stop postgresqldb There you have it. You have now successfully created a Docker Container running the PostgreSQL Environment.
  • 8. 12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment https://hevodata.com/learn/docker-postgresql/ 8/15 Step 3: Install PGAdmin on Docker At this stage of setting up the Docker PostgreSQL Environment, your PostgreSQL is active and running on the respective ports. Now, you have to install the PGAdmin, a web-based GUI tool used to manage PostgreSQL databases and services. You can install PGAdmin to check whether your Docker Containers are working fine and execute SQL queries on databases present in PostgreSQL. To download PGADmin, perform these steps: Visit Docker Hub and search for PgAdmin. You can find various Docker Images to run PGAdmin. Select the appropriate one and copy the Docker pull command (Follow this link to get the “Docker pull” command, which pulls the PGAdmin4 version. You can also get the respective PGAdmin versions according to your preferences). Execute the pull command to start PGAdmin. docker pull dpage/pgadmin4:latest After downloading the image, run the container by executing the command given below. docker run --name my-pgadmin -p 82:80 -e 'PGADMIN_DEFAULT_EMAIL=user@domain.local' -e 'PGADMIN_DEFAULT_PASSWORD=postgresmaster'-d dpage/pgadmin4 In the above-given command, my-pgadmin is the name of the Docker PostgreSQL PGAdmin Container. PGADMIN_DEFAULT_EMAIL and PGADMIN_DEFAULT_PASSWORD are the username and password for the Docker PostgreSQL container, respectively. Following this, open your browser and search for the web address http://localhost:8081/. It will redirect you to the welcome page of the PGAdmin 4 Web Instance.
  • 9. 12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment https://hevodata.com/learn/docker-postgresql/ 9/15 Image Source: DEV Comminity On the welcome page, it will ask you to enter the username and password of PGAdmin 4. Enter the credentials you defined while running the Docker Container of PGAdmin. Image Source: DEV Comminity Upon logging in with PGAdmin 4, you will see the main page where you have to set up a connection between the GUI tool and the Postgres server. Click on the “Add New Server” icon on the main page. It will open a new dialogue box asking you to fill two mandatory fields, such as “General” and “Connection.”
  • 10. 12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment https://hevodata.com/learn/docker-postgresql/ 10/15 Image Source: DEV Comminity In the General tab, provide a name to uniquely identify the connection between PostgreSQL and PGAdmin 4. Then, fill the Server group by selecting the Server options from the drop-down menu. Now, switch to the Connection tab under the same dialogue box and fill the required fields. Image Source: DEV Comminity Before filling in the connection details, you have to execute the following command to get the required information about connection settings. docker inspect postgresql -f “{{json .NetworkSettings.Networks }}”
  • 11. 12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment https://hevodata.com/learn/docker-postgresql/ 11/15 The above-given command will display your connection details in JSON format. In the connection tab, you can fill in the Hostname/address details according to the docker inspect command’s output. Fill the port value as 5432 that runs the Docker PostgreSQL Container and provide the name of the database as postgres. Then, fill the username and password fields with the credentials you created while running the PGAdmin container. After providing all required details, click on the “Save” button. Image Source: DEV Comminity Now, your PGAdmin is connected to the Docker Postgres instance. You can see the newly created instance in the left side panel that confirms that the connection is successfully established between PGAdmin and Postgres. In the PGAdmin dashboard, you can fully manage the PostgreSQL Instance that runs on the Docker Container and completely manage Docker PostgreSQL Environment. You can also query the PostgreSQL database by writing commands using the “Query Tool” from the PGAdmin dashboard. Using following the above-mentioned steps, you have successfully installed and set up a Docker Postgres Instance on Docker. Conclusion In this article, you learned about Docker PostgreSQL Container, how to install, set up, and run the Docker Postgres Instance on your Docker. Since this blog mainly focused on managing Postgres instances using the web-based tool or interface called PGAdmin, you have learned the GUI way of interacting with Postgre instances on Docker. However, you can also use CLI (Command Line
  • 12. 12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment https://hevodata.com/learn/docker-postgresql/ 12/15 Interface tools) to connect with the PSQL server for executing queries on databases present in PostgreSQL. If you would like to export data from a source of your choice like PostgreSQL into your desired database/destination like a data warehouse, then Hevo Data is the right choice for you! VISIT OUR WEBSITE TO EXPLORE HEVO Hevo Data provides its users with a simpler platform for integrating data from 100+ sources for Data Migration and Analysis. It is a No-code Data Pipeline that can help you combine data from multiple sources. You can use it to transfer data from multiple data sources such as PostgreSQL into your Data Warehouses like Google BigQuery, Snowflake, Amazon Redshift, or Firebolt. It provides you with a consistent and reliable solution to manage data in real- time, ensuring that you always have an analysis-ready format in your desired destination. Want to take Hevo for a spin? SIGN UP for a 14-day free trial and experience the feature-rich Hevo suite first hand. You can also have a look at the unbeatable pricing that will help you choose the right plan for your business needs. Share your experience of learning about how to install and set up Docker PostgreSQL environment! Let us know in the comments section below! Getting Started with Hevo - An Overview Getting Started with Hevo - An Overview No-code Data Pipeline for your Data Warehouse TRY FOR FREE
  • 13. 12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment https://hevodata.com/learn/docker-postgresql/ 13/15 Docker PostgreSQL Docker PostgreSQL Container Continue Reading Can Goktug Ozdem on Data Integration, Modern Data Stack The Reign of Modern Data Stack: History, Components, and Use Cases Sanchit Agarwal on Azure Data Factory, Data Integration, Data Warehouse, Database Management Systems, Microsoft Azure, Oracle, Synapse Oracle to Azure 101: Integration Made Easy
  • 14. 12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment https://hevodata.com/learn/docker-postgresql/ 14/15 Become a Contributor You can contribute any number of in-depth posts on all things data. WRITE FOR HEVO Bring Real-Time Data from Any Source into your Warehouse GET STARTED FOR FREE Talk to a Product Expert Your Work Email  PLATFORM Product Integrations Pricing Free Trial Changelog Upcoming Features Status CONCEPTS ETL Amazon Redshift Google BigQuery Snowflake COMPARISON GUIDES ETL Tools Data Pipeline Tools Data Integration Tools Redshift vs BigQuery BigQuery vs Snowflake Snowflake vs Redshift TUTORIALS Redshift ETL BigQuery ETL Snowflake ETL Change Data Capture WRITE FOR HEVO You can contribute any number of in-depth posts on all things data. Know More
  • 15. 12/9/22, 19:06 3 Easy Steps to Install Docker PostgreSQL Environment https://hevodata.com/learn/docker-postgresql/ 15/15 © Hevo Data Inc. 2022. All Rights Reserved.  