{"id":1496,"date":"2021-08-12T16:14:19","date_gmt":"2021-08-12T10:44:19","guid":{"rendered":"http:\/\/www.webhostingchennai.co.in\/blog\/?p=1496"},"modified":"2021-09-27T17:23:10","modified_gmt":"2021-09-27T11:53:10","slug":"pgadmin-4-installation-steps","status":"publish","type":"post","link":"https:\/\/chennaiwebhosting.in\/blog\/pgadmin-4-installation-steps\/","title":{"rendered":"pgAdmin 4 : Installation steps on centOS 7"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_80 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/chennaiwebhosting.in\/blog\/pgadmin-4-installation-steps\/#pgAdmin_4_Installation_steps_on_centOS_7\" >pgAdmin 4 : Installation steps on centOS 7<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/chennaiwebhosting.in\/blog\/pgadmin-4-installation-steps\/#Web_Deployment\" >Web Deployment:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/chennaiwebhosting.in\/blog\/pgadmin-4-installation-steps\/#Desktop_Deployment\" >Desktop Deployment:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/chennaiwebhosting.in\/blog\/pgadmin-4-installation-steps\/#Prerequisites\" >Prerequisites<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/chennaiwebhosting.in\/blog\/pgadmin-4-installation-steps\/#Installing_PostgreSQL_Server\" >Installing PostgreSQL Server<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/chennaiwebhosting.in\/blog\/pgadmin-4-installation-steps\/#Set_up_PostgreSQL_Repository_PostgreSQL_11\" >Set up PostgreSQL Repository (PostgreSQL 11)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/chennaiwebhosting.in\/blog\/pgadmin-4-installation-steps\/#PostgreSQL_10\" >PostgreSQL 10<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/chennaiwebhosting.in\/blog\/pgadmin-4-installation-steps\/#Install_pgAdmin_4\" >Install pgAdmin 4<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/chennaiwebhosting.in\/blog\/pgadmin-4-installation-steps\/#Configure_pgAdmin_4\" >Configure pgAdmin 4<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/chennaiwebhosting.in\/blog\/pgadmin-4-installation-steps\/#Firewall\" >Firewall<\/a><\/li><\/ul><\/nav><\/div>\n<h4><span class=\"ez-toc-section\" id=\"pgAdmin_4_Installation_steps_on_centOS_7\"><\/span><span style=\"text-decoration: underline;\">pgAdmin 4 : Installation steps on centOS 7<\/span><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p><a href=\"https:\/\/www.pgadmin.org\/\" rel=\"nofollow noopener\" target=\"_blank\">pgAdmin<\/a>,\u00a0 a free and open source management tool for PostgreSQL and derivative relation databases like EDB Advanced Server. This can be installed on multiple OS platforms like Linux, Unix, Mac OS X, and Windows to manage PostgreSQL 9.2 and above.<\/p>\n<p>pgAdmin can be run as both web and desktop application.<\/p>\n<h4><span class=\"ez-toc-section\" id=\"Web_Deployment\"><\/span>Web Deployment:<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>As web based application, it is deployed behind a web server running as a reverse proxy or using the WSGI interface.<\/p>\n<h4><span class=\"ez-toc-section\" id=\"Desktop_Deployment\"><\/span>Desktop Deployment:<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>In desktop deployment, it is deployed to run in desktop mode by utilizing the desktop run time to host the application. When the run time is launched, it runs the pgAdmin server and launches a web browser to render the user interface.<\/p>\n<p>Now, we are going to see the pgAdmin 4 installation steps in CentOS 7 (Web Deployment).<\/p>\n<h4><span class=\"ez-toc-section\" id=\"Prerequisites\"><\/span>Prerequisites<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<ol>\n<li>Server with root login<\/li>\n<\/ol>\n<h4><span class=\"ez-toc-section\" id=\"Installing_PostgreSQL_Server\"><\/span><span style=\"text-decoration: underline;\">Installing PostgreSQL Server<\/span><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>First, we need to enable the EPEL repository to download dependent packages for pgAdmin.<\/p>\n<pre>yum install https:\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-7.noarch.rpm\r\n\r\n<\/pre>\n<h4><span class=\"ez-toc-section\" id=\"Set_up_PostgreSQL_Repository_PostgreSQL_11\"><\/span><span style=\"text-decoration: underline;\">Set up PostgreSQL Repository (PostgreSQL 11)<\/span><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>pgAdmin 4 is available in PostgreSQL repository and your system should have the PostgreSQL repository by now, if you have already completed the installation of PostgreSQL. If not, add the PostgreSQL repository using the below command.<\/p>\n<pre>yum install https:\/\/download.postgresql.org\/pub\/repos\/yum\/11\/redhat\/rhel-7-x86_64\/pgdg-centos11-11-2.noarch.rpm\r\n<\/pre>\n<h4><span class=\"ez-toc-section\" id=\"PostgreSQL_10\"><\/span><span style=\"text-decoration: underline;\">PostgreSQL 10<\/span><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<pre>yum install https:\/\/download.postgresql.org\/pub\/repos\/yum\/10\/redhat\/rhel-7-x86_64\/pgdg-centos10-10-2.noarch.rpm<\/pre>\n<h4><span class=\"ez-toc-section\" id=\"Install_pgAdmin_4\"><\/span><span style=\"text-decoration: underline;\">Install pgAdmin 4<\/span><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>Once the PostgreSQL repository configured on your system, run the following command to install pgAdmin 4.<\/p>\n<pre>yum -y install pgadmin4<\/pre>\n<p>Now, Check you have started and enabled httpd service<\/p>\n<pre>systemctl start httpd\r\nsystemctl enable httpd<\/pre>\n<h4><span class=\"ez-toc-section\" id=\"Configure_pgAdmin_4\"><\/span><span style=\"text-decoration: underline;\">Configure pgAdmin 4<\/span><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>Now, we need to do some configuration changed to access pgAdmin 4. Copy the pgAdmin 4 sample configuration.<\/p>\n<pre>cp \/etc\/httpd\/conf.d\/pgadmin4.conf.sample \/etc\/httpd\/conf.d\/pgadmin4.conf<\/pre>\n<p>Create a pgAdmin log and data directories.<\/p>\n<pre>mkdir \/var\/log\/pgadmin4\/\r\nmkdir \/var\/lib\/pgadmin4\/\r\n\r\n<\/pre>\n<p>Now, edit <strong>config_local.py<\/strong> file<\/p>\n<pre>nano \/usr\/lib\/python2.7\/site-packages\/pgadmin4-web\/config_local.py<\/pre>\n<p>Add the below settings for log and session save path<\/p>\n<pre>LOG_FILE = &#039;\/var\/log\/pgadmin4\/pgadmin4.log&#039;\r\nSQLITE_PATH = &#039;\/var\/lib\/pgadmin4\/pgadmin4.db&#039;\r\nSESSION_DB_PATH = &#039;\/var\/lib\/pgadmin4\/sessions&#039;\r\nSTORAGE_DIR = &#039;\/var\/lib\/pgadmin4\/storage&#039;<\/pre>\n<p>Change permissions of directories, so that Apache can write data into it.<\/p>\n<pre>chown -R apache:apache \/var\/lib\/pgadmin4\/\r\nchown -R apache:apache \/var\/log\/pgadmin4\/<\/pre>\n<p>To create a user account for the pgAdmin 4 web interface, run the below command.<\/p>\n<pre>python \/usr\/lib\/python2.7\/site-packages\/pgadmin4-web\/setup.py<\/pre>\n<p><strong>Output<\/strong><\/p>\n<pre>NOTE: Configuring authentication for SERVER mode.\r\n\r\nEnter the email address and password to use for the initial pgAdmin user account:\r\n\r\nEmail address: admin@chennaiwebhosting.in\r\nPassword:********\r\nRetype password:********\r\npgAdmin 4 - Application Initialisation\r\n======================================\r\n\r\n<\/pre>\n<p>Now, restart the apache service.<\/p>\n<pre>systemctl restart httpd<\/pre>\n<h4><span class=\"ez-toc-section\" id=\"Firewall\"><\/span><span style=\"text-decoration: underline;\">Firewall<\/span><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>Setup firewall, to access pgAdmin 4 from external\/remote machines.<\/p>\n<pre>firewall-cmd --permanent --add-service=http\r\nfirewall-cmd --reload<\/pre>\n<p><strong>Note:<\/strong> Consider disabling SELinux permanently for pgAdmin 4 to work properly.<\/p>\n<p>Access pgAdmin 4, from browser using the below URL<\/p>\n<pre>http:\/\/your_server_ip\/pgadmin4<\/pre>\n<figure id=\"attachment_1497\" aria-describedby=\"caption-attachment-1497\" style=\"width: 1350px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1497 size-full\" src=\"http:\/\/www.webhostingchennai.co.in\/blog\/wp-content\/uploads\/2019\/04\/Pgadmin1.jpg\" alt=\"pgAdmin 4 : Installation steps on centOS 7 - pgAdmin Login \" width=\"1350\" height=\"606\" \/><figcaption id=\"caption-attachment-1497\" class=\"wp-caption-text\">pgAdmin 4 : Installation steps on centOS 7 &#8211; pgAdmin Login<\/figcaption><\/figure>\n<p>Log in to pgAdmin 4 web interface using the email address and password you have created earlier.<\/p>\n<figure id=\"attachment_1498\" aria-describedby=\"caption-attachment-1498\" style=\"width: 935px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1498 size-full\" src=\"http:\/\/www.webhostingchennai.co.in\/blog\/wp-content\/uploads\/2019\/04\/Pgadmin2.jpg\" alt=\"pgAdmin 4 : Installation steps on centOS 7 - pgAdmin Home Page\" width=\"935\" height=\"698\" \/><figcaption id=\"caption-attachment-1498\" class=\"wp-caption-text\">pgAdmin 4 : Installation steps on centOS 7 &#8211; pgAdmin Home Page<\/figcaption><\/figure>\n<p>Click on Add New Server, to manage a PostgreSQL server.<\/p>\n<p>In <strong>General Tab,<\/strong><\/p>\n<p><strong>Name : <\/strong>Enter your server ip address or hostname.<\/p>\n<figure id=\"attachment_1500\" aria-describedby=\"caption-attachment-1500\" style=\"width: 1024px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1500 size-large\" src=\"http:\/\/www.webhostingchennai.co.in\/blog\/wp-content\/uploads\/2019\/04\/Pgadmin3-1024x612.jpg\" alt=\"pgAdmin 4 : Installation steps on centOS 7 - Adding New PostgreSQL Instance\" width=\"1024\" height=\"612\" \/><figcaption id=\"caption-attachment-1500\" class=\"wp-caption-text\">pgAdmin 4 : Installation steps on centOS 7 &#8211; Adding New PostgreSQL Instance<\/figcaption><\/figure>\n<p><strong>Connection Tab:<\/strong><\/p>\n<p><strong>Hostname\/address:-<\/strong> Hostname or IP Address of PostgreSQL server<br \/>\n<strong>Port:-<\/strong> 5432 (Leave default) \u2013 Change it if required<br \/>\n<strong>Username:-<\/strong> Username by which you are connecting.<br \/>\n<strong>Password:-<\/strong> Password for the user<\/p>\n<p>Make sure you have enabled the port 5432 in your server<\/p>\n<p>if not enable the port using the below commands.<\/p>\n<pre>firewall-cmd --zone=public --permanent --add-port=5432\/tcp\r\nfirewall-cmd --reload<\/pre>\n<figure id=\"attachment_1501\" aria-describedby=\"caption-attachment-1501\" style=\"width: 1024px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1501 size-large\" src=\"http:\/\/www.webhostingchennai.co.in\/blog\/wp-content\/uploads\/2019\/04\/Pgadmin4-1024x621.jpg\" alt=\"pgAdmin 4 : Installation steps on centOS 7 - PostgreSQL Instance Details\" width=\"1024\" height=\"621\" \/><figcaption id=\"caption-attachment-1501\" class=\"wp-caption-text\">pgAdmin 4 : Installation steps on centOS 7 &#8211; PostgreSQL Instance Details<\/figcaption><\/figure>\n<p>Click Save to save the changes. Now you can see the server you have added.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-1502\" src=\"http:\/\/www.webhostingchennai.co.in\/blog\/wp-content\/uploads\/2019\/04\/Pgadmin6-1024x620.jpg\" alt=\"\" width=\"1024\" height=\"620\" \/><\/p>\n<p>If you are getting\u00a0<strong>Fatal: Ident authentication failed for user<\/strong> error, edit the below file and modify the authentication.<\/p>\n<pre>nano\/var\/lib\/pgsql\/11\/data\/pg_hba.conf<\/pre>\n<p>modify the file as below<\/p>\n<pre># TYPE  DATABASE        USER            ADDRESS                 METHOD\r\n\r\nhost     all            all              all                     md5<\/pre>\n<p>Restart the PostgreSQL service.<\/p>\n<pre>systemctl restart postgresql-11<\/pre>\n<p>OR<\/p>\n<pre>systemctl restart postgresql-10\r\n\r\n\r\n<\/pre>\n<p>Now, pgAdmin4 is installed on our sever, hope this post is helpful.<\/p>\n<p><a href=\"https:\/\/www.webhostingchennai.co.in\/blog\/how-to-install-postgresql\/\" rel=\"nofollow noopener\" target=\"_blank\">To Install PostgreSQL 11 \/ 10 on CentOS 7 : Click Here<\/a><\/p>\n<p>Please share your valuable comments to improve us.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>pgAdmin 4 : Installation steps on centOS 7 pgAdmin,\u00a0 a free and open source management tool for PostgreSQL and derivative relation databases like EDB Advanced Server. This can be installed on multiple OS platforms like Linux, Unix, Mac OS X, and Windows to manage PostgreSQL 9.2 and above. pgAdmin can be run as both web [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1560,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[13,5],"tags":[69,70,71],"class_list":["post-1496","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos-7-rhel-7","category-database","tag-pgadmin-installation-steps","tag-pgadmin4","tag-pgadmin4-installation-on-centos-7"],"_links":{"self":[{"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/1496","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/comments?post=1496"}],"version-history":[{"count":3,"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/1496\/revisions"}],"predecessor-version":[{"id":1537,"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/1496\/revisions\/1537"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/media\/1560"}],"wp:attachment":[{"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/media?parent=1496"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/categories?post=1496"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/tags?post=1496"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}