How to install PostgreSQL on Ubuntu
Step 1: Update and install
sudo apt update
sudo apt install postgresql postgresql-contrib -yStep 2: Check that it is running
sudo systemctl status postgresqlStep 3: Understand the default user
sudo -i -u postgrespsqlStep 4: Create a database and user
Step 5: Configure remote access (optional)
Step 6: Restart PostgreSQL
Step 7: Test the connection
Useful psql commands
Command
What it does
Backup and restore
Common issues
Tuning for small VPS
Conclusion
Last updated