Remote database access
A database container is reachable only where its consumers need it. Falak works out the addresses from the sites that reference it; you only decide about public access.
Who reaches it, and how
Section titled “Who reaches it, and how”| From | Address | Notes |
|---|---|---|
| Containers of the environment on the same server | falak-db-<id> on the environment’s Docker network falak-env-<environment> |
Docker sites join it; Compose stacks start on it |
| Native sites on the same server | 127.0.0.1:<host port> |
Host ports are allocated from 20000–29999 |
| Sites on other servers of the environment | The database server’s private address and the host port | Published only on that address, filtered to the consumers’ addresses |
| Anyone else | Nobody | Unless you turn on public access |
The agent filters published ports in Docker’s DOCKER-USER chain, so Docker’s port publishing never bypasses the firewall.
Other servers of the environment
Section titled “Other servers of the environment”A site on another server reaches the database over a private network the two servers share. Falak picks the address in this order:
- a Falak private network (WireGuard) both servers are members of;
- otherwise the provider’s private network, only where both servers are on it for sure: created by Falak with the same provider credential in the same region, on DigitalOcean or Lightsail.
The public IP is never used. Servers that share no private network get a deploy error naming the reason (… shares no private network with <server> …); add both to a network under Network → Private networks (see Private networks) and deploy again.
- Reference the database from the site on the other server and save.
- The database’s Overview shows Restart required: publish on <address> …. Click Apply: the container is recreated on its volume and publishes the port on the private address.
- Deploy the site. Until the address is published, the reference fails with
… is not published on <address> yet ….
Public access
Section titled “Public access”Off by default. Turn it on under Overview → Limits & settings → Public access to reach the database from outside your servers (a BI tool, a laptop without SSH).
- The port is published on every address of the server, and TLS is required for every connection (the certificate comes from the Falak CA).
- Only the networks listed in Allowed sources (IPv4 addresses or CIDRs, such as
203.0.113.9, 198.51.100.0/24) get through Falak’s firewall. - Redis and Valkey switch to TLS-only, so their
REDIS_URLbecomesrediss://.
Connect from your computer
Section titled “Connect from your computer”Use an SSH tunnel to the container’s host port instead of public access:
falak ssh db-1 -- -N -L 5432:127.0.0.1:<host port># then connect your client to 127.0.0.1:5432 with the credentials from the panelThe host port is shown in the database’s connection details.