{"id":12372,"date":"2019-03-26T21:52:11","date_gmt":"2019-03-26T21:52:11","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=12372"},"modified":"2019-03-26T21:52:11","modified_gmt":"2019-03-26T21:52:11","slug":"how-to-install-pgadmin4-in-centos-7","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/26\/how-to-install-pgadmin4-in-centos-7\/","title":{"rendered":"How to Install pgAdmin4 in CentOS 7"},"content":{"rendered":"<p><strong>PgAdmin4<\/strong>\u00a0is a easy to use web interface for managing PostgreSQL databases. It can be used on multiple platforms such as Linux, Windows and Mac OS X. In pgAdmin 4 there is migration from bootstrap 3 to bootstrap 4.<\/p>\n<p>In this tutorial we are going to install\u00a0<strong>pgAdmin 4<\/strong>\u00a0on a\u00a0<strong>CentOS 7<\/strong>\u00a0system.<\/p>\n<p><strong>Note<\/strong>: This tutorial assumes that you already have PostgreSQL 9.2 or above installed on your CentOS 7. For instructions how to install it, you can follow our guide:\u00a0<a href=\"https:\/\/www.tecmint.com\/install-postgresql-on-centos-rhel-fedora\/\" target=\"_blank\" rel=\"noopener\">How to install PostgreSQL 10 on CentOS and Fedora<\/a>.<\/p>\n<h3>How to Install pgAdmin 4 in CentOS 7<\/h3>\n<p>This step should have been completed upon the installation of PostgreSQL, but if you haven\u2019t, you can complete it with:<\/p>\n<pre># yum -y install https:\/\/download.postgresql.org\/pub\/repos\/yum\/11\/redhat\/rhel-7-x86_64\/pgdg-centos11-11-2.noarch.rpm\r\n<\/pre>\n<p><center>Now you are ready to install pgAdmin with:<\/center><\/p>\n<pre># yum -y install pgadmin4\r\n<\/pre>\n<p>During the installation, due to dependencies, the following two will be installed as well \u2013\u00a0<strong>pgadmin4-web<\/strong>\u00a0and\u00a0<strong>httpd web server<\/strong>.<\/p>\n<h3>How to Configure pgAdmin 4 in CentOS 7<\/h3>\n<p>There are few minor configuration changes that need to be done to have\u00a0<strong>pgAdmin4<\/strong>\u00a0running. First we will rename the sample conf file from\u00a0<strong>pgadmin4.conf.sample<\/strong>\u00a0to\u00a0<strong>pgadmin4.conf<\/strong>:<\/p>\n<pre># mv \/etc\/httpd\/conf.d\/pgadmin4.conf.sample \/etc\/httpd\/conf.d\/pgadmin4.conf\r\n<\/pre>\n<p>Adjust the file so it looks like this:<\/p>\n<pre>&lt;VirtualHost *:80&gt;\r\nLoadModule wsgi_module modules\/mod_wsgi.so\r\nWSGIDaemonProcess pgadmin processes=1 threads=25\r\nWSGIScriptAlias \/pgadmin4 \/usr\/lib\/python2.7\/site-packages\/pgadmin4-web\/pgAdmin4.wsgi\r\n\r\n&lt;Directory \/usr\/lib\/python2.7\/site-packages\/pgadmin4-web\/&gt;\r\n        WSGIProcessGroup pgadmin\r\n        WSGIApplicationGroup %{GLOBAL}\r\n        &lt;IfModule mod_authz_core.c&gt;\r\n                # Apache 2.4\r\n                Require all granted\r\n        &lt;\/IfModule&gt;\r\n        &lt;IfModule !mod_authz_core.c&gt;\r\n                # Apache 2.2\r\n                Order Deny,Allow\r\n                Deny from All\r\n                Allow from 127.0.0.1\r\n                Allow from ::1\r\n        &lt;\/IfModule&gt;\r\n&lt;\/Directory&gt;\r\n&lt;\/VirtualHost&gt;\r\n<\/pre>\n<p>Next we will create logs and lib directories for\u00a0<strong>pgAdmin4<\/strong>\u00a0and set their ownership:<\/p>\n<pre># mkdir -p \/var\/lib\/pgadmin4\/\r\n# mkdir -p \/var\/log\/pgadmin4\/\r\n# chown -R apache:apache \/var\/lib\/pgadmin4\r\n# chown -R apache:apache \/var\/log\/pgadmin4\r\n<\/pre>\n<p>And then we can extend the contents of our\u00a0<strong>config_distro.py<\/strong>.<\/p>\n<pre># vi \/usr\/lib\/python2.7\/site-packages\/pgadmin4-web\/config_distro.py\r\n<\/pre>\n<p>And add the following lines:<\/p>\n<pre>LOG_FILE = '\/var\/log\/pgadmin4\/pgadmin4.log'\r\nSQLITE_PATH = '\/var\/lib\/pgadmin4\/pgadmin4.db'\r\nSESSION_DB_PATH = '\/var\/lib\/pgadmin4\/sessions'\r\nSTORAGE_DIR = '\/var\/lib\/pgadmin4\/storage'\r\n<\/pre>\n<p>Finally we will create our user account, with which we will authenticate in the web interface. To do this, run:<\/p>\n<pre># python \/usr\/lib\/python2.7\/site-packages\/pgadmin4-web\/setup.py\r\n<\/pre>\n<div id=\"attachment_31398\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/Create-PgAdmin4-User.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-31398\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/Create-PgAdmin4-User.png\" alt=\"Create PgAdmin4 User\" width=\"707\" height=\"194\" aria-describedby=\"caption-attachment-31398\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-31398\" class=\"wp-caption-text\">Create PgAdmin4 User<\/p>\n<\/div>\n<p>Now you can access your server\u2019s\u00a0<strong>http:\/\/ip-address\/pgadmin4<\/strong>\u00a0or\u00a0<strong>http:\/\/localhost\/pgadmin4<\/strong>\u00a0to reach the pgAdmin4 interface:<\/p>\n<div id=\"attachment_31399\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/PgAdmin4-Login.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-31399\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/PgAdmin4-Login.png\" sizes=\"auto, (max-width: 1357px) 100vw, 1357px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/PgAdmin4-Login.png 1357w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/PgAdmin4-Login-768x474.png 768w\" alt=\"PgAdmin4 Login\" width=\"1357\" height=\"838\" aria-describedby=\"caption-attachment-31399\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-31399\" class=\"wp-caption-text\">PgAdmin4 Login<\/p>\n<\/div>\n<p>To authenticate, use the email address and password that you have used earlier. Once authenticate, you should see the pgAdmin4 interface:<\/p>\n<div id=\"attachment_31400\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/PgAdmin4-Dashboard.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-31400\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/PgAdmin4-Dashboard.png\" sizes=\"auto, (max-width: 1357px) 100vw, 1357px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/PgAdmin4-Dashboard.png 1357w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/PgAdmin4-Dashboard-768x453.png 768w\" alt=\"PgAdmin4 Dashboard\" width=\"1357\" height=\"801\" aria-describedby=\"caption-attachment-31400\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-31400\" class=\"wp-caption-text\">PgAdmin4 Dashboard<\/p>\n<\/div>\n<p>At your first login, you will need to add a new server to manage. Click on \u201c<strong>Add New Server<\/strong>\u201d. You will need to configure the\u00a0<strong>PostgresQL<\/strong>\u00a0connection. In the first tab \u201c<strong>General<\/strong>\u201d, enter the following settings:<\/p>\n<ul>\n<li><strong>Name<\/strong>\u00a0\u2013 give name of the server you are configuring.<\/li>\n<li><strong>Comment<\/strong>\u00a0\u2013 leave a comment to give description of the instance.<\/li>\n<\/ul>\n<div id=\"attachment_31401\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/Add-New-Server-to-PgAdmin4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-31401\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/Add-New-Server-to-PgAdmin4.png\" alt=\"Add New Server to PgAdmin4\" width=\"517\" height=\"564\" aria-describedby=\"caption-attachment-31401\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-31401\" class=\"wp-caption-text\">Add New Server to PgAdmin4<\/p>\n<\/div>\n<p>The second tab \u201c<strong>Connection<\/strong>\u201d is more important one, as you will have to enter:<\/p>\n<ul>\n<li><strong>Host<\/strong>\u00a0\u2013 host\/IP address of the PostgreSQL instance.<\/li>\n<li><strong>Port<\/strong>\u00a0\u2013 default port is 5432.<\/li>\n<li><strong>Maintenance database<\/strong>\u00a0\u2013 this should be postgres.<\/li>\n<li><strong>Username<\/strong>\u00a0\u2013 the username which will be connecting. You can use postgres user.<\/li>\n<li><strong>Password<\/strong>\u00a0\u2013 password for the above user.<\/li>\n<\/ul>\n<div id=\"attachment_31402\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/PgAdmin4-Server-Connection-Settings.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-31402\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/PgAdmin4-Server-Connection-Settings.png\" alt=\"PgAdmin4 Server Connection Settings\" width=\"514\" height=\"564\" aria-describedby=\"caption-attachment-31402\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-31402\" class=\"wp-caption-text\">PgAdmin4 Server Connection Settings<\/p>\n<\/div>\n<p>When you have filled everything, Save the changes. If the connection was successful, you should see the following page:<\/p>\n<div id=\"attachment_31403\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/PgAdmin4-Database-Summary.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-31403\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/PgAdmin4-Database-Summary.png\" sizes=\"auto, (max-width: 1357px) 100vw, 1357px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/PgAdmin4-Database-Summary.png 1357w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/12\/PgAdmin4-Database-Summary-768x453.png 768w\" alt=\"PgAdmin4 Database Summary\" width=\"1357\" height=\"801\" aria-describedby=\"caption-attachment-31403\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-31403\" class=\"wp-caption-text\">PgAdmin4 Database Summary<\/p>\n<\/div>\n<p>This was it. Your\u00a0<strong>pgAdmin4<\/strong>\u00a0installation is complete and you can start managing your PostgreSQL database.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/install-pgadmin4-in-centos-7\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>PgAdmin4\u00a0is a easy to use web interface for managing PostgreSQL databases. It can be used on multiple platforms such as Linux, Windows and Mac OS X. In pgAdmin 4 there is migration from bootstrap 3 to bootstrap 4. In this tutorial we are going to install\u00a0pgAdmin 4\u00a0on a\u00a0CentOS 7\u00a0system. Note: This tutorial assumes that you &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/26\/how-to-install-pgadmin4-in-centos-7\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Install pgAdmin4 in CentOS 7&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-12372","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12372","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=12372"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12372\/revisions"}],"predecessor-version":[{"id":12378,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12372\/revisions\/12378"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=12372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=12372"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=12372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}