Run PostgreSQL in docker and recommend several connection tools


1 Preface

 PostgreSQL is a free software object relational database management system (ORDBMS) with complete characteristics. It is an object relational database management system based on Postgres version 4.2 developed by the computer department of the University of California. Many of the leading concepts of Postgres appeared in the commercial website database only later. PostgreSQL supports most SQL standards and provides many other modern features, such as complex queries, foreign keys, triggers, views, transaction integrity, multi version concurrency control, etc. Similarly, PostgreSQL can be extended in many ways, such as by adding new data types, functions, operators, aggregation functions, index methods, process languages, etc. In addition, because of the flexible license, anyone can use, modify and distribute PostgreSQL for free for any purpose.

PostgreSQL is an excellent open source relational database, which is adopted by more and more projects. Starting through docker is very convenient in the development and testing environment. One command is enough. In the face of the need for multiple environments, there is no need to worry. At the same time, some clients are introduced.

2. Docker startup

First pull the image. Select version 10 here. For more versions, please check【Postgres Docker】。

docker pull postgres:10

Start an instance with the following command:

docker run -itd \
    --name pkslow-postgres \
    -e POSTGRES_DB=pkslow \
    -e POSTGRES_USER=pkslow \
    -e POSTGRES_PASSWORD=pkslow \
    -e PGDATA=/var/lib/postgresql/data/pgdata \
    -v /custom/mount:/var/lib/postgresql/data \
    -p 5432:5432 \

3 client connection

There are many excellent clients. Here are some free ones.

DBeaverIt supports a variety of databases, such as PostgreSQL / MySQL / DB2 / Oracle, MAC / win / Linux and Chinese.

pgAdminWeb based client tools.

PSequelIt is a PostgreSQL client tool on the MAC side.

PosticoIt is also a Mac client tool.

4 Summary

With so many clients, I end up with dbeaver, or use idea or DataGrid to connect. In addition,SQLProYes, but it’s a pity that it’s expensive.

This is the end of this article about running PostgreSQL in docker and recommending several connection tools. For more information about docker starting PostgreSQL, please search the previous articles of developeppaer or continue to browse the relevant articles below. I hope you will support developeppaer in the future!