# 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;
