如何在 Ubuntu 22.04 LTS 上安装 pgAdmin
admin
2023-07-31 03:28:18
0

pgAdmin 是一个最受欢迎且功能丰富的开源 PostgreSQL 管理和开发平台,可在 Linux、Unix、macOS 和 Windows 上运行。ubuntu-logo-22-04-lts-6ubuntu-logo-22-04-lts-6

在 Ubuntu 22.04 LTS Jammy Jellyfish 上安装 pgAdmin

apt步骤 1. 首先,通过在终端中运行以下命令,确保所有系统包都是最新的。

sudo apt update
sudo apt upgrade
sudo apt install software-properties-common apt-transport-https wget ca-certificates libpq5 gnupg2

步骤 2. 在 Ubuntu 22.04 上安装 pgAdmin。

默认情况下,pgAdmin 在 Ubuntu 22.04 基础存储库中不可用。现在运行以下命令将 pgAdmin 存储库添加到您的 Ubuntu 系统:

sudo sh -c \'echo \"deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main\" > /etc/apt/sources.list.d/pgadmin4.list\'-c \'echo \"deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main\" > /etc/apt/sources.list.d/pgadmin4.list\'

接下来,使用以下命令导入 GPG 密钥:

curl  -fsSL https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/pgadmin.gpg-fsSL https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/pgadmin.gpg

启用存储库后,现在使用以下命令安装最新版本的 pgAdmin:

sudo apt update
sudo apt install pgadmin4

步骤 3. 为 pgAdmin 配置 Apache Web 服务器。

现在我们使用以下命令启动 Apache Web 服务器配置:

sudo /usr/pgadmin4/bin/setup-web.sh/usr/pgadmin4/bin/setup-web.sh

输出:

Setting up pgAdmin 4 in web mode on a Debian based platform... up pgAdmin 4 in web mode on a Debian based platform...
Creating configuration database...Creating configuration database...
NOTE: Configuring authentication for SERVER mode.: Configuring authentication for SERVER mode.

Enter the email address and password to use for the initial pgAdmin user account:

Email address: ngadimin@idroot.us
Password: 
Retype password:
pgAdmin 4 - Application Initialisation
======================================

Creating storage and log directories...
We can now configure the Apache Web server for you. This involves enabling the wsgi module and configuring the pgAdmin 4 application to mount at /pgadmin4. Do you wish to continue (y/n)? y
The Apache web server is running and must be restarted for the pgAdmin 4 installation to complete. Continue (y/n)? y
Apache successfully restarted. You can now start using pgAdmin 4 in web mode at http://127.0.0.1/pgadmin4

当上述脚本运行时,输入您将用于登录仪表板的电子邮件和密码。

步骤 4. 配置防火墙。

现在,我们使用 Apache 设置了一个简单防火墙 (UFW),以允许对 HTTP 和 HTTPS 的默认 Web 端口进行公共访问:

sudo ufw allow OpenSSH
sudo ufw allow \'Apache Full\'
sudo ufw enable

步骤 5. 访问 pgAdmin Web 界面。

成功安装后,打开您的 Web 浏览器并使用 URL 访问 pgAdmin Web UI 。您将被重定向到以下页面:http://your-IP-addresss/pgadmin4

pgadmin4-login-pagepgadmin4-login-page

感谢您使用本教程在 Ubuntu 22.04 LTS Jammy Jellyfish 系统上安装 pgAdmin4。如需更多帮助或有用信息,我们建议您查看官方 pgAdmin 网站。

相关内容

热门资讯

Windows 11 和 10... Windows 11/10 文件夹属性中缺少共享选项卡 – 已修复 1.检查共享选项卡是否可用 右键...
事件 ID 7034:如何通过... 点击进入:ChatGPT工具插件导航大全 服务控制管理器 (SCM) 负责管理系统上运行的服务的活动...
Radmin VPN Wind... Radmin VPN 是一款免费且用户友好的软件,旨在牢固地连接计算机以创建一个有凝聚力的虚拟专用网...
Hive OS LOLMine... 目前不清退的交易所推荐: 1、全球第二大交易所OKX欧意 国区邀请链接: https://www.m...
如何修复 Steam 内容文件... Steam 内容文件锁定是当您的 Steam 文件无法自行更新时出现的错误。解决此问题的最有效方法之...
Hive OS 部署 PXE ... 目前不清退的交易所推荐: 1、全球第二大交易所OKX欧意 国区邀请链接: https://www.m...
如何在电报Telegram中隐... 点击进入:ChatGPT工具插件导航大全 在Android上的电报中隐藏您的电话号码 您可以通过切换...
farols1.1.501.0... faro ls 1.1.501.0(64bit)可以卸载,是一款无需连接外部PC机或笔记本计算机即可...
在 iCloud 上关闭“查找... 如果您是 Apple 的长期用户,您肯定会遇到过 Find My 应用程序,它本机安装在 iPhon...
在 Windows 11 中打... 什么是链路状态电源管理? 您可以在系统控制面板的电源选项中看到链接状态电源管理。它是 PCI Exp...