title: Start and Stop pgAdmin4 correctly on Ubuntu 16.04
body: <p>I'm working on a project that involves the creation of a dashboard (SpringBoot + angular.js webapp) for the interrogation of Zabbix. For the purpose of testing I installed Ubuntu 16.04 LTS (VirtualBox), PostgreSQL 9.6 in which I imported by command line the database dump (pg_dump) made by the customer and also installed the GUI pgAdmin4 and connected it to the db I restored.</p>
  
  <p>now I have installed pgAdmin4 this way:</p>
  
  <p>as root:</p>
  
  <pre><code>sudo apt-get install build-essential libssl-dev libffi-dev libgmp3-dev virtualenv python-pip libpq-dev python-dev
  cd /opt/
  mkdir enviromentpy
  cd enviromentpy/
  virtualenv pgadmin4
  cd pgadmin4
  source bin/activate
  wget https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v2.1/pip/pgadmin4-2.1-py2.py3-none-any.whl
  pip install pgadmin4-2.1-py2.py3-none-any.whl
  touch lib/python2.7/site-packages/pgadmin4/config_local.py
  echo "SERVER_MODE = False" &gt;&gt; lib/python2.7/site-packages/pgadmin4/config_local.py
  </code></pre>
  
  <p>After that launching</p>
  
  <pre><code>python lib/python2.7/site-packages/pgadmin4/pgAdmin4.py
  </code></pre>
  
  <p>I see the following output:</p>
  
  <pre><code>pgAdmin4 started, go to http://127.0.0.1:5050 through your browser
  </code></pre>
  
  <p>Now if I launch Firefox at above address I see the GUI and I have imported my postgres db's</p>
  
  <p>Question is:</p>
  
  <p>1) How can I stop correctly the service?? I mean the pgAdmin GUI not the postgres DBMS</p>
  
  <p>2) To start it again I made this procedure:</p>
  
  <pre><code>cd /opt/enviromentpy
  virtualenv pgadmin4
  cd pgadmin4
  source bin/activate
  python lib/python2.7/site-packages/pgadmin4/pgAdmin4.py
  </code></pre>
  
  <p>Is it correct??</p>
  
  <p>3) Sometimes, after a period of inactivity, ubuntu freeze, no activity is possible and I can only turn off the machine through the virtualbox menu. Do you know why?</p>
  
  <p>Can you help me??</p>
  
  <p>Thanks a lot</p>