{"id":1376,"date":"2020-09-23T16:06:49","date_gmt":"2020-09-23T21:06:49","guid":{"rendered":"https:\/\/www.linuxcloudvps.com\/blog\/?p=1376"},"modified":"2020-09-23T16:06:50","modified_gmt":"2020-09-23T21:06:50","slug":"how-to-install-postgresql-on-ubuntu-18-04","status":"publish","type":"post","link":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-postgresql-on-ubuntu-18-04\/","title":{"rendered":"How to Install PostgreSQL on Ubuntu 18.04"},"content":{"rendered":"\n<p>In this tutorial, we will show you how to install PostgreSQL 11 on an <a href=\"https:\/\/www.linuxcloudvps.com\/cloud-vps.html\" target=\"_blank\" rel=\"noreferrer noopener\">Ubuntu 18.04 Cloud VPS<\/a>. PostgreSQL is an open-source and general purpose object-relational database management system (ORDBMS).<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignright size-large\"><img decoding=\"async\" width=\"120\" height=\"124\" src=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2020\/09\/configure-postgresql-database-system-on-ubuntu-cloud-vps.jpg\" alt=\"\" class=\"wp-image-1380\"\/><\/figure><\/div>\n\n\n\n<p>The latest version of PostgreSQL,&nbsp;PostgreSQL 11, focuses on performance improvements. It comes packed with several advanced features and enhancements which include:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Enhanced Capabilities for Query Parallelism which allows faster query execution<\/li><li>Just-in-Time (JIT) compilation of SQL Statements<\/li><li>Automatic index creation<\/li><li>Advanced partitioning features<\/li><li>Other performance improvements, like command line improvements, improved statistics and more&#8230;<\/li><\/ul>\n\n\n\n<p>Let&#8217;s start installing.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">Connect to your server<\/h2>\n\n\n\n<p>To connect to the server via SSH as the root user, use the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ssh root@IP_ADDRESS -p PORT_NUMBER<\/pre>\n\n\n\n<p>and replace <span class=\"has-inline-color has-vivid-red-color\">IP_ADDRESS<\/span> and <span class=\"has-inline-color has-vivid-red-color\">PORT_NUMBER<\/span> with the actual server IP address and SSH port number.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Update OS packages<\/h2>\n\n\n\n<p>Before we can start with the installation, we have to make sure that all Ubuntu OS packages installed on the server are up to date. We can do this by running the following commands:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt-get update sudo apt-get upgrade<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Install PostgreSQL 11<\/h2>\n\n\n\n<p>Install the required packages:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt install wget ca-certificates<\/pre>\n\n\n\n<p>Import the repository signing key:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd \/opt\nwget https:\/\/www.postgresql.org\/media\/keys\/ACCC4CF8.asc\nsudo apt-key add ACCC4CF8.asc<\/pre>\n\n\n\n<p>Add the repository to the server:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo sh -c &#039;echo &quot;deb http:\/\/apt.postgresql.org\/pub\/repos\/apt\/ $(lsb_release -sc)-pgdg main&quot; &gt; \/etc\/apt\/sources.list.d\/postgresql.list&#039;<\/pre>\n\n\n\n<p>Then fetch the metadata from the newly created repository:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt update<\/pre>\n\n\n\n<p>Now we can install PostgreSQL 11 using the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt-get install postgresql-11<\/pre>\n\n\n\n<p>In order to start the postgreSQL service, use the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl start postgresql.service<\/pre>\n\n\n\n<p>By default, PostgreSQL is listening on <code>localhost<\/code> only. Let&#8217;s configure it to listen on all IP addresses available on the server and allow connections from remote IPs.<\/p>\n\n\n\n<p>Edit the main PostgreSQL configuration file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">vi \/etc\/postgresql\/11\/main\/postgresql.conf<\/pre>\n\n\n\n<p>Locate this line: <code>#listen_addresses = 'localhost'<\/code> (it should be under the &#8216;connections and authentication&#8217; section). Uncomment it and replace localhost with * so that it looks like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">listen_addresses = &#039;*&#039;<\/pre>\n\n\n\n<p>Save and close that file, then edit the <code>pg_hba.conf<\/code> configuration file and add the following lines at the very end:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">vi \/etc\/postgresql\/11\/main\/pg_hba.conf<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">host    all             all              0.0.0.0\/0                       md5\nhost    all             all              ::\/0                            md5<\/pre>\n\n\n\n<p>Restart the PostgreSQL service for the changes to take effect:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl restart postgresql<\/pre>\n\n\n\n<p>This will let PostgreSQL listen for incoming TCP\/IP connections on all IP addresses available on the server.<\/p>\n\n\n\n<p>PostgreSQL is listening on port 5432, so if you use UFW (uncomplicated firewall), allow port 5432.<\/p>\n\n\n\n<p>Check the UFW status using:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo ufw status\nStatus: active<\/pre>\n\n\n\n<p>Run the following command to allow PostgreSQL through the firewall:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo ufw allow 5432\/tcp<\/pre>\n\n\n\n<p>In order to enable PostgreSQL to start on server boot, run:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl enable postgresql.service<\/pre>\n\n\n\n<p>To check the status of PostgreSQL service, run:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl status postgresql.service<\/pre>\n\n\n\n<p>The status command should show an output similar to this one:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u25cf postgresql.service - PostgreSQL RDBMS\n   Loaded: loaded (\/lib\/systemd\/system\/postgresql.service; enabled; vendor preset: enabled)\n   Active: active (exited) since Sun 2019-02-17 02:13:35 CST; 3min 0s ago\n  Process: 14586 ExecStart=\/bin\/true (code=exited, status=0\/SUCCESS)\n Main PID: 14586 (code=exited, status=0\/SUCCESS)<\/pre>\n\n\n\n<p>To connect to the PostgreSQL database server, log in as the <code>postgres<\/code> user using the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># su -l postgres\n$ psql\npsql (11.1 (Ubuntu 11.1-1.pgdg18.04+1))\nType &quot;help&quot; for help.\npostgres=#<\/pre>\n\n\n\n<p>We can use the <code>\\l<\/code> command to list the all the databases in PostgreSQL.<br>Type &#8216;Control + D&#8217; or <code>\\q<\/code> to exit the PostgreSQL prompt.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/q<\/pre>\n\n\n\n<p>To quit the console, run:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">exit<\/pre>\n\n\n\n<p>This will bring us back to the Linux command prompt.<\/p>\n\n\n\n<p>If you want to install a PostgreSQL web client, such as phpPgAdmin (which is very much like phpMyAdmin), use the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt-get install phppgadmin<\/pre>\n\n\n\n<p>In order to access phpPgAdmin through a web browser, the Apache web server needs to be configured accordingly. Therefore, we need to edit the <code>phppgadmin.conf<\/code> Apache configuration file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">vi \/etc\/apache2\/conf-available\/phppgadmin.conf<\/pre>\n\n\n\n<p>Locate and comment the &#8216;<code>Require local<\/code>&#8216; line by adding a &#8216;<code>#<\/code>&#8216; at the front of the line and add &#8216;<code>Allow From all<\/code>&#8216; below that line. Save and close the file.<\/p>\n\n\n\n<p>After editing, the section should look like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Only allow connections from localhost:\n#Require local\nAllow From all<\/pre>\n\n\n\n<p>Let&#8217;s tweak some settings for phpPgAdmin. Open the <code>config.inc.php<\/code> phpPgAdmin configuration file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">vi \/etc\/phppgadmin\/config.inc.php<\/pre>\n\n\n\n<p>Locate this line:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$conf[&#039;extra_login_security&#039;] = true;<\/pre>\n\n\n\n<p>Replace the value from &#8216;true&#8217; to &#8216;false&#8217; so we can log in to phpPgAdmin as the <code>postgres<\/code> user.<\/p>\n\n\n\n<p>Save and close the file.<\/p>\n\n\n\n<p>Restart Apache service for the changes to take effect:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl restart apache2.service<\/pre>\n\n\n\n<p>That is it. We successfully installed PostgreSQL with phpPgAdmin on an Ubuntu 18.04 VPS. We can now open <code>http:\/\/your_server_IP\/phppgadmin<\/code> in a web browser, log in to phpPgAdmin, and use this great tool to create and manage databases in PostgreSQL.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"970\" height=\"267\" src=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2020\/09\/phpPgAdmin5-970x267.png\" alt=\"\" class=\"wp-image-1377\" srcset=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2020\/09\/phpPgAdmin5-970x267.png 970w, https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2020\/09\/phpPgAdmin5-470x129.png 470w, https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2020\/09\/phpPgAdmin5-768x211.png 768w, https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2020\/09\/phpPgAdmin5.png 1304w\" sizes=\"(max-width: 970px) 100vw, 970px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignleft size-large\"><img decoding=\"async\" width=\"120\" height=\"124\" src=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2020\/09\/expert-support-for-postgresql-fully-managed-ubuntu-cloud-servers.jpg\" alt=\"\" class=\"wp-image-1381\"\/><\/figure><\/div>\n\n\n\n<p>Of course, you don\u2019t have to <strong>install PostgreSQL on Ubuntu 18.04<\/strong> if you use one of our&nbsp;<a href=\"https:\/\/www.linuxcloudvps.com\/cloud-vps.html\">Ubuntu Cloud Hosting services<\/a>, in which case you can simply ask our expert Linux admins to install and configure PostgreSQL and phpPgAdmin on Ubuntu 18.04 for you. They are available 24\u00d77 and will take care of your request immediately.<\/p>\n\n\n\n<p><span style=\"color: #ff0000;\"><strong>PS<\/strong><\/span>.&nbsp;If you liked this post on how to install PostgreSQL on Ubuntu 18.04, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we will show you how to install PostgreSQL 11 on an Ubuntu 18.04 Cloud VPS. PostgreSQL is an open-source and general purpose object-relational database management system (ORDBMS). The latest version of PostgreSQL,&nbsp;PostgreSQL 11, focuses on performance improvements. It comes packed with several advanced features and enhancements which include: Enhanced Capabilities for Query &#8230; <a title=\"How to Install PostgreSQL on Ubuntu 18.04\" class=\"read-more\" href=\"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-postgresql-on-ubuntu-18-04\/\" aria-label=\"More on How to Install PostgreSQL on Ubuntu 18.04\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":1379,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[192,47],"class_list":["post-1376","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-postgresql","tag-ubuntu"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Install PostgreSQL on Ubuntu 18.04 | LinuxCloudVPS Blog<\/title>\n<meta name=\"description\" content=\"In this tutorial, we will show you how to install PostgreSQL 11 on an Ubuntu 18.04 Cloud VPS. PostgreSQL is an open-source and general purpose\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-postgresql-on-ubuntu-18-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install PostgreSQL on Ubuntu 18.04 | LinuxCloudVPS Blog\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, we will show you how to install PostgreSQL 11 on an Ubuntu 18.04 Cloud VPS. PostgreSQL is an open-source and general purpose\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-postgresql-on-ubuntu-18-04\/\" \/>\n<meta property=\"og:site_name\" content=\"LinuxCloudVPS Blog\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/LinuxCloudVPS\" \/>\n<meta property=\"article:published_time\" content=\"2020-09-23T21:06:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-09-23T21:06:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2020\/09\/how-to-install-postgresql-on-ubuntu-18-04.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"750\" \/>\n\t<meta property=\"og:image:height\" content=\"360\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@LinuxCloudVPS\" \/>\n<meta name=\"twitter:site\" content=\"@LinuxCloudVPS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-postgresql-on-ubuntu-18-04\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-postgresql-on-ubuntu-18-04\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#\\\/schema\\\/person\\\/ed907227ee7d151c617e6d0fe74f531a\"},\"headline\":\"How to Install PostgreSQL on Ubuntu 18.04\",\"datePublished\":\"2020-09-23T21:06:49+00:00\",\"dateModified\":\"2020-09-23T21:06:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-postgresql-on-ubuntu-18-04\\\/\"},\"wordCount\":684,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-postgresql-on-ubuntu-18-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/how-to-install-postgresql-on-ubuntu-18-04.jpg\",\"keywords\":[\"postgresql\",\"ubuntu\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-postgresql-on-ubuntu-18-04\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-postgresql-on-ubuntu-18-04\\\/\",\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-postgresql-on-ubuntu-18-04\\\/\",\"name\":\"How to Install PostgreSQL on Ubuntu 18.04 | LinuxCloudVPS Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-postgresql-on-ubuntu-18-04\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-postgresql-on-ubuntu-18-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/how-to-install-postgresql-on-ubuntu-18-04.jpg\",\"datePublished\":\"2020-09-23T21:06:49+00:00\",\"dateModified\":\"2020-09-23T21:06:50+00:00\",\"description\":\"In this tutorial, we will show you how to install PostgreSQL 11 on an Ubuntu 18.04 Cloud VPS. PostgreSQL is an open-source and general purpose\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-postgresql-on-ubuntu-18-04\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-postgresql-on-ubuntu-18-04\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-postgresql-on-ubuntu-18-04\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/how-to-install-postgresql-on-ubuntu-18-04.jpg\",\"contentUrl\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/how-to-install-postgresql-on-ubuntu-18-04.jpg\",\"width\":750,\"height\":360},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-postgresql-on-ubuntu-18-04\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install PostgreSQL on Ubuntu 18.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/\",\"name\":\"LinuxCloudVPS\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#organization\",\"name\":\"LinuxCloudVPS\",\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/logo.png\",\"contentUrl\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/logo.png\",\"width\":217,\"height\":25,\"caption\":\"LinuxCloudVPS\"},\"image\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"http:\\\/\\\/www.facebook.com\\\/LinuxCloudVPS\",\"https:\\\/\\\/x.com\\\/LinuxCloudVPS\",\"http:\\\/\\\/www.linkedin.com\\\/company\\\/linuxcloudvps-com\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#\\\/schema\\\/person\\\/ed907227ee7d151c617e6d0fe74f531a\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"http:\\\/\\\/www.linuxcloudvps.com\\\/\"],\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/author\\\/r0s3admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install PostgreSQL on Ubuntu 18.04 | LinuxCloudVPS Blog","description":"In this tutorial, we will show you how to install PostgreSQL 11 on an Ubuntu 18.04 Cloud VPS. PostgreSQL is an open-source and general purpose","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":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-postgresql-on-ubuntu-18-04\/","og_locale":"en_US","og_type":"article","og_title":"How to Install PostgreSQL on Ubuntu 18.04 | LinuxCloudVPS Blog","og_description":"In this tutorial, we will show you how to install PostgreSQL 11 on an Ubuntu 18.04 Cloud VPS. PostgreSQL is an open-source and general purpose","og_url":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-postgresql-on-ubuntu-18-04\/","og_site_name":"LinuxCloudVPS Blog","article_publisher":"http:\/\/www.facebook.com\/LinuxCloudVPS","article_published_time":"2020-09-23T21:06:49+00:00","article_modified_time":"2020-09-23T21:06:50+00:00","og_image":[{"width":750,"height":360,"url":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2020\/09\/how-to-install-postgresql-on-ubuntu-18-04.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_creator":"@LinuxCloudVPS","twitter_site":"@LinuxCloudVPS","twitter_misc":{"Written by":"admin","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-postgresql-on-ubuntu-18-04\/#article","isPartOf":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-postgresql-on-ubuntu-18-04\/"},"author":{"name":"admin","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#\/schema\/person\/ed907227ee7d151c617e6d0fe74f531a"},"headline":"How to Install PostgreSQL on Ubuntu 18.04","datePublished":"2020-09-23T21:06:49+00:00","dateModified":"2020-09-23T21:06:50+00:00","mainEntityOfPage":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-postgresql-on-ubuntu-18-04\/"},"wordCount":684,"commentCount":0,"publisher":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-postgresql-on-ubuntu-18-04\/#primaryimage"},"thumbnailUrl":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2020\/09\/how-to-install-postgresql-on-ubuntu-18-04.jpg","keywords":["postgresql","ubuntu"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-postgresql-on-ubuntu-18-04\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-postgresql-on-ubuntu-18-04\/","url":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-postgresql-on-ubuntu-18-04\/","name":"How to Install PostgreSQL on Ubuntu 18.04 | LinuxCloudVPS Blog","isPartOf":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-postgresql-on-ubuntu-18-04\/#primaryimage"},"image":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-postgresql-on-ubuntu-18-04\/#primaryimage"},"thumbnailUrl":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2020\/09\/how-to-install-postgresql-on-ubuntu-18-04.jpg","datePublished":"2020-09-23T21:06:49+00:00","dateModified":"2020-09-23T21:06:50+00:00","description":"In this tutorial, we will show you how to install PostgreSQL 11 on an Ubuntu 18.04 Cloud VPS. PostgreSQL is an open-source and general purpose","breadcrumb":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-postgresql-on-ubuntu-18-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-postgresql-on-ubuntu-18-04\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-postgresql-on-ubuntu-18-04\/#primaryimage","url":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2020\/09\/how-to-install-postgresql-on-ubuntu-18-04.jpg","contentUrl":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2020\/09\/how-to-install-postgresql-on-ubuntu-18-04.jpg","width":750,"height":360},{"@type":"BreadcrumbList","@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-postgresql-on-ubuntu-18-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.linuxcloudvps.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Install PostgreSQL on Ubuntu 18.04"}]},{"@type":"WebSite","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#website","url":"https:\/\/www.linuxcloudvps.com\/blog\/","name":"LinuxCloudVPS","description":"","publisher":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.linuxcloudvps.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#organization","name":"LinuxCloudVPS","url":"https:\/\/www.linuxcloudvps.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2023\/08\/logo.png","contentUrl":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2023\/08\/logo.png","width":217,"height":25,"caption":"LinuxCloudVPS"},"image":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["http:\/\/www.facebook.com\/LinuxCloudVPS","https:\/\/x.com\/LinuxCloudVPS","http:\/\/www.linkedin.com\/company\/linuxcloudvps-com"]},{"@type":"Person","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#\/schema\/person\/ed907227ee7d151c617e6d0fe74f531a","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","caption":"admin"},"sameAs":["http:\/\/www.linuxcloudvps.com\/"],"url":"https:\/\/www.linuxcloudvps.com\/blog\/author\/r0s3admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/posts\/1376","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/comments?post=1376"}],"version-history":[{"count":5,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/posts\/1376\/revisions"}],"predecessor-version":[{"id":1392,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/posts\/1376\/revisions\/1392"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/media\/1379"}],"wp:attachment":[{"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/media?parent=1376"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/categories?post=1376"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/tags?post=1376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}