> For the complete documentation index, see [llms.txt](https://aws-postgresql-docs.beliciarodriguez.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aws-postgresql-docs.beliciarodriguez.com/ubuntu-configuring-instance/add-postgresql-roles.md).

# Add Role to PostgreSQL Server

To start using PostgreSQL, we will need a user and a database.

First, we'll switch to the postgres user account on our instance.&#x20;

```
sudo su postgres
```

To run PostgresSQL, type

```
psql
```

In the next two lines, we'll create a user role who will be able to login and create databases ([3](https://medium.com/better-programming/how-to-provision-a-cheap-postgresql-database-in-aws-ec2-9984ff3ddaea)). Replace `username` and `'password'` with your own:

```sql
CREATE ROLE username 
WITH SUPERUSER CREATEDB CREATEROLE LOGIN ENCRYPTED PASSWORD 'password';
```

To stop running PostgresSQL, type

```sql
\q
```

To log out of the postgres account, type

```sql
exit
```
