How VPS - How to use/setup VPS
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System Arch

How To Install PostgreSQL 11.1 On Arch Linux

How VPS by How VPS
August 8, 2019
in Arch, Uncategorized
0
0
SHARES
47
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Prerequisites
  2. Install PostgreSQL 11.1 Database
  3. Consider a Firewall
  4. Prepare for Upgrades
    1. Handle Minor Version Upgrades
    2. Handle Major Version Upgrades
  5. Want to contribute?


Prerequisites

  • A Vultr server running up to date Arch Linux (see this article.)
  • Sudo access.
    • Commands required to be ran as root are prefixed by #, and ones that can be ran as a regular user by $. The recommended way to run commands as root is to, as a regular user, prefix each of them with sudo.

Install PostgreSQL 11.1 Database

Install PostgreSQL:

# pacman -S postgresql

If you run the Btrfs filesystem, you should consider disabling copy-on-write for the database directory:

# chattr +C /var/lib/postgres/data/

This package creates the user postgres on your system.

Initialize the database cluster. This must be done by the new postgres user, and this command will do this as long as your user account is setup with sudo privileges:

$ sudo -iu postgres initdb -D /var/lib/postgres/data

Start PostgreSQL, and make it start after every boot:

# systemctl enable --now postgresql

Connect to PostgreSQL, as database user postgres which acts as the database root user:

# psql -U postgres

Then set a password:

postgres-# /password postgres

Now quit:

postgres-# /q

Consider a Firewall

You may want to consider configuring a firewall. By default, PostgreSQL will listen on port 5432 not only from localhost, but also from anywhere on your public IP address. PostgreSQL will also only approve incoming connections from localhost, but external attempts will still reach PostgreSQL and get the following error: no pg_hba.conf entry for host.

Although PostgreSQL is considered quite secure, it’s more secure to have a firewall not even give external packets to the PostgreSQL server, unless absolutely necessary. Even if direct remote access is desired, using a firewall to block the traffic and using a VPN would be more secure.

Prepare for Upgrades

By default, pacman will upgrade PostgreSQL when new versions are released to the official Arch repositories, when you upgrade your entire Arch system by running the following command:

# pacman -Syu

It is strongly recommended to configure pacman to not automatically install upgrades to PostgreSQL. When an upgrade is released and you upgrade your entire Arch system, pacman will let you know a new version is available. Edit /etc/pacman.conf, and add the following:

IgnorePkg   = postgresql*

Handle Minor Version Upgrades

When pacman shows you there is a minor version upgrade, such as 11.0 to 11.1, PostgreSQL’s versioning policy is that you can safely perform the upgrade. That said, it is a good idea to backup your database first.

To perform a minor upgrade, stop PostgreSQL and confirm it is stopped:

# systemctl stop postgresql
# systemctl status postgresql

Then, force upgrading the packages:

# pacman -S postgresql postgresql-libs

Start PostgreSQL:

# systemctl start postgresql

Handle Major Version Upgrades

When pacman shows there is a major version upgrade, such as 11.x to 12.x, it’s recommended to check PostgreSQL’s website, as well as Arch’s website, to see if there are steps you must perform to properly upgrade. In the past, when PostgreSQL has given such steps, skipping them prevented databases from working. It’ is highly recommended that you backup your database first, as these upgrades are more risky.

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article
How VPS

How VPS

Related Posts

Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers
Uncategorized

Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

February 17, 2020
Install Arch Linux With Btrfs Snapshotting
Uncategorized

Install Arch Linux With Btrfs Snapshotting

February 13, 2020
Arch

Setup Mumble Server on Arch Linux

February 13, 2020
Next Post

How to Install PHP 7.3 on an Arch Linux Webserver

How to Install Perl 5.28 on an Arch Linux Webserver

How To Install Python 3.7 On An Arch Linux Webserver

Leave a Reply Cancel reply

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

Follow Us

  • 121 Followers
  • 87.2k Followers

Recommended

How to Install Harbor on CentOS 7

3 years ago

Understanding APT, APT-Cache and Their Frequently Used Commands

4 years ago

Deploy a Meteor Application on Ubuntu

3 years ago

How to Repair and Defragment Linux System Partitions and Directories

4 years ago

Instagram

    Please install/update and activate JNews Instagram plugin.

Categories

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel

Topics

Apache Web Server Bluehost Review 2019 Bluehost Review 2020 Bluehost Review 2021 Centmin Mod CentminMod centos install htop fsck htop install HTTP DoS attack Install Snort on an Ubuntu install Zabbix on CentOS install Zabbix on CentOS 7 Linux Commands linux guide linux install htop linux vps setup guide MariaDB MariaDB Error Mysql mysqld error optimize MariaDB optimize Mysql snort Ubuntu
No Result
View All Result

Highlights

Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

Webmin Reviews

Virtualmin Reviews

CentOS Web Panel Reviews

Ajenti Reviews

ISPConfig Reviews

Trending

Failed to download metadata for repo 'appstream' on Centos 8
CentOS

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

by How VPS
February 25, 2022
0

I tried to update some extensions by use yum on centOs which I specified in Dockerfile. After...

How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020
Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

February 17, 2020
Webmin Reviews

Webmin Reviews

February 17, 2020
How VPS – How to use/setup VPS

We bring you the best Premium WordPress Themes that perfect for news, magazine, personal blog, etc. Visit our landing page to see all features & demos.
LEARN MORE »

Recent News

  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8 February 25, 2022
  • How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”? November 17, 2020
  • How to optimize Mysql or MariaDB November 3, 2020

Categories

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel

[mc4wp_form]

© 2018 JNews - City News Magazine WordPress theme. All rights belong to their respective owners.
JNews is a top selling 2018 WordPress News, Blog, Newspaper & Magazine Theme.

No Result
View All Result
  • Home

© 2023 JNews - Premium WordPress news & magazine theme by Jegtheme.