#
postgreSQL
title: Install PostgreSQL label: Install PostgreSQL order: 100 authors:
- name: Charl Cronje email: charl@webally.co.za link: https://blog.webally.co.za avatar: https://assets.webally.co.za/avatars/darker.jpg edit: repo: "https://github.com/charlpcronje/setup.docs.devserv.me/edit/" base: /src branch: main label: Edit on GitHub editor: enabled: false favicon: favicon.png links:
- text: Projects Portfolio link: https://webally.co.za/projects
- text: Wiki, Tips and Docs link: https://docs.webally.co.zao.za
- text: Resume link: https://cv.webally.co.za
- text: LinkedIn link: https://www.linkedin.com/in/charlpcronje
- text: GitHub link: https://github.com/charlpcronje
- text: Upwork Profile link: https://www.upwork.com/freelancers/~01ccb1439024ec9c50 footer: copyright: "webAlly © Copyright . All rights reserved."---
Run the following command to install PostgreSQL.
yum -y install postgresql-server postgresql-contrib
Now initialize the database using the following command.
postgresql-setup initdb
Start and enable PostgreSQL database service using the following command.
systemctl start postgresql
systemctl enable postgresql
Now run the following command to change the password of PostgreSQL root user called postgres using the following command.
sudo -u postgres psql postgres
\password postgres
Enter \q
or ctrl + D
buttons to exit Postgres shell.