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

# Your own server

> Connect a Postgres or MySQL server you run to Midplane: TLS with a certificate for its host name, your CA, pg_hba.conf or a bastion, and the role script.

**1. Give the server a certificate for its host name**

For **TLS verified**, the certificate must name the host in the
connection string and come from a CA you can paste in the connect form.

* **Postgres**: `ssl = on`, `ssl_cert_file` and `ssl_key_file` in
  `postgresql.conf`, then reload.
* **MySQL**: TLS is on by default, but the certificate MySQL makes for
  itself doesn't name your host. Set `ssl_ca`, `ssl_cert` and `ssl_key`.

A self-signed server certificate connects, but stays **Encrypted, not
verified** ([TLS](https://midplane.ai/docs/connect/tls.md#get-it-verified)).

**2. Let Midplane in**

Postgres must listen where Midplane can reach it (`listen_addresses`),
with `hostssl` lines in `pg_hba.conf` for your region's egress
addresses; MySQL, on its `bind_address`. Open the port to those
addresses in the firewall ([allowlists](https://midplane.ai/docs/connect/allowlist.md)). On a
private network, use an [SSH bastion](https://midplane.ai/docs/connect/ssh.md).

**3. Run the role script**

As a superuser or a role with `CREATEROLE` on Postgres; as `root` or a
user that can create users and grant `SELECT` on MySQL
([the role script](https://midplane.ai/docs/connect/role.md)). If `pg_hba.conf` names its users,
add the new role first.

**Check:** **TLS verified**, with **Verified against the CA certificate
given for it, besides the public authorities.**


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.