I am following the tutorial https://www.digitalocean.com/community/tutorials/how-to-install-configure-pgadmin4-server-mode
It is outdated unfortunately and while I managed to correct the command of setup.py into python setup.py add-user --admin mymail@mail.com mypass I get an error that the pgadmin4.db has not been created. The installation process does create the sessions and the storage directories but never the database pgadmin4.db
so when it is going to read the file config_local dot py:
LOG_FILE = '/var/log/pgadmin4/pgadmin4.log'
SQLITE_PATH = '/var/lib/pgadmin4/pgadmin4.db'
SESSION_DB_PATH = '/var/lib/pgadmin4/sessions'
STORAGE_DIR = '/var/lib/pgadmin4/storage'
SERVER_MODE = True
it complains that the pgadmin4.db does not exist
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Heya,
After installing pgAdmin and setting your configuration (like config_local.py
), you must manually trigger the database initialization using python setup.py
.
But first, ensure the required paths and permissions are set properly. From the pgAdmin installation directory (e.g., /usr/pgadmin4/web/
or wherever it was extracted), run:
python setup.py
This will prompt for your admin email and password and automatically create the
pgadmin4.db
.
Alternatively, if you already provided them using add-user
, the regular setup.py
call is still required to trigger the initial DB setup.
After that, confirm the database file is created:
ls -l /var/lib/pgadmin4/pgadmin4.db
Now you should be able to run python pgAdmin4.py
. If you’re using a Python virtual environment, make sure you’re in it when running the above commands.
Heya, @977ef09003a542a28c2984affdd220
You can run python setup.py
from the pgAdmin install directory to initialize the DB — even if you’ve already added a user. Make sure directories in config_local.py
exist and are writable.
After that, pgadmin4.db
should be created and python pgAdmin4.py
will work.
Let us know how it goes
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.