> ## 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:https:create

This command created a new [HTTPS Endpoint](https://www.aptible.com/docs/core-concepts/apps/connecting-to-apps/app-endpoints/https-endpoints/overview.md).

# Synopsis

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

Flags:
      --app string                             App handle
      --certificate string                     Certificate common name
      --certificate-file string                Path to certificate PEM file (creates a new certificate)
      --certificate-fingerprint string         SHA256 fingerprint of an existing certificate
      --default-domain                         Use Aptible's managed wildcard domain
  -e, --env string                             Environment handle (alias)
      --environment string                     Environment handle
      --force-ssl                              Redirect HTTP to HTTPS
      --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)
      --load-balancing-algorithm-type string   Load balancing algorithm (round_robin, least_outstanding_requests, weighted_random)
      --maintenance-page-url string            URL of a maintenance page to serve when the app is unhealthy; use "default" to reset
      --managed-tls                            Use Managed TLS (requires --managed-tls-domain)
      --managed-tls-domain string              Domain for Managed TLS
      --no-default-domain                      Clear the default domain setting
      --no-force-ssl                           Clear the Force SSL setting
      --no-internal                            Do not restrict this endpoint to internal traffic
      --no-managed-tls                         Disable Managed TLS
      --no-shared                              Stop sharing this endpoint's load balancer
      --no-show-elb-healthchecks               Hide runtime health check requests in endpoint logs
      --no-strict-health-checks                Clear the strict health checks setting
      --port int32                             Container port
      --private-key-file string                Path to private key PEM file (used with --certificate-file)
      --release-healthcheck-timeout string     Seconds to wait for a release health check; use "default" to reset
      --shared                                 Share this endpoint's load balancer with other endpoints
      --show-elb-healthchecks                  Show runtime health check requests in endpoint logs
      --ssl-protocols-override string          Allowed SSL protocols; use "default" to reset to platform default
      --strict-health-checks                   Require containers to respond to health checks with a 200 OK HTTP response
```

# 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 app 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 using a new [Custom Certificate](https://www.aptible.com/docs/core-concepts/apps/connecting-to-apps/app-endpoints/custom-certificate.md)

In the example below, `$CERTIFICATE_FILE` is the path to a file containing a PEM-formatted certificate bundle, and `$PRIVATE_KEY_FILE` is the path to a file containing the matching private key (see [Format](https://www.aptible.com/docs/core-concepts/apps/connecting-to-apps/app-endpoints/custom-certificate.md#format) for more information).

```shell theme={null}
aptible endpoints:https:create \
        --app "$APP_HANDLE" \
        --certificate-file "$CERTIFICATE_FILE" \
        --private-key-file "$PRIVATE_KEY_FILE" \
        "$SERVICE"
```

#### Create a new Endpoint using an existing [Custom Certificate](https://www.aptible.com/docs/core-concepts/apps/connecting-to-apps/app-endpoints/custom-certificate.md)

In the example below, `$CERTIFICATE_FINGERPRINT` is the SHA-256 fingerprint of a [Custom Certificate](https://www.aptible.com/docs/core-concepts/apps/connecting-to-apps/app-endpoints/custom-certificate.md) that exist in the same [Environment](https://www.aptible.com/docs/core-concepts/architecture/environments.md) as the App you are adding an Endpoint for.

> [!TIP]
>
> Use the Dashboard to easily locate the Certificate Fingerprint for a given Certificate.

```shell theme={null}
aptible endpoints:https:create \
        --app "$APP_HANDLE" \
        --certificate-fingerprint "$CERTIFICATE_FINGERPRINT" \
        "$SERVICE"
```

#### Create a new Endpoint using [Managed TLS](https://www.aptible.com/docs/core-concepts/apps/connecting-to-apps/app-endpoints/managed-tls.md)

In the example below, `$YOUR_DOMAIN` is the domain you intend to use with your Endpoint.

After initial provisioning completes, the CLI will return the [Managed HTTPS Validation Records](https://www.aptible.com/docs/core-concepts/apps/connecting-to-apps/app-endpoints/managed-tls.md#managed-https-validation-records) you need to create in order to finalize the Endpoint.

Once you've created these records, use the [`aptible endpoints:renew`](https://www.aptible.com/docs/reference/aptible-cli/cli-commands/cli-endpoints-renew) to complete provisioning.

```shell theme={null}
aptible endpoints:https:create \
        --app "$APP_HANDLE" \
        --managed-tls \
        --managed-tls-domain "$YOUR_DOMAIN"
        "$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:https:create \
        --app "$APP_HANDLE" \
        --default-domain \
        "$SERVICE"
```

#### Create a new Endpoint using a custom Container Port and an existing Certificate

```shell theme={null}
aptible endpoints:https:create \
        --app "$APP_HANDLE" \
        --certificate-fingerprint "$CERTIFICATE_FINGERPRINT" \
        --port 80 \
        "$SERVICE"
```
