[ParadeDB](https://www.paradedb.com/) is an open-source search engine built on PostgreSQL. It enables you to run full-text search and BM25 ranking directly in your database using standard SQL.

This tutorial walks through deploying ParadeDB on Render as a private service running PostgreSQL with an attached persistent disk. It requires paid resource types.

**It is not currently possible to install ParadeDB directly into a [Render Postgres](/content/docs/postgresql/index.html) database.**

This tutorial instead deploys PostgreSQL as a private service, which doesn't support features like [point-in-time recovery](/content/docs/postgresql-backups/index.html) and [high availability](/content/docs/postgresql-high-availability/index.html).

After you deploy your ParadeDB instance, you can pull your Render Postgres data into it via [logical replication](/content/docs/deploy-paradedb#logical-replication-from-render-postgres/index.html).

## Deployment options

### Quick deploy

To get up and running quickly, click the **Deploy to Render** button below. It uses a Blueprint to configure and deploy your ParadeDB private service with the following settings:

| Setting | Value |
| --- | --- |
| Docker image | `paradedb/paradedb:latest-pg18` |
| Region | Oregon |
| Starting compute plan | **`1c-2g`** |
| Starting disk size | 10 GB |

**To customize any of the above** (including to deploy to the same region as your existing services), instead perform a [Dashboard deploy](/content/docs/deploy-paradedb#dashboard-deploy/index.html).

[Deploy to Render](/content/deploy?repo=https%3A%2F%2Fgithub.com%2Frender-examples%2Fparadedb/index.html)

After your deploy completes, you can [connect to your ParadeDB instance](/content/docs/deploy-paradedb#connecting-to-your-paradedb-instance/index.html).

### Dashboard deploy

To fully customize your ParadeDB deployment, do the following:

1. In the [Render Dashboard](https://dashboard.render.com/), click **New > Private Service**.
2. Under **Source Code**, select **Existing Image** and provide the following **Image URL**:
   
   ```
   paradedb/paradedb:latest-pg18
   ```
3. Click **Connect**. The rest of the service creation form appears.
4. Select a **Region** and **Compute Plan** for your ParadeDB service.
   - Make sure to deploy to the same region as your services that will connect to ParadeDB.
   - We recommend using the **`1c-2g`** compute plan or higher.
5. Under **Environment Variables**, add the following:

| Key | Value | Description |
| --- | --- | --- |
| `POSTGRES_USER` | `parade_admin` | Your database superuser name. |
| `POSTGRES_PASSWORD` | _[Set a secure password]._ | Your database superuser password. |
| `POSTGRES_DB` | `paradedb` | The name of the default database. |

6. Expand the **Advanced** dropdown. Under the **Disk** section, click **Add disk**.
   - Set your disk's **Mount Path** to the following:

```
   /var/lib/postgresql
   ```
   - Set your disk's initial **Size** as needed for your dataset. You can increase this value later, but you can't decrease it.
7. Click **Deploy Private Service** to start the initial deploy.

You're all set! Your ParadeDB instance will be up and running as soon as the deploy completes. Next, learn how to [connect to your ParadeDB instance](/content/docs/deploy-paradedb#connecting-to-your-paradedb-instance/index.html).

## Connecting to your ParadeDB instance

### SSH connections

Your ParadeDB instance supports shell connections from your terminal or the Render Dashboard. To get started, see [SSH and Shell Access](/content/docs/ssh/index.html).

#### Starting a `psql` session

After connecting over SSH, start a `psql` session with the following command:

```bash
psql -U parade_admin -d paradedb
```

To test out functionality, you can create a table with mock data. Run the following commands from your `psql` session:

```sql
CALL paradedb.create_bm25_test_table(
  schema_name => 'public',
  table_name => 'mock_items'
);

SELECT description, rating, category
FROM mock_items
LIMIT 3;
```

The output of your `SELECT` command should look like this:

```
description               | rating |  category
--------------------------+--------+-------------
 Ergonomic metal keyboard |      4 | Electronics
 Plastic Keyboard         |      4 | Electronics
 Sleek running shoes      |      5 | Footwear
(3 rows)
```

### Internal service connections

To connect to your ParadeDB instance from your other Render services in the same region, use a connection URL with the following format:

```
postgres://parade_admin:{POSTGRES_PASSWORD}@{PRIVATE_HOSTNAME}:5432/paradedb
```

- Replace `{POSTGRES_PASSWORD}` with the password you set for your ParadeDB instance.
- Replace `{PRIVATE_HOSTNAME}` with your ParadeDB instance's hostname, available from its **Connect** dropdown in the [Render Dashboard](https://dashboard.render.com/):

In the screenshot above, the hostname is `paradedb18`.

Set this URL as an environment variable (e.g., `DATABASE_URL`) in your other Render services. You can share this value across multiple services using an environment group.

## Logical replication from Render Postgres

You can sync tables from a Render Postgres database to your ParadeDB instance via **logical replication.** Enabling logical replication requires contacting Render's support team.

1. Follow the instructions described in [Logical Replication with Render Postgres](/content/docs/postgresql-logical-replication/index.html).
2. After logical replication is enabled, follow the logical replication instructions in the [ParadeDB documentation](https://docs.paradedb.com/deploy/logical-replication/getting-started#3-bootstrap-the-schema-on-paradedb), starting with "3. Bootstrap the Schema on ParadeDB."

- In the context of this tutorial, "publisher" refers to your managed Render Postgres database.
