{"id":360,"date":"2024-05-21T13:24:08","date_gmt":"2024-05-21T13:24:08","guid":{"rendered":"http:\/\/77interactive.com\/?p=360"},"modified":"2024-06-10T16:29:56","modified_gmt":"2024-06-10T16:29:56","slug":"install-postgresql-on-ubuntu-22-04","status":"publish","type":"post","link":"http:\/\/77interactive.com\/?p=360","title":{"rendered":"Install PostgreSQL on Ubuntu 22.04"},"content":{"rendered":"\n<p>The following scripts install PostgreSQL on Ubuntu 22.04<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Installation Steps<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">Perform Updates<\/h2>\n\n\n\n<p>First install any updates for Ubuntu<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update\nsudo apt upgrade -y\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Add Repository and Install<\/h2>\n\n\n\n<p>Ubuntu does not include PostgreSQL so we must add the repository manually.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Add the repository\nsudo sh -c 'echo \"deb http:\/\/apt.postgresql.org\/pub\/repos\/apt\/ $(lsb_release -cs)-pgdg main\" > \/etc\/apt\/sources.list.d\/pgdg.list'\n\n# Add the signing keys\nwget --quiet -O - https:\/\/www.postgresql.org\/media\/keys\/ACCC4CF8.asc | sudo apt-key add -\n\n# Update the package list to include the new repository\nsudo apt update\n\n# Perform the install\nsudo apt install postgresql-15 -y<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Start and Enable PostgreSQL<\/h2>\n\n\n\n<p>Once installed, we will start and enable PostgreSQL. This ensures that the service starts up after a reboot.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Start and enable the PostgreSQL service\nsudo systemctl start postgresql\nsudo systemctl enable postgresql\n\n# Ensure the service is running\nsudo systemctl status postgresql\n\n# Connect to PostgreSQL locally\nsudo -i -u postgres\npsql<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The following scripts install PostgreSQL on Ubuntu 22.04 Installation Steps Perform Updates First install any updates for Ubuntu Add Repository and Install Ubuntu does not include PostgreSQL so we must add the repository manually. Start and Enable PostgreSQL Once installed, we will start and enable PostgreSQL. This ensures that the service starts up after a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46],"tags":[18,51],"class_list":["post-360","post","type-post","status-publish","format-standard","hentry","category-postgresql","tag-postgresql","tag-ubuntu"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Install PostgreSQL on Ubuntu 22.04 - 77 Interactive<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/77interactive.com\/?p=360\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Install PostgreSQL on Ubuntu 22.04 - 77 Interactive\" \/>\n<meta property=\"og:description\" content=\"The following scripts install PostgreSQL on Ubuntu 22.04 Installation Steps Perform Updates First install any updates for Ubuntu Add Repository and Install Ubuntu does not include PostgreSQL so we must add the repository manually. Start and Enable PostgreSQL Once installed, we will start and enable PostgreSQL. This ensures that the service starts up after a [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"http:\/\/77interactive.com\/?p=360\" \/>\n<meta property=\"og:site_name\" content=\"77 Interactive\" \/>\n<meta property=\"article:published_time\" content=\"2024-05-21T13:24:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-06-10T16:29:56+00:00\" \/>\n<meta name=\"author\" content=\"Rudy\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rudy\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/77interactive.com\/?p=360#article\",\"isPartOf\":{\"@id\":\"http:\/\/77interactive.com\/?p=360\"},\"author\":{\"name\":\"Rudy\",\"@id\":\"http:\/\/77interactive.com\/#\/schema\/person\/0e61d2a984b8304618026b207e6121e9\"},\"headline\":\"Install PostgreSQL on Ubuntu 22.04\",\"datePublished\":\"2024-05-21T13:24:08+00:00\",\"dateModified\":\"2024-06-10T16:29:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/77interactive.com\/?p=360\"},\"wordCount\":59,\"keywords\":[\"postgresql\",\"ubuntu\"],\"articleSection\":[\"PostgreSQL\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/77interactive.com\/?p=360\",\"url\":\"http:\/\/77interactive.com\/?p=360\",\"name\":\"Install PostgreSQL on Ubuntu 22.04 - 77 Interactive\",\"isPartOf\":{\"@id\":\"http:\/\/77interactive.com\/#website\"},\"datePublished\":\"2024-05-21T13:24:08+00:00\",\"dateModified\":\"2024-06-10T16:29:56+00:00\",\"author\":{\"@id\":\"http:\/\/77interactive.com\/#\/schema\/person\/0e61d2a984b8304618026b207e6121e9\"},\"breadcrumb\":{\"@id\":\"http:\/\/77interactive.com\/?p=360#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/77interactive.com\/?p=360\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/77interactive.com\/?p=360#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/77interactive.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Install PostgreSQL on Ubuntu 22.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/77interactive.com\/#website\",\"url\":\"http:\/\/77interactive.com\/\",\"name\":\"77 Interactive\",\"description\":\"Rudy&#039;s Code snippets\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/77interactive.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"http:\/\/77interactive.com\/#\/schema\/person\/0e61d2a984b8304618026b207e6121e9\",\"name\":\"Rudy\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/77interactive.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e336b9aecd39b40691ff8ccfcd68506415072dbe8caffc0485b94a1bc22b774d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e336b9aecd39b40691ff8ccfcd68506415072dbe8caffc0485b94a1bc22b774d?s=96&d=mm&r=g\",\"caption\":\"Rudy\"},\"url\":\"http:\/\/77interactive.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Install PostgreSQL on Ubuntu 22.04 - 77 Interactive","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/77interactive.com\/?p=360","og_locale":"en_US","og_type":"article","og_title":"Install PostgreSQL on Ubuntu 22.04 - 77 Interactive","og_description":"The following scripts install PostgreSQL on Ubuntu 22.04 Installation Steps Perform Updates First install any updates for Ubuntu Add Repository and Install Ubuntu does not include PostgreSQL so we must add the repository manually. Start and Enable PostgreSQL Once installed, we will start and enable PostgreSQL. This ensures that the service starts up after a [&hellip;]","og_url":"http:\/\/77interactive.com\/?p=360","og_site_name":"77 Interactive","article_published_time":"2024-05-21T13:24:08+00:00","article_modified_time":"2024-06-10T16:29:56+00:00","author":"Rudy","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Rudy","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/77interactive.com\/?p=360#article","isPartOf":{"@id":"http:\/\/77interactive.com\/?p=360"},"author":{"name":"Rudy","@id":"http:\/\/77interactive.com\/#\/schema\/person\/0e61d2a984b8304618026b207e6121e9"},"headline":"Install PostgreSQL on Ubuntu 22.04","datePublished":"2024-05-21T13:24:08+00:00","dateModified":"2024-06-10T16:29:56+00:00","mainEntityOfPage":{"@id":"http:\/\/77interactive.com\/?p=360"},"wordCount":59,"keywords":["postgresql","ubuntu"],"articleSection":["PostgreSQL"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"http:\/\/77interactive.com\/?p=360","url":"http:\/\/77interactive.com\/?p=360","name":"Install PostgreSQL on Ubuntu 22.04 - 77 Interactive","isPartOf":{"@id":"http:\/\/77interactive.com\/#website"},"datePublished":"2024-05-21T13:24:08+00:00","dateModified":"2024-06-10T16:29:56+00:00","author":{"@id":"http:\/\/77interactive.com\/#\/schema\/person\/0e61d2a984b8304618026b207e6121e9"},"breadcrumb":{"@id":"http:\/\/77interactive.com\/?p=360#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/77interactive.com\/?p=360"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/77interactive.com\/?p=360#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/77interactive.com\/"},{"@type":"ListItem","position":2,"name":"Install PostgreSQL on Ubuntu 22.04"}]},{"@type":"WebSite","@id":"http:\/\/77interactive.com\/#website","url":"http:\/\/77interactive.com\/","name":"77 Interactive","description":"Rudy&#039;s Code snippets","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/77interactive.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"http:\/\/77interactive.com\/#\/schema\/person\/0e61d2a984b8304618026b207e6121e9","name":"Rudy","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/77interactive.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e336b9aecd39b40691ff8ccfcd68506415072dbe8caffc0485b94a1bc22b774d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e336b9aecd39b40691ff8ccfcd68506415072dbe8caffc0485b94a1bc22b774d?s=96&d=mm&r=g","caption":"Rudy"},"url":"http:\/\/77interactive.com\/?author=1"}]}},"_links":{"self":[{"href":"http:\/\/77interactive.com\/index.php?rest_route=\/wp\/v2\/posts\/360","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/77interactive.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/77interactive.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/77interactive.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/77interactive.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=360"}],"version-history":[{"count":0,"href":"http:\/\/77interactive.com\/index.php?rest_route=\/wp\/v2\/posts\/360\/revisions"}],"wp:attachment":[{"href":"http:\/\/77interactive.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=360"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/77interactive.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=360"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/77interactive.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}