---
title: "Databases"
description: "Create a database on OnePloy: PostgreSQL, MySQL, MariaDB, MongoDB, Redis, KeyDB, Dragonfly or ClickHouse, and connect apps privately."
url: https://oneploy.dev/docs/databases/
type: op_doc
published: 2026-11-02T19:09:47+00:00
updated: 2026-11-02T19:11:23+00:00
author: "admin"
language: en-US
---

# Databases

> Create a database on OnePloy: PostgreSQL, MySQL, MariaDB, MongoDB, Redis, KeyDB, Dragonfly or ClickHouse, and connect apps privately.

OnePloy runs databases as standalone containers on your servers. Add one to a project environment, start it, and connect your applications through the internal connection URL that OnePloy shows on the database page.

## Which databases are supported?

| Engine | Type |
| --- | --- |
| PostgreSQL | Relational database |
| MySQL | Relational database |
| MariaDB | Relational database, MySQL compatible |
| MongoDB | Document database |
| Redis | In-memory key-value store |
| KeyDB | Multithreaded, Redis-compatible store |
| Dragonfly | In-memory store compatible with Redis and Memcached |
| ClickHouse | Column-oriented analytics database |

You can change the Docker **Image** on the database’s settings page to pin a specific version.

## How do I create a database?

1. Open a project environment and choose **Add resource**.
2. Pick the database engine.
3. Choose the server if you have more than one.
4. Review the generated username, password and initial database name, and change them if needed.
5. Start the database.

You can also create databases through the API, for example `POST /api/v1/databases/postgresql`.

## How do I connect my application to the database?

Copy the **URL (internal)** from the database page, for example the PostgreSQL URL, and set it as an [environment variable](https://oneploy.dev/docs/applications/environment-variables/) in your application. The internal URL uses the container name as host, so it works for applications on the same server and Docker network without exposing the database to the internet.

Only team admins and owners can see the connection URLs and passwords.

## How do I make a database publicly accessible?

1. Set a **Public port** on the database settings page, for example `5433`.
2. Change **Access** from **Private** to **Public through TCP proxy**.
3. Open that port in the server’s firewall.

OnePloy starts a small TCP proxy that forwards the public port to the database and shows a **URL (public)** you can use from outside. The proxy has its own logs, and you can adjust the **Proxy timeout**.

**Warning:** A public database is reachable by anyone who can reach the port. Use a strong password, restrict the port in your firewall to known IP addresses, and switch back to **Private** when you no longer need outside access.

## What else can I configure?

- Custom configuration, such as a custom PostgreSQL configuration file.
- Initialisation scripts that run when the database is first created (PostgreSQL).
- Persistent storage, resource limits, health checks and log forwarding.
- A terminal into the database container, and live logs.

## In this section

- [Back up and restore databases](https://oneploy.dev/docs/databases/database-backups/)

---

Source: https://oneploy.dev/docs/databases/ · OnePloy
