---
title: "How to get PostgreSQL on a VPS / Dedicated Server"
description: "In this guide, we will show you how to install PostgreSQL on a VPS or Dedicated server. PostgreSQL is a free open-source object-relational database management system, and one of the most popular..."
url: https://www.inmotionhosting.com/support/server/databases/install-setup/
date: 2014-03-27
modified: 2026-06-05
author: "InMotion Hosting Contributor"
categories: ["Working with Databases"]
type: post
lang: en
---

# How to get PostgreSQL on a VPS / Dedicated Server

In this guide, we will show you how to install **PostgreSQL** on a [VPS](https://www.inmotionhosting.com/vps-hosting) or [Dedicated server](https://www.inmotionhosting.com/dedicated-servers). PostgreSQL is a free open-source object-relational database management system, and one of the most popular alternatives to MySQL.

The reasons for its popularity include a long list of features like:

- Multi-version concurrency control
- Point in time recovery
- Tablespaces
- Asynchronous replication
- Savepoints
- Nested transactions
- Query planner/optimizer
- Write ahead logging for fault tolerance

There is also support for international character sets, multibyte character encodings, and Unicode. With locale-aware sorting, case sensitivity, and formatting – Postgres is an excellent alternate to MySQL.

After it is installed, we will show you how to configure Postgres; which will add phpPgAdmin to cPanel. By using phpPgAdmin, you can easily access and modify the tables in your PostgreSQL database.

**In this Guide:**

- [Installing PostgreSQL via SSH](#install)
- [Configuring Postgres](#configure)

You must have [root access](https://www.inmotionhosting.com/support/amp/obtain-root-access/) to your server to complete this guide! **PostgreSQL**, and **phpPgAdmin** are already installed on all shared servers.

## Installing PostgreSQL via SSH

1. [SSH](https://www.inmotionhosting.com/support/server/ssh/how-to-login-ssh/) into your server as the **root** user.
2. Run the following command:/scripts/installpostgres
3. You will then see a message similar to this:“This script will install PostgreSQL 7.4.x or later If you have an older version installed you will need to Dump your databases to a file and then restore them after the install as 7.4.x is not backwards compatible. If you do not have any databases, you can just run: mv /var/lib/pgsql /var/lib/pgsql.old /sbin/service postgresql stop /sbin/service postgresql start to force creating a 7.4.x style setup. Do not do this if you have databases that you wish to keep! Are you sure you wish to proceed?“
4. Type **y** then hit enter, to kick off the installation.![Installing PostgreSQL via Command Line](https://www.inmotionhosting.com/support/wp-content/uploads/2014/03/postgresql_install-postgresql-script.png)The process is complete when you can type in the command prompt again.

### Submit a Ticket Request

If you need assistance installing **PostgreSQL**, or want to install a different version of PostgreSQL, please contact our [InMotion Solutions](https://www.inmotionhosting.com/solutions/inmotion-solutions) team.

- [Submitting a Ticket Request](https://www.inmotionhosting.com/support/amp/submitting-and-checking-on-status-of-tickets/)

## Configuring Postgres

We will now show you how to configure Postgres. You will then be able to access phpPgAdmin in cPanel. This is a 2-step process.

### Step 1: Get phpPgAdmin

1. [Login to WHM](https://www.inmotionhosting.com/support/edu/whm/log-into-whm/) as the **root** user.
2. Click the **Configure Postgres** link in the *SQL Services* section.![Configuring Postgres in WHM](https://www.inmotionhosting.com/support/wp-content/uploads/2014/03/postgresql_configure-postres.png)
3. Click the **Install Config** button in the *Postgres Config Install* section.![Installing Postgres Config](https://www.inmotionhosting.com/support/wp-content/uploads/2014/03/postgresql_postgres-config-install.png)
4. A box will pop up and ask, “*Are you SURE you want to overwrite your current config file?*” Click the **OK** button.![Overwriting Postgres Config Settings](https://www.inmotionhosting.com/support/wp-content/uploads/2014/03/postgresql_overwrite-config.png)It is finished when you see a message stating “*ALTER ROLE Configuration successfully updated*“

### Step 2: Creating Postgres Users

In this second step, you will now create the Postgres Users in *WHM*. This and all steps in this tutorial are required to use PostgreSQL in *cPanel*.

1. Log in to WHM as **root**.
2. Click the **Configure Postgres** link in the *SQL Services* section.![Configuring Postgres in WHM](https://www.inmotionhosting.com/support/wp-content/uploads/2014/03/postgresql_configure-postres.png)
3. Click the **Create Users** button in the *Create Postgres Users* section.![Creating PostgreSQL Users](https://www.inmotionhosting.com/support/wp-content/uploads/2014/03/postgresql_create-postgres-users.png)You are finished when you see a message stating “*PostgreSQL users created*“

Congratulations, now you know how to install and configure PostgreSQL on your VPS or Dedicated server! Learn more about [PostgreSQL Hosting](https://www.inmotionhosting.com/postgresql-hosting)

**Dedicated Servers, Your Way**

Let InMotion handle security, updates, and optimization with Premier Care, or take full control with self-managed bare metal.

[Explore Dedicated Servers](https://www.inmotionhosting.com/dedicated-servers?mktgp=t&irgwc=1&affiliates=5001860&utm_campaign=Jumbotron&utm_source=supportcenter&utm_medium=cta&utm_term=dedi-cta1)
