All manual sections

DocumentationPostgreSQL

PostgreSQL

Next to MySQL/MariaDB the panel also manages PostgreSQL, for the applications that need it (many Python and Node.js applications, Odoo, Mastodon, analytics tools). It is on the Databases page, PostgreSQL box.

Installing it

PostgreSQL is not installed with the panel: the first time an administrator presses Install PostgreSQL (about a minute). The panel installs the Ubuntu package, configures it to accept connections from the server itself only (localhost, port 5432, passwords hashed with scram-sha-256) and installs Adminer to manage the data from the browser. From then on the accounts create their own databases too.

If you import a cPanel backup that contains PostgreSQL databases, the panel installs it by itself during the import.

Databases and users

  • Each database has an owner user with the same name (or the one you choose) and a generated password, shown only once together with the connection string postgresql://user:password@localhost:5432/database.
  • A database belongs to a site, so to its account: accounts see and manage their own only. No other user can connect to a database that is not theirs.
  • New password generates a new password for the owner: then update the application's configuration.
  • Deleting a site also deletes its PostgreSQL databases.

Adminer

Open Adminer opens Adminer in a new tab, already inside the database, without asking for a password: the panel creates a temporary user (valid one hour, with the permissions of the database owner) and a link that works once within 60 seconds, like phpMyAdmin. Logging out of Adminer deletes the temporary user. Adminer is on port 8446 of the panel and reaches only this server's PostgreSQL.

Importing a database

Import takes a .sql or .sql.gz file or a pg_dump archive (custom -Fc or tar -Ft format), up to 4 GB. It is loaded with the permissions of the database owner: a file cannot do anything the owner cannot do, and the psql commands that run programs or read the server's files are turned off. The tables the file recreates are replaced.

Backups and migrations

  • Site backups include its PostgreSQL databases (pg_dump, custom format) next to the MySQL ones; restoring the databases imports them again.
  • The migration from a full cPanel backup also imports the PostgreSQL databases (psql/ folder), with a new user and a new password shown in the summary. Update the application's configuration with the new data: the panel rewrites automatically only the MySQL configuration of WordPress, Joomla and Laravel.

Good to know

  • PostgreSQL uses little memory when idle (about 45 MB measured on Ubuntu 24.04, PostgreSQL 16), more with many connections: applications should use a connection pool.
  • The databases accept connections from localhost only: to work on them from your computer use Adminer or an SSH tunnel.