温馨提示×

ubuntu怎么启动pgadmin

小樊
40
2026-09-27 22:23:28
栏目: 智能运维

在 Ubuntu 上启动 pgAdmin 取决于你安装的方式,常见有 桌面版(pgAdmin 4 Desktop) 和 Web 版(pgAdmin 4 Server Mode) 两种。


一、如果你安装的是 pgAdmin 4 桌面版

1. 通过应用菜单启动

  • 点击 “显示应用程序”(九个点)
  • 搜索 pgAdmin 4
  • 点击图标启动

2. 通过命令行启动

pgadmin4

或

pgadmin4-desktop

(具体命令取决于安装方式)


二、如果你安装的是 pgAdmin 4 Web 版(Server Mode)

1. 启动 Apache 服务(常见方式)

如果你是通过 apt 安装的 pgAdmin 4:

sudo systemctl start apache2

然后在浏览器访问:

http://localhost/pgadmin4

2. 设置开机自启(可选)

sudo systemctl enable apache2

三、如果你是用 pip 安装的 pgAdmin 4

pgadmin4

或

python3 -m pgadmin4

首次启动会让你设置登录邮箱和密码。


四、常见问题排查

1. 命令找不到

which pgadmin4

如果没有结果,可能是没装桌面版:

sudo apt install pgadmin4-desktop

2. 浏览器打不开

确认服务是否在运行:

sudo systemctl status apache2

3. 端口被占用

默认是 80 或 5050,可在配置文件中修改。


如果你愿意,可以告诉我:

  • Ubuntu 版本
  • pgAdmin 安装方式(apt / pip / 源码)

我可以给你更精确的启动方法。

0 踩