PostgreSQL is a powerful, open source object-relational database system that is easy to deploy in containers. In this article, we will look at how to quickly install a PostgreSQL server in Portainer using a ready-made template.

Requirements:

1. Log in to your Portainer instance and select the “PostgreSQL with Adminer” template:

2. Fill in or change the required fields:

Where:

  1. Name – stack name (anything you understand);
  2. PostgreSQL Password – password for the privileged user;
  3. PostgreSQL User – name of the privileged user;
  4. PostgreSQL Database – name of the database to be created;
  5. PostgreSQL version – PostgreSQL server version tag (you can find the actual tags on Dockerhub).

Click “Deploy the stack” and wait for the message about successful installation.

3. If your PostgreSQL server use case requires external access, select your stack, follow the instructions in the screenshot, and uncomment the ports.

4. To access Adminer for your PostgreSQL server, you need to expose it through Nginx Proxy Manager. Simply create a new Proxy Host, point it to the container’s internal Adminer port (usually 8080), assign your desired domain name, and enable SSL if required. After that, you’ll be able to reach Adminer via your chosen domain in a browser.