Assignment 0 LUXDEV COHORT 4 JULY INTAKE
1️⃣ Step 1: Update Your System
sudo apt update sudo apt upgrade -y
2️⃣ Step 2: Install PostgreSQL
sudo apt install postgresql postgresql-contrib -y
postgresql: Core PostgreSQL database system.
_postgresql-contrib: Additional useful tools and extensions.
3️⃣ Step 3: Verify PostgreSQL Installation
sudo systemctl status postgresql
_To start/stop/restart PostgreSQL:
sudo systemctl start postgresql sudo systemctl stop postgresql sudo systemctl restart postgresql
4️⃣ Step 4: Switch to PostgreSQL User
sudo -i -u postgres
5️⃣ Step 5: Access PostgreSQL
psql
To exit:
\q
6️⃣ Step 6: Secure PostgreSQL
\password postgres
7️⃣ Step 7: Create a New Database
CREATE DATABASE myappdb; CREATE USER myappuser WITH ENCRYPTED PASSWORD 'mypassword'; GRANT ALL PRIVILEGES ON DATABASE myappdb TO myappuser;
8️⃣ Step 9: Test Connection Locally
psql -h localhost -U myappuser -d myappdb
now you will have installed and configured PostgreSQL on your Linux server🙂
by Kipngeno Gregory
Top comments (1)
in need of the docker version installation ? 😊
I'm here