Bobcares

Install PostgreSQL on Debian 12.11

PDF Header PDF Footer

Install PostgreSQL on Debian 12.11 to set up a secure, reliable, and scalable database. Our PostgreSQL Support team is ready to assist you.

Step-by-Step Guide to Install PostgreSQL on Debian 12.11

A robust, open-source database system known for its dependability and efficiency is PostgreSQL. Its installation on Debian 12.11 ensures a stable and safe environment for your projects. You can securely and effectively handle data with the right setup. This article covers each step to help you install and set up PostgreSQL with simplicity.

What is PostgreSQL on Debian 12.11?

Installing PostgreSQL on Debian 12.11 entails configuring and executing the PostgreSQL database on the Bookworm operating system. A robust, open-source database system known for its sophisticated features and dependability is PostgreSQL. It enables users to expand its capabilities as required and fully supports SQL standards.

Prerequisites

Prior to installing PostgreSQL on Debian 12.11, your server must be ready. Start by setting up a Debian 12 cloud compute instance on Vultr and gaining SSH access to it. For added protection, create a non-root user with sudo rights and switch to that account. Finally, before beginning the installation, update the system to ensure that all packages are current.

Install PostgreSQL on Debian 12.11

 

Step 1: Update System Packages

Verify that your system is updated. Launch your terminal and type:

sudo apt update && sudo apt upgrade -y

Step 2: Install PostgreSQL on Debian 12

Install PostgreSQL by executing the following command:

sudo apt install postgresql postgresql-contrib -y

Check out our expert guide to setup PostgreSQL on Linux in Vesta for a smooth installation.

Step 3: Start and Enable PostgreSQL Service

Launch PostgreSQL and set it to start automatically:

sudo systemctl start postgresql
sudo systemctl enable postgresql

Step 4: Secure the Default PostgreSQL User

To create a password, switch to the PostgreSQL user account that is set by default:

sudo -i -u postgres
psql

Inside the PostgreSQL prompt, set a strong password:
\password postgres

Exit the prompt:
\q
exit

Step 5: Create a New Database in PostgreSQL

Login as the postgres user:

sudo -i -u postgres

Create a new database and a new user (replace yourdbname and yourdbuser):
createdb yourdbname
createuser -P yourdbuser

Grant privileges:
psql

GRANT ALL PRIVILEGES ON DATABASE yourdbname TO yourdbuser;
\q
exit

Step 6: Configure PostgreSQL Settings

Modify the configuration files if you require additional custom settings or external connections:

sudo nano /etc/postgresql/14/main/postgresql.conf
sudo nano /etc/postgresql/14/main/pg_hba.conf

Restart PostgreSQL after making changes:
sudo systemctl restart postgresql

Want to update your PostgreSQL credentials? Read our guide on changing passwords via CLI.

[Need assistance with a different issue? Our team is available 24/7.]

Conclusion

In conclusion, when you install PostgreSQL on Debian 12.11, you set up a secure, scalable, and reliable database system. It includes sophisticated functionality and ensures seamless data handling when configured properly. For small projects as well as enterprise-level applications, this makes it a good option.

In brief, our Support Experts demonstrated how to fix the “554 5.7.1 : Relay access denied” error.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Get featured on the Bobcares blog and share your expertise with a global tech audience.

WRITE FOR US
server management

Spend time on your business, not on your servers.

TALK TO US

Or click here to learn more.

Speed issues driving customers away?
We’ve got your back!