> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/cli/guides/connect/devolutions-server.md).

# Sign in to Devolutions Server

Sign in to Devolutions Server from Devolutions CLI with your browser, an API key, a username and password, or Windows authentication.

Sign in once and Devolutions CLI saves your Devolutions Server as a context, so every later command uses it without asking again. Devolutions Server offers more sign-in methods than the other workspace types, so pick the one that matches who, or what, is signing in.

You need the address of your Devolutions Server, for example `https://<your-server-address>`. Use an `https` address.

## Pick the right option

<table><thead><tr><th width="250">CHOOSE</th><th>WHAT HAPPENS</th><th>USE IT WHEN</th></tr></thead><tbody><tr><td><strong>Browser sign-in</strong> (<code>--oauth</code>)</td><td>Your browser opens to sign in. Devolutions CLI keeps the session in your operating system's secure store and renews it on its own.</td><td>You work at your own computer.</td></tr><tr><td><strong>API key</strong> (<code>--api-key-env</code> or <code>--api-key-file</code>)</td><td>Devolutions CLI signs in with an API key read from an environment variable or a file.</td><td>A script or a CI pipeline signs in without anyone present.</td></tr><tr><td><strong>Username and password</strong> (<code>--username</code> with <code>--password-env</code> or <code>--password-file</code>)</td><td>Devolutions CLI signs in with an account of Devolutions Server. The password is read from an environment variable or a file.</td><td>You use a Devolutions Server account, a domain account, or an application user.</td></tr><tr><td><strong>Windows authentication</strong> (<code>--windows-auth</code>)</td><td>Devolutions CLI signs in as your current Windows account. No password to give.</td><td>You're on Windows and your Devolutions Server accepts Windows authentication.</td></tr></tbody></table>

Use exactly one method per sign-in. Devolutions CLI refuses a command that combines two.

## Sign in

{% tabs %}
{% tab title="Browser" %}

```bash
devo login <context-name> --server https://<your-server-address> --oauth
```

Your browser opens. If it doesn't, copy the address shown in the terminal into a browser.

On a computer without a browser, add `--use-device-code` and follow the instructions in the terminal to sign in from another device. If the sign-in page asks for a confirmation code, enter the code shown in the terminal.
{% endtab %}

{% tab title="API key" %}
Put the API key in an environment variable or a file that only you can read, then:

```bash
devo login <context-name> --server https://<your-server-address> --api-key-env <VARIABLE_NAME>
```

Or, from a file:

```bash
devo login <context-name> --server https://<your-server-address> --api-key-file <path-to-file>
```

{% endtab %}

{% tab title="Username and password" %}
Put the password in an environment variable or a file that only you can read, then:

```bash
devo login <context-name> --server https://<your-server-address> --username <username> --password-env <VARIABLE_NAME>
```

* For a domain account, add `--domain-id <domain-id>`.
* For an application user, add `--as-application`.
  {% endtab %}

{% tab title="Windows authentication" %}

```bash
devo login <context-name> --server https://<your-server-address> --windows-auth
```

Available on Windows only.
{% endtab %}
{% endtabs %}

Devolutions CLI checks the sign-in with your Devolutions Server before it saves the context. The new context becomes the current one.

{% hint style="info" %}
Devolutions CLI doesn't save API keys or passwords. It saves the name of the environment variable or the path of the file, and reads the value again each time a command needs it. Keep that variable set, or that file in place, for as long as you use the context.
{% endhint %}

## Check and end the session

* `devo status` shows the current context and whether it has a sign-in. Add `--online` to contact Devolutions Server and confirm that the sign-in still works.
* `devo info` shows information about your Devolutions Server. Add `--private` to include the information that needs your sign-in.
* `devo logout` clears the sign-in of the current context, or of the context you name. The context stays, so you can sign in again with the same name.
* `devo context delete <context-name> --yes` removes the context and its stored session.

## Good to know

* `--timeout` sets how long, in seconds, Devolutions CLI waits for each sign-in request: from `3` to `600`, `15` by default.
* `--no-set-current` saves the context without making it the current one. If no Devolutions Server context is current yet, it still becomes the one that `--source server` uses.
* With a username and password or Windows authentication, the sign-in request includes your computer name and local user name. See [What data Devolutions CLI sends](/cli/guides/understand/privacy.md).
* `devo entry references` lists only canonical references for Devolutions Server entries. See [Compare workspace types](/cli/guides/understand/workspace-types.md).
* Sign-in fails or the session expired? See [Sign-in fails or the session expired](/cli/help/troubleshooting/sign-in-fails.md).

## Next

* [Find the reference to a secret](/cli/guides/secrets/find-a-reference.md)
* [Sign in from a CI pipeline](/cli/for-devops-and-administrators/automate/ci-sign-in.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.devolutions.net/cli/guides/connect/devolutions-server.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
