Wrigs

Install PostgreSQL on Ubuntu

Jul 10th, 2022 (edited)
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. # How to install PostgreSQL on Ubuntu
  2. https://www.linuxcapable.com/how-to-install-postgresql-on-ubuntu-22-04-lts/
  3.  
  4. #Install_PostgreSQL
  5. https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-22-04
  6.  
  7. # How To Change The Password of a PostgreSQL User
  8. https://www.postgresqltutorial.com/postgresql-administration/postgresql-change-password/
  9.  
  10. # Install pgAdmin 4 (APT)
  11. https://www.pgadmin.org/download/pgadmin-4-apt/
  12.  
  13.  
  14. sudo apt update
  15. sudo apt install postgresql postgresql-contrib
  16. sudo systemctl start postgresql.service
  17. systemctl status postgresql
  18.  
  19. # Configure UFW Firewall
  20. sudo ufw enable
  21. sudo ufw allow proto tcp from 192.168.1.0/24 to any port 5432
  22.  
  23. # Create User & Database
  24. sudo su - postgres -c "createuser <name>"
  25. sudo su - postgres -c "createdb <namedb>"
  26.  
  27. sudo -i -u postgres
  28. psql
  29. ALTER ROLE <username> WITH PASSWORD <'password'>;
Add Comment
Please, Sign In to add comment