> ## Documentation Index
> Fetch the complete documentation index at: https://docs.antryk.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PostgreSQL

> Deploy fully managed PostgreSQL databases on Antryk with automated backups, secure access control, scalable infrastructure, and production-ready performance.

## What is PostgreSQL?

PostgreSQL is a powerful open-source relational database system known for reliability, ACID compliance, extensibility, and advanced SQL capabilities. It is widely used for production applications that require strong consistency, scalability, and high-performance querying.

With Antryk PostgreSQL, you can provision production-ready databases in minutes while Antryk manages infrastructure, backups, networking, and operational reliability.

***

## PostgreSQL Features on Antryk

* Fully managed PostgreSQL deployments
* Multiple PostgreSQL version support
* Secure database access control
* Automated backups and retention management
* Regional database deployments
* Connection information dashboard
* Scalable plans for development and production
* Simplified database administration
* Secure credential management
* Production-ready infrastructure

***

# Guide On Deploying PostgreSQL Database

<iframe width="100%" height="500" src="https://www.youtube.com/embed/u8nBeh0sgBE" title="Deploy PostgreSQL on Antryk Cloud Platform and Connect pgAdmin in 5 Minutes — Database Tutorial" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen />

***

# Deploy a PostgreSQL Database

<img src="https://mintcdn.com/antryk/RuNfdeAligJ2s47J/images/db-deploy-pg.png?fit=max&auto=format&n=RuNfdeAligJ2s47J&q=85&s=bedf810bdb57c1f5baf2a93ad795fcb0" alt="PostgresSql Deploy Form One" width="1067" height="698" data-path="images/db-deploy-pg.png" />

<img src="https://mintcdn.com/antryk/RuNfdeAligJ2s47J/images/db-deploy-two.png?fit=max&auto=format&n=RuNfdeAligJ2s47J&q=85&s=1485e7585df49d7c4597da7dadcb4938" alt="PostgresSql Deploy Form One" width="1037" height="848" data-path="images/db-deploy-two.png" />

Creating a PostgreSQL database on Antryk takes only a few steps.

## Step 1: Choose Database Type

From the deployment dashboard:

1. Click **Create Database**
2. Select **PostgreSQL**

***

## Step 2: Select PostgreSQL Version

Choose the PostgreSQL version you want to deploy.

Example versions may include:

* PostgreSQL 14
* PostgreSQL 15
* PostgreSQL 16
* PostgreSQL 18

Using the latest stable version is recommended for new applications unless your application requires compatibility with an older version.

***

## Step 3: Configure Database Settings

Enter your database configuration details.

### Database Configuration Fields

| Field          | Description                         |
| -------------- | ----------------------------------- |
| Database Name  | Name of your PostgreSQL database    |
| Default Schema | Primary schema for your application |
| Username       | Database admin username             |
| Password       | Secure password for authentication  |

### Example Configuration

```bash theme={null}
Database Name: production_db
Default Schema: public
Username: admin_user
Password: ********
```

***

## Step 4: Select Deployment Region

Choose the region closest to your users or application infrastructure.

Available regions include:

* USA
* ASIA
* EUROPE

Selecting the nearest region helps reduce latency and improves application performance.

***

## Step 5: Configure Access Control

Antryk provides flexible database access management.

### Option 1: Allow Specific IP Addresses

Restrict database access to trusted IP addresses only.

Example:

```bash theme={null}
192.168.1.10
203.0.113.45
```

### Option 2: Allow All IPs

Enable public access from all IP addresses.

> Recommended only for development environments or temporary testing.

***

## Step 6: Configure Automated Backups

Automated backups help protect your data and simplify disaster recovery.

### Enable or Disable Backups

You can:

* Enable automated backups
* Disable automated backups

### Backup Frequency Options

If backups are enabled, choose a backup schedule:

* Hourly
* Daily
* Monthly

### Backup Retention Options

Select how long backups should be stored:

* 7 Days
* 14 Days
* 30 Days
* 90 Days

Example:

```bash theme={null}
Backup Frequency: Daily
Retention Period: 30 Days
```

***

## Step 7: Select a Plan

Choose a PostgreSQL plan based on your workload requirements.

Plans may vary based on:

* CPU
* Memory
* Storage
* Network performance
* Backup limits

***

## Step 8: Deploy Database

After completing configuration:

1. Review all settings
2. Click **Deploy Database**

Antryk will automatically provision your PostgreSQL instance and prepare it for use.

***

# PostgreSQL Database Overview Page

The **Overview** page provides essential database connection and deployment information.

<img src="https://mintcdn.com/antryk/RuNfdeAligJ2s47J/images/pg-overview.png?fit=max&auto=format&n=RuNfdeAligJ2s47J&q=85&s=395a698ff3040b0398c9f0c6de115673" alt="Postgres Database Detail Overview Page" width="1181" height="822" data-path="images/pg-overview.png" />

## Available Information

### Connection String

Use the generated PostgreSQL connection string directly in your applications.

Example:

```bash theme={null}
postgresql://username:password@host:5432/database
```

### Host

Database hostname used for external connections.

### Port

Default PostgreSQL port:

```bash theme={null}
5432
```

### Default Schema

The primary schema configured during deployment.

### Username

Database authentication username.

***

# PostgreSQL Settings Page

<img src="https://mintcdn.com/antryk/RuNfdeAligJ2s47J/images/pg-setting.png?fit=max&auto=format&n=RuNfdeAligJ2s47J&q=85&s=6f125e8742d483aff208d2286c2a96cc" alt="Postgres Database Detail Settings Page" width="1227" height="844" data-path="images/pg-setting.png" />

The **Settings** page allows you to manage database configuration and security.

## Available Settings

### Change Database Password

Rotate credentials securely without redeploying the database.

### Regenerate API Key

Generate a new API key for secure integrations.

### Rename Database

Update the database name when needed.

### Update Access Control

Modify IP allowlists or enable/disable public access.

### Delete Service

Permanently remove the PostgreSQL deployment.

> Warning: Deleting a service permanently removes the database and associated data.

***

# PostgreSQL Backup Page

<img src="https://mintcdn.com/antryk/RuNfdeAligJ2s47J/images/pg-backup.png?fit=max&auto=format&n=RuNfdeAligJ2s47J&q=85&s=9c37046c6c265faf87ff9031e7038332" alt="Postgres Database Detail Backup Page" width="1263" height="770" data-path="images/pg-backup.png" />

The **Backup** page allows you to manage backup configurations and retention settings.

## Backup Management Features

### Update Backup Frequency

Change backup schedules anytime:

* Hourly
* Daily
* Monthly

### Modify Retention Period

Adjust how long backups are stored:

* 7 Days
* 14 Days
* 30 Days
* 90 Days

### Enable or Disable Backups

Turn automated backups on or off depending on project requirements.

***

# Security Features

Antryk PostgreSQL deployments include multiple security controls.

## Built-In Security

* IP-based access control
* Secure password authentication
* Encrypted connections
* Credential management
* Secure infrastructure isolation

***

# Common PostgreSQL Use Cases

PostgreSQL is suitable for many modern applications.

## Popular Use Cases

* SaaS applications
* Web applications
* REST APIs
* Financial systems
* Analytics platforms
* Content management systems
* E-commerce platforms
* Enterprise applications

***

# Connecting to PostgreSQL

Use the connection information from the Overview page to connect your application.

## Node.js Example

```javascript theme={null}
const { Pool } = require("pg");

const pool = new Pool({
  connectionString: process.env.DATABASE_URL,
  ssl: {
    rejectUnauthorized: false,
  },
});

async function connectDatabase() {
  const client = await pool.connect();
  console.log("Connected to PostgreSQL");
  client.release();
}

connectDatabase();
```

***

## Python Example

```python theme={null}
import os
import psycopg2

conn = psycopg2.connect(
    os.environ["DATABASE_URL"],
    sslmode="require"
)

print("Connected to PostgreSQL")
```

***

## PHP Example

```php theme={null}
<?php

$db = pg_connect(getenv("DATABASE_URL"));

if($db) {
    echo "Connected to PostgreSQL";
}
```

***

# Best Practices

## Recommended Production Configuration

* Use restricted IP access
* Enable automated backups
* Select daily or hourly backups for production workloads
* Use strong passwords
* Deploy in the closest region to your users
* Regularly rotate credentials

***

# Why Choose PostgreSQL on Antryk?

Antryk simplifies PostgreSQL infrastructure management so teams can focus on building applications instead of managing servers.

## Benefits

* Fast database deployment
* Simplified operations
* Secure infrastructure
* Flexible backup management
* Regional deployments
* Production-ready performance
* Developer-friendly experience
