website/src/app/kb/use-cases/postgres-access/readme.mdx
import PlanBadge from "@/components/PlanBadge"; import SupportOptions from "@/components/SupportOptions"; import Alert from "@/components/DocsAlert"; import Link from "next/link"; import Image from "next/image";
<PlanBadge plans={["starter", "team", "enterprise"]}>
In this guide, we'll use Firezone to set up access to a Postgres database. This is useful when you have a Postgres database that you want to keep behind a firewall, but still need to access it from external networks like the internet.
<Alert color="info"> This steps in this guide can be effectively applied to virtually any database or service, not just Postgres. </Alert>Sites -> <site> and
click the Add Resource button.DNS or IP as the Resource type depending on how you plan to access
the database. If you're using a DNS name, the address should be resolvable by
all of the Gateways in your Site.TCP/5432 (or the port your
Postgres database is running on) to restrict access to the Postgres service
only (Team and Enterprise plans).Policies tab, click the Add Policy button.You've now secured access to your Postgres database. You can test the connection
by testing access to the database with a tool like psql:
psql -h <resource-address> -U <username> -d <database>
If you get a password prompt, you've successfully secured access to your Postgres database.
<SupportOptions />