PostgreSQL is a powerful, enterprise-grade relational database with advanced features.
Install
apt update
apt install postgresql postgresql-contrib -yAccess PostgreSQL
sudo -u postgres psqlCreate Database and User
CREATE USER myuser WITH PASSWORD 'SecurePassword123!';
CREATE DATABASE myapp OWNER myuser;
GRANT ALL PRIVILEGES ON DATABASE myapp TO myuser;
\qConnect as User
psql -U myuser -d myapp -h localhostKey Files
- Config:
/etc/postgresql/16/main/postgresql.conf - Auth:
/etc/postgresql/16/main/pg_hba.conf - Data:
/var/lib/postgresql/