# Install PostgreSQL

## Overview and generalities

* By default every Postgres installation comes with one database already created called "postgres"
* This is important because Postgres requires you to specify the name of the database to make a connection, so there needs to always be one database
* [Postgres Downloads URL](https://www.postgresql.org/download/)

## Linux Debian

* Install Packages

```bash
sudo apt update && sudo apt install postgresql postgresql-contrib
```

* Once the installation is complete, the PostgreSQL service will start. To verify the installation, use the <mark style="color:orange;">`psql`</mark> tool to print the server version

```bash
sudo -u postgres psql -c "SELECT version();"
```

{% hint style="info" %}
Output should look like:

```bash
PostgreSQL 11.5 (Debian 11.5-1+deb10u1) on x86_64-pc-linux-gnu, 
compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
```

{% endhint %}

## Windows

* Download installer from the [Postgres Downloads URL](https://www.postgresql.org/download/)
* Follow the Wizard like any other app
* Select path where you want installed (Usually left default)
* Select additional components to be installed

![](/files/SVDGdO4C4RpKGFXnSE7U)

* Pass in the password for the superuser

![](/files/a41BRBt4jvADRlaEwViV)

* Pass in the Database Port (Default: 5432)&#x20;
* Click next on the rest and this will start the install


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.arkannis.net/database/postgresql/install-postgresql.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
