ZoophostDocs

Connect your app

Use the internal or external connection string, set it as an environment variable and verify the connection from your app and your laptop.

Managed databases3 min read

The database page gives you two ways in: an internal connection string for apps on Zoophost, and an external one for tools running elsewhere.

Internal vs external

Use String Why
App on Zoophost Internal Private network, lower latency, no public exposure
Laptop or another provider External Reaches the database over the public endpoint
CI job outside Zoophost External Same reason

If the External connection string field is missing and the page says the database is internal-only, ask support to publish a port. Do not assume the internal hostname resolves from outside.

Set it as an environment variable

  1. Open the database → Connection.
  2. Copy the Internal connection string.
  3. Open the app → Environment Variables.
  4. Add a variable named for your framework's convention:
    • DATABASE_URL for Rails, Django, Prisma, Drizzle and most Node ORMs
    • DATABASE_PRIVATE_URL if your platform uses both names
    • MONGO_URL for MongoDB clients
    • REDIS_URL for Redis clients
  5. Save. The app redeploys with the new value.

The connection string already contains the user, password, host, port and database name. Do not assemble it from parts unless your client requires separate fields.

Verify from the app

A quick check inside the running app depends on the language. In Node:

console.log(process.env.DATABASE_URL ? "set" : "missing");

Then use the driver's own ping. For Postgres:

psql "$DATABASE_URL" -c "select version();"

For MongoDB:

mongosh "$MONGO_URL" --eval 'db.runCommand({ ping: 1 })'

For Redis:

redis-cli -u "$REDIS_URL" ping

If these work from your laptop against the external string but fail from the app, the app is using the wrong string or is not picking up the variable.

Verify from your laptop

Copy the External connection string and run the matching command. GUI clients work too: pgAdmin, TablePlus, DBeaver and RedisInsight accept the host, port, user, password and database fields shown on the page.

If the connection times out, the database has no public endpoint or the public port is not open. Internal-only is the secure default.

SSL

The Details card shows the SSL mode. Most clients need sslmode=require appended to the URL, or the equivalent TLS toggle in a GUI client:

postgresql://user:pass@host:5432/db?sslmode=require

If a driver rejects the certificate chain, check whether it requires a CA file. The console's connection string is the authority for what the server expects.

Common problems

password authentication failed — the password was copied with a trailing space or the variable is stale. Reveal and copy again, then redeploy.

could not translate host name — the internal hostname only resolves inside Zoophost. Use the external string from another network.

connection refused — wrong port, or the database is stopped. Check the status and start it.

Too many connections — the app opens a connection per request. Add pooling in the app or driver; do not raise the limit blindly.

Works locally, fails in production — local .env values are not deployed. Every value must be in the app's environment variables.

Next

  • connection string
  • database url
  • internal
  • external
  • psql
  • mongosh
  • redis-cli

Ready to use this

PostgreSQL, MySQL, MongoDB or Redis on managed infrastructure.

  • Any engine from the same slot pack
  • Deploying from a slot costs nothing extra
See database plans
Still stuck? Open a ticket from Support tickets in the console, or email [email protected]. Include the service name, the exact error and what you already tried.