{"id":14123,"date":"2024-06-17T10:59:29","date_gmt":"2024-06-17T07:59:29","guid":{"rendered":"http:\/\/local.brightwhiz\/?p=14123"},"modified":"2024-06-17T10:59:30","modified_gmt":"2024-06-17T07:59:30","slug":"how-to-install-postgresql-psql-on-almalinux-8-10-systems","status":"publish","type":"post","link":"http:\/\/local.brightwhiz\/how-to-install-postgresql-psql-on-almalinux-8-10-systems\/","title":{"rendered":"How to Install PostgreSQL (psql) on AlmaLinux 8.10 Systems"},"content":{"rendered":"\n
PostgreSQL, commonly referred to as Before installing any new software, it’s always a good practice to update your system’s package repository and installed packages to their latest versions. Open a terminal and execute the following commands:<\/p>\n\n\n\n This ensures that you have the latest versions of packages and fixes any potential dependency issues.<\/p>\n\n\n\n AlmaLinux uses the DNF package manager for package installations. PostgreSQL packages are available in the default repositories, so you can install them using the following command:<\/p>\n\n\n\n During the installation process, you might be prompted to confirm the installation by typing Once PostgreSQL is installed, you need to initialize the database before starting the service. Run the following command:<\/p>\n\n\n\n This command initializes a new PostgreSQL database cluster and sets up the necessary configuration files.<\/p>\n\n\n\n After initializing the database, you can start the PostgreSQL service and enable it to start automatically at boot time with the following commands:<\/p>\n\n\n\n To verify that PostgreSQL is running, you can use the If PostgreSQL has started successfully, you should see an output indicating that the service is active and running.<\/p>\n\n\n\n To interact with PostgreSQL, you can use the You should now be logged into the PostgreSQL interactive terminal ( By default, the Enter a strong password and confirm it when prompted. This password will be required whenever you log in as the Congratulations! You’ve successfully installed PostgreSQL on your AlmaLinux 8.10 system. You can now start creating databases, defining schemas, and utilizing the full power of PostgreSQL for your applications. Remember to secure your database by configuring firewall rules and following best practices for database administration.<\/p>\n\n\n\npsql<\/code>, is a powerful open-source relational database system known for its reliability and robust feature set. If you’re using AlmaLinux 8.10 and need to set up PostgreSQL for your projects or applications, this guide will walk you through the installation process step-by-step.<\/p>\n\n\n\n
Step 1: Update System Packages<\/h4>\n\n\n\n
$ sudo dnf clean all\n$ sudo dnf update<\/code><\/pre>\n\n\n\n
Step 2: Install PostgreSQL Server<\/h4>\n\n\n\n
$ sudo dnf install postgresql-server<\/code><\/pre>\n\n\n\n
y<\/code> and then pressing
Enter<\/code>.<\/p>\n\n\n\n
Step 3: Initialize the Database<\/h4>\n\n\n\n
$ sudo postgresql-setup --initdb<\/code><\/pre>\n\n\n\n
Step 4: Start and Enable PostgreSQL Service<\/h4>\n\n\n\n
$ sudo systemctl start postgresql\n$ sudo systemctl enable postgresql<\/code><\/pre>\n\n\n\n
systemctl<\/code> command to check its status:<\/p>\n\n\n\n
$ sudo systemctl status postgresql<\/code><\/pre>\n\n\n\n
Step 5: Access PostgreSQL Prompt (psql)<\/h4>\n\n\n\n
psql<\/code> command-line interface. By default, PostgreSQL creates a user named
postgres<\/code> with administrative privileges. Switch to this user and access the
psql<\/code> prompt:<\/p>\n\n\n\n
$ sudo su - postgres\n$ psql<\/code><\/pre>\n\n\n\n
psql<\/code>), where you can start executing SQL commands and managing your databases.<\/p>\n\n\n\n
Step 6: Set a Password for the PostgreSQL User<\/h4>\n\n\n\n
postgres<\/code> user does not have a password set. To secure your PostgreSQL installation, set a password for this user using the following command inside the
psql<\/code> prompt:<\/p>\n\n\n\n
$ \\password postgres<\/code><\/pre>\n\n\n\n
postgres<\/code> user.<\/p>\n\n\n\n
Conclusion<\/h4>\n\n\n\n