---
title: "ezgh registry login"
description: "Sign docker in to the project's registry."
---

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

# ezgh registry login

{/* Generated by ezgh-cli's internal/tools/clidocs from the ezgh command tree. Don't edit: change the command's help in ezgh-cli and regenerate. */}

```sh
ezgh registry login [--expires-in-days n] [--api-key-stdin] [flags]
```

Sign docker in to the project's registry host with an API key, which is what the registry takes as the password. Runs docker login &lt;host&gt; `--username` ezgh `--password-stdin`; the key is never shown.

The key is this profile's own when it uses one (`EZGH_API_KEY`, an API key from `ezgh auth set-api-key`, or an instance's or pod's Bot key). With a login from `ezgh login`, which the registry doesn't take, it creates an API key for you named after the host, expiring after 30 days (`--expires-in-days` to change it): docker is refused once it expires, so run this again then. Each run creates a new key, and earlier ones keep working until they expire or you revoke them with `ezgh iam api-keys delete`. `--api-key-stdin` signs in with a key read from standard input instead, such as a bot's, to limit what docker can push and pull.

For podman, crane or another client, use `ezgh registry get-login-password`.

Part of [`ezgh registry`](/cli/reference/registry).

## Examples

```sh
ezgh registry login
ezgh registry login --expires-in-days 7
ezgh iam api-keys create ci-push --bot ci --expires-in-days 90 | ezgh registry login --api-key-stdin
```

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--api-key-stdin` | boolean |  | sign in with an API key read from standard input |
| `--expires-in-days` | int | `30` | with a login from ezgh login: expire the key it creates after 1 to 365 days |

This command also takes the [global flags](/cli/reference#global-flags).

Source: https://docs.ezghcloud.com/cli/reference/registry-login/index.mdx
