# Install PostgreSQL

In this section, we will be walk through setting up PostgreSQL on your Ubuntu instance.

### Update Ubuntu Machine

Before we install PostgreSQL into our instance, we must first update and upgrade our packages in the instance.&#x20;

```
sudo apt-get update -y && sudo apt-get upgrade -y
```

{% hint style="info" %}
The **-y** is a Linux flag that means to response "Yes" to any questions or prompts that appear in these commands.
{% endhint %}

### Install PostgreSQL

To install PostgreSQL, type the following line of code:

```bash
sudo apt install postgresql -y
```

That's it! PostgreSQL is now installed onto your machine. When you installed PostgreSQL, you also created a "postgres" user account.&#x20;


---

# 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://aws-postgresql-docs.beliciarodriguez.com/ubuntu-configuring-instance/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.
