Set the active JFrog CLI server

The active server is the default target for JFrog CLI commands when you do not pass --server-id or related environment overrides. jf config use switches that default to another configured server ID. The setting is persisted in your CLI configuration file.

This topic covers:

Synopsis

jf config use <server-id>

Aliases: none

Where:

  • <server-id>: The configured server ID to make active.

Arguments

ArgumentRequiredDescription
server-idYesThe server ID to set as active

Flags

None.

Examples

Set the Active Server

To set the active server:

  1. Run:

    jf config use <server-id>

    Where:

    • <server-id>: The server ID to use as the default.

    For example:

    jf config use staging-server

    Expected output:

    [Info] Using server ID 'staging-server'
  2. To confirm the change, run:

    jf config show

    You should see staging-server listed as Default: true.

Override the server for a single command or session

If you only need a different server for one command or for the current shell session, you do not have to change the global default.

To override the server for a single command:

  • Run the command with --server-id. The value must be a server ID you configured with jf config add.

    jf rt ping --server-id=<server-id>

    Where:

    • <server-id>: The server ID to use for this invocation only.

    For example:

    jf rt ping --server-id=prod-server

    The --server-id flag takes precedence over both the active server set by jf config use and the JFROG_CLI_SERVER_ID environment variable.

To override the server for the current terminal session:

  1. Export the environment variable:

    export JFROG_CLI_SERVER_ID=<server-id>

    Where:

    • <server-id>: Server ID to use until you close the shell or unset JFROG_CLI_SERVER_ID.

    For example:

    export JFROG_CLI_SERVER_ID=prod-server
  2. Run CLI commands as usual. They use prod-server without changing the active config stored by jf config use:

    jf rt ping

When to Use

Use jf config use when you have multiple server configurations (for example, dev-server, staging-server, prod-server) and want to switch the default for all subsequent commands.

Important Notes

  • The active server setting persists across sessions — it is stored in the configuration file (~/.jfrog/jfrog-cli.conf.v6).
  • Using --server-id on a command always overrides the active server for that command only.
  • The JFROG_CLI_SERVER_ID environment variable overrides the active server for the entire terminal session (until you close the terminal or run unset JFROG_CLI_SERVER_ID).
  • Concurrent sessions: All terminal sessions share the same configuration file. If multiple terminals run jf config use simultaneously, the last write wins and silently overrides earlier changes. For parallel or CI/CD workflows, use --server-id or JFROG_CLI_SERVER_ID instead of switching the global active server.

What’s Next

You're all set. Explore the general commands available in JFrog CLI.