One-to-install pgadmin4-download its Python wheel at https://www.postgresql.org/ftp/pgadmin3/pgadmin4/v1.0-beta1 /pip/and then use PIP to install it:
It is better to install with virtualenv
virtualevn pgadmin_installcd Pgadmin_installsource. /bin/Install <name of the pgadmin wheel download from https://www.pgadmin.org/ Download/pgadmin-4-python-wheel/>
According to Https://www.pgadmin.org/download/pip4.php, to run PGADMIN4, do the following:
and add following code in your config_local.py which are in the same location with config.py, if you install it with Virtua Lenv, the config_local.py should locate in ~/pgadmin4/lib/python2.7/site-packages/pgadmin4
ImportOsdata_dir= Os.path.realpath (Os.path.expanduser (U'~/.pgadmin/')) Log_file= Os.path.join (Data_dir,'Pgadmin4.log') Sqlite_path= Os.path.join (Data_dir,'pgadmin4.db') Session_db_path= Os.path.join (Data_dir,'Sessions') Storage_dir= Os.path.join (Data_dir,'Storage')
Once installed, you'll need to create a config_local.py file in the same directory as config.py. On a machine with a virtual environment created at ~/PGADMIN4, this is~/pgadmin4/lib/python2.7/site-packages/pgadmin4. Ensure set values for the Secret_key, Security_password_salt and Csrf_session_key settings at bare minimum-see confi g.py for more information and other settings so can be customised. In order to reference and variables from config.py, you may need to include from config import *at the top of Config_loc al.py.
Pgadmin can now is run with a command like Python ~/pgadmin4/lib/python2.7/site-packages/pgadmin4/pgadmin4.py. Finally, point your browser to http://127.0.0.1:5050.
ref:https://askubuntu.com/questions/788457/how-to-install-pgadmin-4-in-server-mode-on-ubuntu-16-04
Https://stackoverflow.com/questions/46707935/oserror-errno-13-permission-denied-var-lib-pgadmin
Ubuntu installation Pgadmin 4