Question

installing pgadminj4 web version ubuntu nginx

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


Submit an answer


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!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

KFSys
Site Moderator
Site Moderator badge
April 14, 2025

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.

alexdo
Site Moderator
Site Moderator badge
April 14, 2025

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

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.