Customize Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

No cookies to display.

Empowering you to understand your world

PostgreSQL Tutorials: How To Install PostgreSQL On Linux

By Nicholas Brown.

You can install PostgreSQL on Linux using multiple methods, including compiling it from source, using your Linux distribution’s built-in package manager (Ubuntu/Debian’s Aptitude, Gentoo’s Ebuild, or Fedora/RedHat’s RPM), or you can use PostgreSQL’s official repository with your operating system’s built-in package manager.

How To Install PostgreSQL From The Ubuntu Repository

You can install PostgreSQL using only one command if you are using the built-in Ubuntu repository as shown below:

sudo apt install postgresql

How To Install PostgreSQL From PostgreSQL’s Repository

If you’re willing to type a few extra commands, i’d recommend the official PostgreSQL repository because it will get the latest version before the built-in repositories will:

The following commands will set up PostgreSQL’s official repository. Note that the ‘-y‘ command after ‘apt-get’ will install it without confirmation and you can remove that if you wish.

PostgreSQL Tutorial: How To Create A User In PostgreSQL

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

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

sudo apt-get update
sudo apt-get -y install postgresql

 

Subscribe to our newsletter
Get notified when new content is published