Install PostgreSQL 10 on Debian/Ubuntu servers

Published on Oct. 5, 2017 by Gabriel Bordeaux

Introduction

PostgreSQL 10 was released on 05/10/2017.

Install PostgreSQL 10

Install PostgreSQL 10 step by step

Add the PostgreSQL repository to your sources

echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list

Import the repository signing key

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
apt-key add -

Install PostgreSQL 10

apt-get update
apt-get -y install postgresql-10

Connection to PostgreSQL

su postgres
postgres@debian:/root$ psql
postgres=# SELECT version();
                                         version
-----------------------------------------------------------------------------------------
 PostgreSQL 10.0 on x86_64-pc-linux-gnu, compiled by gcc (Debian 4.9.2-10) 4.9.2, 64-bit
(1 row)