{"id":29846,"date":"2026-10-22T11:05:13","date_gmt":"2026-10-22T11:05:13","guid":{"rendered":"https:\/\/tenthplanet.in\/idempiere\/?p=29846"},"modified":"2026-10-22T11:05:14","modified_gmt":"2026-10-22T11:05:14","slug":"how-it-works-install-and-configure-postgresql-15-on-ubuntu","status":"publish","type":"post","link":"https:\/\/tenthplanet.in\/idempiere\/how-it-works-install-and-configure-postgresql-15-on-ubuntu\/","title":{"rendered":"HOW IT WORKS &#8211; Install and Configure PostgreSQL 15 on Ubuntu"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>Overview<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This guide walks through installing PostgreSQL 15 on Ubuntu, verifying that the database service is running on port 5432, setting a password for the PostgreSQL superuser, and registering the server in pgAdmin 4. It finishes by creating a database through the pgAdmin interface.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>What you will complete<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Add the official PostgreSQL Apt Repository signing key and package source.<\/li>\n\n\n\n<li>Install PostgreSQL 15 server and client packages.<\/li>\n\n\n\n<li>Check the PostgreSQL service and listening port.<\/li>\n\n\n\n<li>Set a password for the postgres database superuser.<\/li>\n\n\n\n<li>Register the local server in pgAdmin 4.<\/li>\n\n\n\n<li>Create a database from pgAdmin.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Before you begin<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Ubuntu 24.04 LTS or Ubuntu 22.04 LTS<\/strong> is installed and you can open a terminal.<\/li>\n\n\n\n<li>Your user account has sudo privileges.<\/li>\n\n\n\n<li>An internet connection is available for package downloads.<\/li>\n\n\n\n<li>pgAdmin 4 is installed if you want to follow the graphical connection steps. It is a separate application from PostgreSQL.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> The commands below target PostgreSQL 15 explicitly. Package availability depends on Ubuntu release and repository support. Use the official PostgreSQL repository instructions for your specific release if the repository configuration differs.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Add the Official PostgreSQL Repository<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Ubuntu&#8217;s default repositories may provide a different PostgreSQL major version. The PostgreSQL Apt Repository (PGDG) allows you to request PostgreSQL 15 explicitly.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Create the keyring directory and import the signing key<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\" style=\"font-size:16px\"><code> sudo mkdir -p \/etc\/apt\/keyrings\n curl -fsSL https:\/\/www.postgresql.org\/media\/keys\/ACCC4CF8.asc | sudo gpg --dearmor -o \/etc\/apt\/keyrings\/postgresql.gpg<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The signing key allows APT to verify packages from the repository. If the key file already exists, review the error before overwriting it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Add the repository source<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\" style=\"font-size:16px\"><code> echo \"deb &#091;signed-by=\/etc\/apt\/keyrings\/postgresql.gpg] https:\/\/apt.postgresql.org\/pub\/repos\/apt $(lsb_release -cs)-pgdg main\" | sudo tee \/etc\/apt\/sources.list.d\/pgdg.list<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The command uses the Ubuntu codename detected by lsb_release -cs and adds the PGDG repository for that release.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Refresh the package index<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\" style=\"font-size:16px\"><code> sudo apt-get update<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check the output for repository or signature errors before continuing.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Install PostgreSQL 15<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Install the PostgreSQL 15 server and client packages:<\/p>\n\n\n\n<pre class=\"wp-block-code\" style=\"font-size:16px\"><code> sudo apt-get install -y postgresql-15 postgresql-client-15<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The server package provides the database service. The client package provides tools such as psql for connecting to PostgreSQL.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Verify the Service and Port<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Check the PostgreSQL service status:<\/p>\n\n\n\n<pre class=\"wp-block-code\" style=\"font-size:16px\"><code> sudo systemctl status postgresql<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the service is not active, start it and enable it to start automatically at boot:<\/p>\n\n\n\n<pre class=\"wp-block-code\" style=\"font-size:16px\"><code> sudo systemctl start postgresql\n sudo systemctl enable postgresql<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check whether a process is listening on the default PostgreSQL port, 5432:<\/p>\n\n\n\n<pre class=\"wp-block-code\" style=\"font-size:16px\"><code> ss -nlt | grep 5432<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">A listener on 127.0.0.1:5432, [::1]:5432, or another configured address indicates that a process is listening on that port. If the command returns no result, inspect PostgreSQL status and configuration. The port can be configured differently, so verify rather than assuming.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Security note:<\/strong> For a local development setup, listening only on localhost is often appropriate. Do not expose PostgreSQL to a network unless remote access is required and access controls, authentication, and firewall rules have been configured.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Set a Password for the postgres Database User<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Ubuntu commonly configures local PostgreSQL administration to use peer authentication. This means the operating-system account is checked when connecting locally, rather than requiring a database password. To use password authentication from pgAdmin, set a password for the PostgreSQL database role.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Open the PostgreSQL prompt<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\" style=\"font-size:16px\"><code> sudo -u postgres psql<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Set the password<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">At the psql prompt, run the following SQL command, replacing the example value with a strong, unique password:<\/p>\n\n\n\n<pre class=\"wp-block-code\" style=\"font-size:16px\"><code> ALTER USER postgres WITH PASSWORD 'your_secure_password';<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Then exit psql:<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\" style=\"font-size:16px\"><code> \\q<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Important:<\/strong> Do not use the literal placeholder password. Avoid reusing passwords from tutorials, and do not include real passwords in screenshots, documentation, or recorded videos.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Setting a password does not automatically change PostgreSQL&#8217;s authentication rules for every connection. If pgAdmin cannot connect, review the active pg_hba.conf rules and server logs before changing authentication settings.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Connect to PostgreSQL Using pgAdmin 4<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Open pgAdmin 4 using the desktop application, or use its browser interface if it has been installed and configured for web access. A common local URL is http:\/\/localhost\/pgadmin4, but the exact URL depends on the installation method.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In the browser tree, right-click <strong>Servers<\/strong> and select <strong>Register &gt; Server<\/strong>.<\/li>\n\n\n\n<li>On the General tab, enter a recognizable name, such as <strong>Ubuntu PostgreSQL 15<\/strong>.<\/li>\n\n\n\n<li>Open the Connection tab and enter the connection details shown below.<\/li>\n\n\n\n<li>Enter the password set for the postgres database role.<\/li>\n\n\n\n<li>Optionally select Save password if this is an appropriate trusted local environment.<\/li>\n\n\n\n<li>Click Save and expand the registered server to confirm that the connection succeeds.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Connection settings<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td><strong>Field<\/strong><\/td><td><strong>Value<\/strong><\/td><\/tr><tr><td><strong>Name<\/strong><\/td><td>Ubuntu PostgreSQL 15<\/td><\/tr><tr><td><strong>Host name\/address<\/strong><\/td><td>localhost<\/td><\/tr><tr><td><strong>Port<\/strong><\/td><td>5432<\/td><\/tr><tr><td><strong>Maintenance database<\/strong><\/td><td>postgres<\/td><\/tr><tr><td><strong>Username<\/strong><\/td><td>postgres<\/td><\/tr><tr><td><strong>Password<\/strong><\/td><td>The password set in Section 5<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Create a Database in pgAdmin<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Expand the registered server and locate Databases.<\/li>\n\n\n\n<li>Right-click <strong>Databases<\/strong> and choose <strong>Create &gt; Database<\/strong>.<\/li>\n\n\n\n<li>Enter a database name appropriate for your project or test environment.<\/li>\n\n\n\n<li>Choose the owner if required. For a new local workspace, select the appropriate role for your intended use.<\/li>\n\n\n\n<li>Click Save and confirm that the new database appears under Databases.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">This creates a clean database workspace. It does not automatically import iDempiere&#8217;s schema or seed data; those steps are performed separately when setting up the iDempiere application.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Verification Checklist<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The PGDG repository was added and apt-get update completed without repository errors.<\/li>\n\n\n\n<li>PostgreSQL 15 server and client packages are installed.<\/li>\n\n\n\n<li>The PostgreSQL service is active.<\/li>\n\n\n\n<li>A process is listening on the expected port, usually 5432.<\/li>\n\n\n\n<li>The postgres database role has a strong password configured.<\/li>\n\n\n\n<li>pgAdmin 4 can connect to the local PostgreSQL server.<\/li>\n\n\n\n<li>A test database can be created and is visible in pgAdmin.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Common Issues to Check<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td><strong>Issue<\/strong><\/td><td><strong>Checks<\/strong><\/td><\/tr><tr><td><strong>APT repository or key error<\/strong><\/td><td>Verify the official PGDG repository instructions, key URL, Ubuntu codename, and file permissions.<\/td><\/tr><tr><td><strong>PostgreSQL service is inactive<\/strong><\/td><td>Check sudo systemctl status postgresql and the PostgreSQL logs; then start the service if appropriate.<\/td><\/tr><tr><td><strong>Port 5432 is not listening<\/strong><\/td><td>Confirm the cluster is running and review its configured port and listen_addresses setting.<\/td><\/tr><tr><td><strong>pgAdmin password authentication fails<\/strong><\/td><td>Verify the username and password, then review pg_hba.conf authentication rules and server logs.<\/td><\/tr><tr><td><strong>Connection refused<\/strong><\/td><td>Confirm the service is running, the host and port are correct, and PostgreSQL is listening on the requested interface.<\/td><\/tr><tr><td><strong>pgAdmin URL does not open<\/strong><\/td><td>Confirm pgAdmin 4 is installed and determine the URL for that installation method; the web URL is not universal.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Completion<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">PostgreSQL 15 is ready for local development when the service is running, the expected port is available, and pgAdmin 4 can connect to the server and create a database. Keep database access local unless remote connectivity is specifically needed. For production, configure least-privilege roles, backups, secure authentication, network restrictions, and credential management.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-dots\" \/>\n","protected":false},"excerpt":{"rendered":"<p>Overview This guide walks through installing PostgreSQL 15 on Ubuntu, verifying that the database service is running on port 5432, [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-29846","post","type-post","status-publish","format-standard","hentry","category-idempiere-product"],"_links":{"self":[{"href":"https:\/\/tenthplanet.in\/idempiere\/wp-json\/wp\/v2\/posts\/29846","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tenthplanet.in\/idempiere\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tenthplanet.in\/idempiere\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tenthplanet.in\/idempiere\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/tenthplanet.in\/idempiere\/wp-json\/wp\/v2\/comments?post=29846"}],"version-history":[{"count":13,"href":"https:\/\/tenthplanet.in\/idempiere\/wp-json\/wp\/v2\/posts\/29846\/revisions"}],"predecessor-version":[{"id":29867,"href":"https:\/\/tenthplanet.in\/idempiere\/wp-json\/wp\/v2\/posts\/29846\/revisions\/29867"}],"wp:attachment":[{"href":"https:\/\/tenthplanet.in\/idempiere\/wp-json\/wp\/v2\/media?parent=29846"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tenthplanet.in\/idempiere\/wp-json\/wp\/v2\/categories?post=29846"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tenthplanet.in\/idempiere\/wp-json\/wp\/v2\/tags?post=29846"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}