Dokploy

Authentication

A guide to authenticating with the Dokploy CLI

The Dokploy CLI authenticates with an API key. You need the URL of your Dokploy server and an API key generated from the dashboard.

Creating an API Key

To create an API key, first you need to have permissions, if you are admin you don't need permissions.

By default, an API key never expires, but you can optionally set an expiration date when creating it — recommended if the key will be used by a script, CI job, or anything outside your own machine.

You can go to dashboard/settings/profile and click on the Generate New Key button in the API/CLI Keys section.

home og image

Authenticating

There are three ways to provide the server URL and the API key.

Option 1: The auth command

dokploy auth -u https://panel.example.com -t YOUR_API_KEY

The command validates the credentials against your server and, if they are valid, saves the URL and the API key in a config.json file inside the CLI installation directory. You only need to run it once.

OptionDescription
-u, --url <url>URL of your Dokploy server
-t, --token <token>API key generated in your Dokploy dashboard

Option 2: Environment variables

export DOKPLOY_URL="https://panel.example.com"
export DOKPLOY_API_KEY="YOUR_API_KEY"

When both variables are set, they take priority over the credentials saved by the auth command. This is the recommended option for CI jobs and scripts.

Option 3: A .env file

Create a .env file in the directory where you run the CLI:

DOKPLOY_URL="https://panel.example.com"
DOKPLOY_API_KEY="YOUR_API_KEY"

The CLI loads it automatically. Variables already defined in your shell take priority over the ones in the .env file.

Verifying the credentials

Run any read command to confirm the CLI can reach your server, for example:

dokploy project all

On this page