• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
sharadchhetri

sharadchhetri

AI, Linux, Cloud and DevOps

  • Home
  • Resources
    • Learn Linux
    • Articles
  • My Projects & Work
    • My Nagios Plugin
    • My Dockerhub Repo
    • My WordPress plugins
    • My Github Repos
  • Facebook Page
  • Contact
  • Privacy Policy
  • About Me
You are here: Home / Articles / Install postgresql 9.4 on Ubuntu 14.04 LTS server

Install postgresql 9.4 on Ubuntu 14.04 LTS server

July 14, 2015 by Sharad Chhetri Leave a Comment

PostgreSQL is an object-relational database system (ORDBMS). It is free and its source code is available. Many volunteers, individuals and companies are contributing to develop the postgresql , the group is often addressed as PostgreSQL Global Development Group . PostgreSQL is cross platform means it can be run on many Linux/Unix based Operating System, Windows etc. If you are getting problem in pronouncing PostgreSQL, you can also call it as Postgres.

Details Of Lab
Operating System: Ubuntu 14.04 LTS Server
Arch: x86_64
PostgreSQL version: 9.4 (Stable release) [Always recommend to install latest, find from postgres official website.]

Let’s start installing the Postgres on Ubuntu 14.04 LTS Server.

Create apt repo file for postgres

Create new apt repo file for postgres. Generally we use vi editor , you can use your favorite file editor.

sudo vi /etc/apt/sources.list.d/pgdg.list

Paste the below given lines in /etc/apt/sources.list.d/pgdg.list file then save and close.

deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main

Import repository signing key and update packages list

To import the repository signing key and update packages, run the following command.

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

Install Postgres

Now run below given command to install postgres 9.4 version on Ubuntu 14.04 LTS Server.

sudo apt-get install postgresql-9.4

Start/stop/restart/status of Postgres

It is important to know how to start,stop,restart postgres and check its running status. The given below commands will help you to do so.

To start postgres service

sudo service postgresql start

To stop postgres service

sudo service postgresql stop

To restart postgres service

sudo service postgresql restart

To check status of postgres service

sudo service postgresql status

How to login into postgresql

This is quite tricky one. To login into postgresql server through command line first login as system user called postgres. Once you switch to postgres system user run the command psql and you will be in. (Because it is fresh installation, password is not set)

Note: After installing postgreSQL, the system user postgres is also get created.

Follow the below given command –

## Switch to system user called postgres
sudo su - postgres

Now you are switched to postgres system user. Run below command to login into PostgreSQL server console .

psql

To exit from postgres server console, type q and hit enter .

See below given screenshot for clear understanding.

postgres

Learn in next post about, how to set postgres password on PostgreSQL .

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook
  • More
  • Print (Opens in new window) Print
  • Email a link to a friend (Opens in new window) Email
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Reddit (Opens in new window) Reddit
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on Telegram (Opens in new window) Telegram
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Mastodon (Opens in new window) Mastodon

Articles

Show running process in postgresql
How To Install Nginx On Ubuntu 22.04 LTS
Install MariaDB Server 10 on CentOS 7 and RHEL 7 by using yum
postgres database backup script using database user password inside
How To Solve Forgot MySQL / MariaDB Root Password
Installation of OpenERP 7.0 in Ubuntu
Managing Jenkins plugins : command and GUI
Install Nginx from source code on Ubuntu 14.04 LTS
How to set user postgres password in postgresql 9.1
How to enable logging in Postgresql 9.2 and 9.1
How to run and configure Jenkins in Docker container
Set postgres password on PostgreSQL 9.4
How to install Nagios 4 from source on Ubuntu 14.04 LTS
How to install nginx webserver from source on CentOS and RHEL
Install and compile Nginx on Ubuntu 18.04 LTS server

Filed Under: Articles Tagged With: postgres

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Articles

  • Install n8n docker in Ubuntu for practicing
  • Bash Script: MySQL Database backup to AWS S3
  • Automate no touch Jenkins setup wizard on docker (jcac)
  • How to run and configure Jenkins in Docker container
  • Complete Guide: How to install Nagios Monitoring on AlmaLinux / Rocky Linux
  • Install KVM on Ubuntu 24.04 LTS ( Bash Script )
  • How to install GIMP 2.10 on Ubuntu / Debian
  • 5 ways to check Ubuntu version of system (commands and GUI)
  • How To Solve Forgot MySQL / MariaDB Root Password
  • Create Self Hosted Build Agent Docker Image for Azure DevOps

Copyright © 2026 ยท
The material in this site cannot be republished either online or offline, without our permission.
Proudly Blogging From India.

  • Contact
  • About Me
  • My WordPress plugins
  • Privacy Policy