1. installing psql // this command should create 'postgres' user. `sudo apt install postgresql postgresql-contrib` // postgres is like a superuser for the database ------------------------------------------------------- 2. accessing postgresql command interface // this will login as postgres // after entering your normal password for sudo `sudo su - postgres` // then accessing postgresql command interface as following `psql` // now psql shell should be running // this command will print the full command list available `\help` ------------------------------------------------------- 3. creating a dummy user (for server-side connection (from php)) // you can change any of this username(`foo`) or password(`bar`) `CREATE USER foo WITH PASSWORD 'bar';` // it works in lower litter too `create user foo with password 'bar';` // verifying user been created by `\du` // now we just need to give `foo` a full access `alter user foo with superuser;` ------------------------------------------------------- 4. creating a database to store our tables in it `create database chicken_fight` // verifying database been created by `\du` ------------------------------------------------------- 5. now we done we can continue from php i think // to exit the database `\q` // to return to regular user mode, and logout form postgres `exit`