Nhost Run services and the main Nhost stack share the same network, facilitating direct and efficient communication. This network connectivity offers low latency, high throughput, and eliminates egress costs.

Connecting to the Nhost stack

To connect your service to the Nhost stack, use the following information:

  • postgres: postgres://postgres:<password>@postgres-service:5432/<subdomain>?sslmode=disable
  • hasura: base URL is http://hasura-service:8080
  • hasura-auth: base URL is http://hasura-auth-service:4000
  • hasura-storage: base URL is http://hasura-storage-service:5000

Connecting to your service internally

To connect to your own service internally from another service, follow these steps:

  1. Configure the desired port(s).

Example for Redis service:

  1. Once the port is configured, you can connect to the service using as host run-${name} and the corresponding port.

    Example: redis://user:password@run-redis:6379

If needed, you can open internally more than one port by repeating the block for each one of them:

Example for a service exposing the ports tcp/3000 and udp/4000:

Exposing Your Service to the Internet

To expose your service to the internet, follow these steps:

  1. Update your configuration with the relevant port information:

Example for a nodejs service exposing an API on port 3000:

Currently, only services of type http and grpc can be exposed to the internet.
  1. Once the service of type http is published, you can connect to it using a URL with the following format:

https://<run_service_subdomain>-<port>.svc.<region>.nhost.run

For example:

https://zlbmqjfczuwqvsquujno-3000.svc.eu-central-1.nhost.run

GRPC

GRPC services are supported, however, they are only supported via custom domains. To expose a GRPC service to the internet you can use the following configuration:

...

[[ports]]
type = "grpc"
port = 5000
publish = false

[[ports.ingresses]]
fqdn = ["grpc.domain.com"]

...