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

# aptible endpoints:tcp:create

This command creates a new App [TCP Endpoint](https://www.aptible.com/docs/core-concepts/apps/connecting-to-apps/app-endpoints/tcp-endpoints.md).

# Synopsis

```
Usage:
  aptible endpoints:tcp:create SERVICE [flags]

Flags:
      --app string             App handle
      --default-domain         Use Aptible's managed wildcard domain
  -e, --env string             Environment handle (alias)
      --environment string     Environment handle
      --idle-timeout string    Idle timeout in seconds (or 'default' to reset)
      --internal               Restrict this endpoint to internal traffic
      --ip-whitelist strings   IP CIDR whitelist (comma-separated or use flag multiple times)
      --no-default-domain      Clear the default domain setting
      --no-internal            Do not restrict this endpoint to internal traffic
      --ports strings          Container ports (comma-separated or use flag multiple times)
```

# Examples

In all the examples below, `$SERVICE` represents the name of a [Service](https://www.aptible.com/docs/core-concepts/apps/deploying-apps/services.md) for the Spp you are adding an Endpoint to.

> [!NOTE]
>
> If your app is using an [Implicit Service](https://www.aptible.com/docs/how-to-guides/app-guides/define-services.md#implicit-service-cmd), the service name is always `cmd`.

#### Create a new Endpoint

```shell theme={null}
aptible endpoints:tcp:create \
        --app "$APP_HANDLE" \
        "$SERVICE"
```

#### Create a new Endpoint using a [Default Domain](https://www.aptible.com/docs/core-concepts/apps/connecting-to-apps/app-endpoints/default-domain.md)

```shell theme={null}
aptible endpoints:tcp:create \
        --app "$APP_HANDLE" \
        --default-domain \
        "$SERVICE"
```

#### Create a new Endpoint using a custom set of Container Ports

> [!WARNING]
>
> The `--ports` argument accepts a list of ports, so you need to pass it last.

```shell theme={null}
aptible endpoints:tcp:create \
        --app "$APP_HANDLE" \
        "$SERVICE" \
        --ports 8000 8001 8002 8003
```
