After installing YugabyteDB Anywhere (YBA) from the command line using the YBA Installer, the next step is typically to open the YBA web UI and create the initial admin user.
However, there are situations where the UI isn’t accessible yet. For example, when YBA is deployed on a private network, or before a load balancer endpoint has been configured. In these cases, you might still want to move forward with node provisioning or automation setup without waiting for the browser connection.
That’s where the YBA CLI comes in.
The YBA CLI is a separate command-line tool from the YBA Installer, designed to interact with an existing YBA deployment. It provides commands to manage customers, universes, and other YBA operation, including registering the first admin user.
Using the yba register command, you can create this admin account directly from the CLI, obtain the Customer UUID and API Token, and continue with your node provisioning workflow or automation scripts… all without ever touching the UI.
👉 Let’s take a look at how to register the first YBA admin user entirely from the CLI.
Prerequisites
✅ YBA installed and running
Check status:
sudo ./yba-ctl status
You should see yb-platform, postgres, and prometheus in a running state, e.g.:
. YBA Url | Install Root | yba-ctl config | yba-ctl Logs | YBA Installer State |
https://XXX.XX.XX.123 | /opt/yugabyte | /opt/yba-ctl/yba-ctl.yml | /opt/yba-ctl/yba-ctl.log | Installed |
Services:
Systemd service | Version | Port | Log Files | Binary Directory | Running Status | Since |
postgres | 14.17 | 5432 | /opt/yugabyte/data/logs/postgres.log | /opt/yugabyte/software/2025.1.1.2-b3/pgsql/bin | Running | 23h 41m 57s |
prometheus | 3.2.1 | 9090 | /opt/yugabyte/data/logs/prometheus.log | | Running | 23h 41m 54s |
yb-platform | 2025.1.1.2-b3 | 443 | /opt/yugabyte/data/logs/application.log | | Running | 23h 41m 41s |
✅ YBA CLI downloaded (matching your version, e.g. 2025.1.1.2-b3)
From: YBA CLI GitHub repo
✅ Network access from the CLI host to the YBA IP
✅ If using HTTPS with a self-signed cert, either:
● Provide the CA certificate via
--ca-cert, or● Use
--insecurefor testing (recommended only in non-production)
Register the Admin User via CLI
Run the following command:
./yba register -f \
-n \
-e \
-p \
-H \
--insecure \
--show-api-token
Example:
[root@localhost yba_cli-2025.1.1.2-b3-linux-amd64]# \
./yba register -f \
-n admin \
-e admin@yugabyte.local \
-p "Password1!" \
-H XXX.XX.XX.123 \
--insecure \
--show-api-token
Output:
Configuration file '/root/.yba-cli/.yba-cli.yaml' successfully updated.
Customer UUID API Token
4df84d7f-d723-4206-85b2-e2593cf62104 4.8c7496db-0ca7-4572-bcb3-02a9ba511830.8007dea5-57fd-49a5-a391-5e7e6753fd61
These values (customer_uuid and api_token) are what you’ll use in node provisioning YAML files (for example, node-agent-provision.yaml).
Explore Available Options
To see all available flags and usage examples, simply run:
./yba register --help
Output:
Register a YugabyteDB Anywhere customer using yba cli. If non-interactive mode is set, provide the host, name, email, password and environment using flags.
Usage:
yba register [flags]
Examples:
yba register -f -n -e -p -H
Flags:
-n, --name string [Optional] Name of the user. Required for non-interactive usage
-e, --email string [Optional] Email for the user. Required for non-interactive usage
-p, --password string [Optional] Password for the user. Password must contain at least 8 characters and at least 1 digit , 1 capital , 1 lowercase and 1 of the !@#$^&* (special) characters. Required for non-interactive usage. Use single quotes ('') to provide values with special characters.
--environment string [Optional] Environment of the installation. Allowed values: dev, demo, stage, prod. (default "dev")
--show-api-token [Optional] Show the API token after registeration. (default false)
-f, --force [Optional] Bypass the prompt for non-interactive usage.
-h, --help help for register
Global Flags:
-a, --apiToken string YugabyteDB Anywhere api token.
--ca-cert string CA certificate file path for secure connection to YugabyteDB Anywhere. Required when the endpoint is https and --insecure is not set.
--config string Full path to a specific configuration file for YBA CLI. If provided, this takes precedence over the directory specified via --directory, and the generated files are added to the same path. If not provided, the CLI will look for '.yba-cli.yaml' in the directory specified by --directory. Defaults to '$HOME/.yba-cli/.yba-cli.yaml'.
--debug Use debug mode, same as --logLevel debug.
--directory string Directory containing YBA CLI configuration and generated files. If specified, the CLI will look for a configuration file named '.yba-cli.yaml' in this directory. Defaults to '$HOME/.yba-cli/'.
--disable-color Disable colors in output. (default false)
-H, --host string YugabyteDB Anywhere Host (default "http://localhost:9000")
--insecure Allow insecure connections to YugabyteDB Anywhere. Value ignored for http endpoints. Defaults to false for https.
-l, --logLevel string Select the desired log level format. Allowed values: debug, info, warn, error, fatal. (default "info")
-o, --output string Select the desired output format. Allowed values: table, json, pretty. (default "table")
--timeout duration Wait command timeout, example: 5m, 1h. (default 168h0m0s)
--wait Wait until the task is completed, otherwise it will exit immediately. (default true)
This displays supported options such as --ca-cert (for secure HTTPS connections), --insecure (to bypass certificate checks), and --show-api-token (to print your API key immediately).
It’s a quick way to understand how to adapt the command for your environment or integrate it into automation scripts.
Verify or Retrieve Credentials Later
If you didn’t use --show-api-token, you can still retrieve the stored credentials from:
~/.yba-cli/.yba-cli.yaml
Example content:
currentContext: default
contexts:
default:
host: XXX.XX.XX.123
customer_uuid: 4df84d7f-d723-4206-85b2-e2593cf62104
api_token: 4.8c7496db-0ca7-4572-bcb3-02a9ba511830.8007dea5-57fd-49a5-a391-5e7e6753fd61
Summary
You can register a YugabyteDB Anywhere admin user directly from the command line using the yba register command … no UI needed.
This approach is ideal for private or air-gapped environments where browser access isn’t available. It quickly creates the initial admin account, returns the Customer UUID and API Token, and updates your local CLI config so you can immediately begin node provisioning.
Have Fun!
