
With the database server initialized, the next step is to start the PostgreSQL service and enable the PostgreSQL service to be automatically launched at system startup, for which we will execute the following commands in their order: The directory where we will find all PostgreSQL configuration files is located in the path: /var/lib/postgresql/9.6/main Start & Enable PostgreSQL Server In the case of Debian and Ubuntu, the database starts automatically. Once the operating system has been updated, we will run the following command for the installation of the PostgreSQL server: apt install postgresql-9.6 Then, upgrade the system sudo apt update Install PostgreSQL Server

Next, we will import the signature key of the repository and update the system package lists by first executing the following command: wget -quiet -O - | sudo apt-key add – Save the changes using the keys Ctrl + O, and we left the editor using Ctrl + X.

Once the file is created we will add the next line taking into account the version of Debian or Ubuntu to use: Debian 9 Strecht: deb stretch-pgdg main This official PostgreSQL APT repository that we will install will be combined with the operating system offering automatic updates for all compatible versions of PostgreSQL in the Debian and Ubuntu distributions.įor this process we will create a new file by executing the following line: /etc/apt//pgdg.list

Note: We must prefix sudo for the correct execution of the described commands.
