Vue normale

Reçu aujourd’hui — 30 juillet 2025PAB's blog

PgAdmin 4 on Debian 13 Trixie

30 juillet 2025 à 10:03

As I speak, there is no repository for PgAdmin4 targeting Debian 13 Trixie. I have no doubt this will change soon with the official release of Debian Trixie in a few days.

If you are impatient, it is however possible to install PgAdmin4 as a Python library and launch it as a service for easy use.

Here is how you can proceed.

As root or with sudo, create a pgadmin4 folder in /opt and change the owner for non-root user

sudo mkdir /opt/pgadmin4
sudo chown $USER /opt/pgadmin4

Now is time to create the folders needed by pgadmin4 to operate:

sudo mkdir /var/lib/pgadmin
sudo mkdir /var/log/pgadmin
sudo chown $USER /var/lib/pgadmin
sudo chown $USER /var/log/pgadmin

Then it is possible to install pgadmin4 in a virtualenv :

cd /opt/pgadmin4
python3 -m venv pgadmin4
source pgadmin4/bin/activate
pip install pgadmin4

and to launch pgadmin4:

pgadmin4

If it launches well, you can visit http://127.0.0.1:5050/ with your browser to start using pgadmin4.

If you would like pgadmin4 server to start as a service, you can create a pgadmin4.service file in /etc/systemd/system/ with the following content:

[Unit]
Description=Pgadmin4 Service
After=network.target

[Service]
User=pab
Group=pab
WorkingDirectory=/opt/pgadmin4/pgadmin4
Environment="PATH=/opt/pgadmin4/pgadmin4/bin"
ExecStart=/opt/pgadmin4/pgadmin4/bin/pgadmin4
PrivateTmp=true

[Install]
WantedBy=multi-user.target

You can then start and enable it:

systemctl daemon-reload
systemctl start pgadmin4
systemctl enable pgadmin4
❌