This plugin integrates PostgreSQL database management into the DirectAdmin control panel, allowing administrators and users to manage PostgreSQL databases through the DirectAdmin interface.
-
Admin Panel:
- Install and manage PostgreSQL server
- Create and manage databases
- Create and manage database users
- View PostgreSQL status and statistics
- Configure PostgreSQL settings
-
User Panel:
- Create and manage PostgreSQL databases
- View database credentials
- Access database statistics
-
Integration:
- Full DirectAdmin CustomBuild integration
- DirectAdmin Plugin Manager support
- Automatic updates
- User and database synchronization with DirectAdmin accounts
- DirectAdmin 1.60.0 or later
- CentOS 7/8, AlmaLinux 8, Rocky Linux 8, Debian 10/11, or Ubuntu 20.04/22.04
- Root access to the server
- SSH into your server as root
- Run CustomBuild commands to install the plugin:
cd /usr/local/directadmin/custombuild ./build set postgresql yes ./build update ./build postgresql
This will:
- Download the latest version of the plugin
- Install PostgreSQL if not already installed
- Configure PostgreSQL for DirectAdmin integration
- Install the plugin files in DirectAdmin's plugin directory
- Register the plugin with DirectAdmin
- Create necessary hooks for user creation and deletion
- Log in to DirectAdmin as admin
- Navigate to the Plugin Manager
- Click on "Install Plugin from URL"
- Enter the plugin URL:
https://codecore.codes/software/postgresql_plugin-2.2.tar.gz
- Click "Install"
The Plugin Manager will handle the installation process automatically.
-
Download the latest release package to your server:
wget https://codecore.codes/software/postgresql_plugin-2.2.tar.gz
-
Extract the package:
tar -xzf postgresql_plugin-2.2.tar.gz
-
Navigate to the extracted directory:
cd postgresql_plugin-2.2
-
Run the installation script:
bash install.sh
The script will:
- Install PostgreSQL if not already installed
- Configure PostgreSQL for DirectAdmin integration
- Install the plugin files in DirectAdmin's plugin directory
- Register the plugin with DirectAdmin
- Create necessary hooks for user creation and deletion
-
Download and unzip the plugin package:
wget https://github.com/embire2/PostgreSQL-Plugin-for-Direct-Admin/raw/main/DirectAdmin-PostgreSQLv2_0.zip unzip DirectAdmin-PostgreSQLv2_0.zip -d postgresql_plugin
-
Copy the plugin files to DirectAdmin's plugin directory:
mkdir -p /usr/local/directadmin/plugins/postgresql_plugin cp -rf postgresql_plugin/* /usr/local/directadmin/plugins/postgresql_plugin/
-
Set proper permissions:
chown -R diradmin:diradmin /usr/local/directadmin/plugins/postgresql_plugin chmod -R 755 /usr/local/directadmin/plugins/postgresql_plugin chmod +x /usr/local/directadmin/plugins/postgresql_plugin/exec/*.sh chmod +x /usr/local/directadmin/plugins/postgresql_plugin/hooks/*.sh chmod +x /usr/local/directadmin/plugins/postgresql_plugin/scripts/*.sh
-
Register hooks with DirectAdmin:
ln -sf /usr/local/directadmin/plugins/postgresql_plugin/hooks/postgresql_create_user.sh /usr/local/directadmin/scripts/custom/postgresql_create_user.sh ln -sf /usr/local/directadmin/plugins/postgresql_plugin/hooks/postgresql_delete_user.sh /usr/local/directadmin/scripts/custom/postgresql_delete_user.sh
-
Install PostgreSQL if not already installed:
bash /usr/local/directadmin/plugins/postgresql_plugin/scripts/install_postgresql.sh
-
Configure PostgreSQL for DirectAdmin integration:
bash /usr/local/directadmin/plugins/postgresql_plugin/exec/postgres_control.sh configure
-
Register the plugin with DirectAdmin:
echo "postgresql_plugin=2.0" >> /usr/local/directadmin/conf/plugins.conf
-
Restart DirectAdmin:
service directadmin restart
After installation, you can access the plugin at:
- Admin Access: https://your-server:2222/CMD_PLUGINS/postgresql_plugin
- User Access: https://your-server:2222/CMD_PLUGINS/postgresql_plugin
- SSH into your server as root
- Run CustomBuild commands to uninstall the plugin:
cd /usr/local/directadmin/custombuild ./build set postgresql no ./build postgresql uninstall
This method ensures a clean removal with proper cleanup.
- Log in to DirectAdmin as admin
- Navigate to the Plugin Manager
- Locate the PostgreSQL plugin in the list
- Click "Uninstall" next to the plugin
- Navigate to the plugin directory
cd /usr/local/directadmin/plugins/postgresql_plugin
- Run the uninstallation script:
bash uninstall.sh
The script will prompt you to choose whether to uninstall PostgreSQL and remove all data, or just remove the plugin while preserving the PostgreSQL installation and data.
-
Remove DirectAdmin hooks:
rm -f /usr/local/directadmin/scripts/custom/postgresql_create_user.sh rm -f /usr/local/directadmin/scripts/custom/postgresql_delete_user.sh
-
Remove the plugin from DirectAdmin's plugin configuration:
sed -i '/^postgresql_plugin=/d' /usr/local/directadmin/conf/plugins.conf
-
Remove the plugin directory:
rm -rf /usr/local/directadmin/plugins/postgresql_plugin
-
Optionally, uninstall PostgreSQL:
- For CentOS/RHEL:
yum remove postgresql postgresql-server
- For Debian/Ubuntu:
apt-get remove postgresql postgresql-client
- For CentOS/RHEL:
-
Restart DirectAdmin:
service directadmin restart
Check the installation logs at /usr/local/directadmin/logs/postgresql_install.log
for details about any installation issues.
- Permission denied errors: Ensure all script files are executable (
chmod +x
) - PostgreSQL connection errors: Check PostgreSQL is running and properly configured
- Hook not working: Verify the hook symbolic links are correct
- CustomBuild errors: Check CustomBuild logs in
/usr/local/directadmin/custombuild/custom_build.log
If you encounter issues with CustomBuild installation:
-
Update CustomBuild database:
cd /usr/local/directadmin/custombuild ./build update
-
Verify the plugin is set correctly:
./build show|grep postgresql
-
Check CustomBuild cache:
./build cache
-
For more detailed information, run:
./build postgresql debug
For a more comprehensive guide to troubleshooting CustomBuild-related issues, see CUSTOMBUILD_INTEGRATION.md.
For support, please open an issue in the GitHub repository or contact your DirectAdmin support representative.
This plugin is released under the MIT License. See the LICENSE file for details.