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

# Service Connections

> `ale` provides the hostnames and ports for connecting services with other services. These connections can be set up for internal communication within the same environment or for external access.

## Service Endpoints

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/07_06.png" />
</Frame>

> In the resource tab of the service page, you can find two types of endpoints:

* **Ingress**: \[hostname:port] for external service connections
* **Private network**: \[hostname:port] for connections within the same environment

<Info>
  Services within the same environment can connect using the service name as the hostname.
</Info>

## Internal Service Connection

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/07_05.png" />
</Frame>

> Services displayed on the same screen can communicate using the private network address, **service name and port number.**

<Info>
  Services shown together belong to the same environment (namespace). Since each environment is isolated within its own network, there's no need for firewall rules, minimizing communication latency.
</Info>

<Tip>
  For more details on ale's workspace structure, see [the Environments page.](/en/developers/environment)
</Tip>

## External and Cross-env Services

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/07_07.png" />
</Frame>

> **Services not in the same environment or external services can connect using ingress address** shown at the top of the resource tab in the service page. For this type of connection, you should **allow TCP external access** in the settings tab of the environment where the database is located.

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/03_11.png" />
</Frame>

<Warning>
  TCP external access is controlled at the environment level and affects all services in that environment. You cannot configure this setting for individual services.
</Warning>

<Info>
  You can connect to your databases from DB client tools via TCP.

  <AccordionGroup>
    <Accordion title="MariaDB - MySQL Workbench">
      <Frame>
        <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/07_08.png" />
      </Frame>

      > Enter the ingress address, then in the next screen, enter [the Root Password](/en/developers/database#root-password) you set during deployment.

      <Info>
        [MySQL Workbench Download](https://dev.mysql.com/downloads/workbench/)
      </Info>
    </Accordion>

    <Accordion title="PostgreSQL - pgAdmin">
      <Frame>
        <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/07_10.png" />
      </Frame>

      > In the Connection tab, enter the ingress address, the Username (default is **root**), and [the Root Password](/en/developers/database#root-password) you set during deployment.

      <Info>
        [pgAdmin Download](https://www.pgadmin.org/download/)
      </Info>
    </Accordion>

    <Accordion title="MongoDB - MongoDB Compass">
      <Frame>
        <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/07_11.png" />
      </Frame>

      > Click `New Connection`, then in the **Advanced Connection Options** section, enter the **hostname including the port number** in the Host field.

      <Frame>
        <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/07_12.png" />
      </Frame>

      > In the Authentication tab, enter the Username (default is **admin**) and [the Root Password](/en/developers/database#root-password) you set during deployment.

      <Info>
        [MongoDB CompassDownload](https://www.mongodb.com/try/download/compass)
      </Info>
    </Accordion>

    <Accordion title="Redis - Redis Insight">
      <Frame>
        <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/07_13.png" />
      </Frame>

      > Click `Add Redis Database` and enter the ingress address.

      <Info>
        [Redis Insight Download](https://redis.io/insight/)
      </Info>
    </Accordion>
  </AccordionGroup>
</Info>

<Tip>
  To connect to databases using management tools via TCP, you should **enable TCP external access** in the settings tab of the environment where the database is located.
</Tip>
