Install PostgreSQL on Debian #
PostgreSQL is an open-source, powerful, and reliable object-relational database system. This guide will show you how to install PostgreSQL on Debian.
Steps to Install PostgreSQL #
-
Update your system:
sudo apt-get update sudo apt-get upgrade
-
Install PostgreSQL:
sudo apt-get install postgresql postgresql-contrib
-
Check if PostgreSQL is running:
sudo systemctl status postgresql
-
Log in to PostgreSQL:
sudo su - postgres psql
-
(Optional) Create a new database user:
CREATE USER myuser WITH PASSWORD 'mypassword';
-
(Optional) Create a new database:
CREATE DATABASE mydb OWNER myuser;
-
Exit PostgreSQL:
\q
You have now successfully installed PostgreSQL on Debian.