# tuna and PostgreSQL

## Step 1. Download the client

Instructions are available on the [installation page](https://tuna.am/en/docs/guides/install.md).

## Step 2. Start the PostgreSQL server

To run with Docker, you can use the command:

```bash
docker run -p 5432:5432 -e POSTGRES_PASSWORD=postgres postgres:15

```

## Step 3. Run tuna

PostgreSQL uses port `5432` by default:

```bash
tuna postgres 5432

```

As a result of running the command, a connection address will be displayed on the screen (for example, `ru.tuna.am:12345`), which can now be used to connect to PostgreSQL, for example:

```bash
psql -h ru.tuna.am -p 12345 -U postgres -d postgres

```

When running the [Postgres tunnel](https://tuna.am/en/docs/tunnels/postgres.md), you will be provided with a link to the inspector for viewing sessions and executed queries.
