aster.cloud aster.cloud
  • /
  • Platforms
    • Public Cloud
    • On-Premise
    • Hybrid Cloud
    • Data
  • Architecture
    • Design
    • Solutions
    • Enterprise
  • Engineering
    • Automation
    • Software Engineering
    • Project Management
    • DevOps
  • Programming
  • Tools
  • About
aster.cloud aster.cloud
  • /
  • Platforms
    • Public Cloud
    • On-Premise
    • Hybrid Cloud
    • Data
  • Architecture
    • Design
    • Solutions
    • Enterprise
  • Engineering
    • Automation
    • Software Engineering
    • Project Management
    • DevOps
  • Programming
  • Tools
  • About
  • Data
  • Programming

How To Install And Configure PostgreSQL In Ubuntu

  • root
  • July 16, 2019
  • 1 minute read

Overview

This guide contains instructions on how to install and do basic configuration of a PostgreSQL  database.

 

Prerequisites

  • Operating System : Ubuntu 18.04
  • Access to a Terminal or Shell Console

 

Install

01: Open a terminal window

 

02: Update the package repository list

$ sudo apt update

 

03: Install PostgreSQL via APT package manager. Enter y when asked to confirm.

$ sudo apt install postgresql postgresql-contrib

 

04: Change to the postgres user account.

$ sudo -i -u postgres

 

05: Access the psql shell

$ psql

 

06: Verify that installed correctly by showing the built-in PostgreSQL system tables.

postgres=# SELECT * FROM pg_catalog.pg_tables;

 

Press q to exit from the listing of sql tables.

 

07: Exit from the psql session

# Exit from psql

postgres=# \q

# Exit from postgres user

[email protected]: ~$ exit

 

Accept database connection from anywhere

WARNING: Use only in development environment, this poses a security concern when applied in a production environment. 

01: Edit the postgre config located at

/etc/postgresql/<sql-version>/main/postgresql.conf

At the time of this writing the stable version of PostgreSQL is 10.

# FORMAT

$ sudo nano /etc/postgresql/<b>{sql-version}</b>/main/postgresql.conf

# SAMPLE

$ sudo nano /etc/postgresql/<b>10</b>/main/postgresql.conf


localhost
is the default value, which means it can only be accessed locally from the server. And not remotely.

 

02: Set to asterisk, *, to make it accessible anywhere, then save the changes.

 

03: Restart the PostgreSQL service to apply the changes in config.

$ sudo service postgresql restart

Read More  Migrate Your Most Demanding Enterprise PostgreSQL Databases To AlloyDB For PostgreSQL With Database Migration Service
root

Related Topics
  • Database
  • How To
  • Installation
  • PostgreSQL
  • RDB
  • Ubuntu
You May Also Like
View Post
  • Big Data
  • Data

The Benefits And Core Processes Of Data Wrangling

  • March 17, 2023
mobile-laptop-developer-christina-wocintechchat-com-UTw3j_aoIKM-unsplash
View Post
  • Data
  • Software
  • Solutions

Build Customer Trust Through Secure Front End App Development & Cyber Security

  • March 14, 2023
View Post
  • Automation
  • Programming

Learn Expect By Writing And Automating A Simple Game

  • March 14, 2023
View Post
  • Data
  • Engineering

Sentiment Analysis With BigQuery ML

  • March 13, 2023
View Post
  • Data
  • Engineering

Rapidly Expand The Reach Of Spanner Databases With Read-Only Replicas And Zero-Downtime Moves

  • March 12, 2023
View Post
  • Data
  • Engineering

Shorten The Path To Insights With Aiven For Apache Kafka And Google BigQuery

  • March 9, 2023
View Post
  • Computing
  • Data

Snowflake’s Telecom Data Cloud Bets On Accelerating Cloud Efficiency

  • March 3, 2023
View Post
  • Data
  • Engineering

10 Free Resources To Become A Health Data Scientist

  • March 1, 2023

Stay Connected!
LATEST
  • 1
    Monitor Kubernetes Cloud Costs With Open Source Tools
    • March 20, 2023
  • 2
    What Is An Edge-Native Application?
    • March 20, 2023
  • 3
    Eclipse Java Downloads Skyrocket
    • March 19, 2023
  • 4
    How To Use Bash
    • March 17, 2023
  • 5
    Why Is Your Multicloud So Slow?
    • March 17, 2023
  • 6
    The Benefits And Core Processes Of Data Wrangling
    • March 17, 2023
  • 7
    We Cannot Even Agree On Dates…
    • March 16, 2023
  • 8
    Financial Crisis: It’s A Game & We’re All Being Played
    • March 16, 2023
  • 9
    Ballerina: A Programming Language For The Cloud
    • March 16, 2023
  • 10
    Own Your Cloud With NextcloudPi On The Raspberry Pi
    • March 16, 2023
about
Hello World!

We are aster.cloud. We’re created by programmers for programmers.

Our site aims to provide guides, programming tips, reviews, and interesting materials for tech people and those who want to learn in general.

We would like to hear from you.

If you have any feedback, enquiries, or sponsorship request, kindly reach out to us at:

[email protected]
Most Popular
  • 1
    Oxford Quantum Circuits Installing Quantum Computer in Equinix IBX® Data Center With Plans To Open Access to Businesses Globally
    • March 14, 2023
  • 2
    The Adoptium Working Group Reports Significant Momentum for Open Source Java in 2023
    • March 14, 2023
  • 3
    Cloudflare Integrates With Atlassian, Microsoft, And Sumo Logic To Make Zero Trust Security Easy For Businesses
    • March 14, 2023
  • 4
    Cloudflare Uses The Power Of Its Global Network To Identify The Top 50 Most Impersonated Brands And Protect Zero Trust Customers From Phishing Scams
    • March 13, 2023
  • 5
    Open Source Software Leader The Eclipse Foundation Previews Its Showcase At Embedded World 2023
    • March 8, 2023
  • /
  • Platforms
  • Architecture
  • Engineering
  • Programming
  • Tools
  • About

Input your search keywords and press Enter.