Manage Server Configurations

Prerequisites

  • JFrog CLI installed (installation guide)
  • A JFrog Platform URL (for example, https://mycompany.jfrog.io)
  • A JFrog access token — generate one from Administration > Identity and Access > Access Tokens in the JFrog Platform UI

Set both as environment variables before continuing. The jf config add command reads them from the shell — if either is empty, the command will exit 0 with no output but will not add the server.

export JFROG_URL="https://<your-instance>.jfrog.io"
export JFROG_ACCESS_TOKEN="<your-access-token>"

Verify they are set before proceeding:

echo "URL : $JFROG_URL"
echo "TOKEN set: $([ -n "$JFROG_ACCESS_TOKEN" ] && echo yes || echo NO — set it before continuing)"

This topic covers the following tasks:


Step 1: Add a Server

Add a server in non-interactive mode so you can script this step. Use --overwrite to replace an existing configuration with the same ID.

To add a server configuration:

  • Run the following command:

    jf config add <server-id> --url=$JFROG_URL --access-token=$JFROG_ACCESS_TOKEN --interactive=false --overwrite

Replace <server-id> with a name you choose (for example, tutorial-server). The command stores your credentials in the configuration directory.

📘

Expected output

The command produces no output on success — a silent exit 0 means the server was added. If $JFROG_URL or $JFROG_ACCESS_TOKEN are empty, the command will also exit 0 silently but the server will not be saved. Always verify immediately after:

jf config show <server-id>

You should see output like:

Server ID:          tutorial-server
JFrog Platform URL: https://<your-instance>.jfrog.io/
Artifactory URL:    https://<your-instance>.jfrog.io/artifactory/
Default:            false

If you see [Error] Server ID '<server-id>' does not exist, go back and confirm $JFROG_URL and $JFROG_ACCESS_TOKEN are set correctly, then re-run the jf config add command.


Step 2: Show All Configurations

To view all configured servers:

  • Run the following command:

    jf config show

Expected output (one block per configured server):

Server ID:          tutorial-server
JFrog Platform URL: https://<your-instance>.jfrog.io/
Artifactory URL:    https://<your-instance>.jfrog.io/artifactory/
Default:            true

If the command returns no output, no servers have been added yet — run jf config add first.


Step 3: Show a Specific Server

To view details for a specific server:

  • Run the following command:

    jf config show <server-id>

Expected output:

Server ID:          tutorial-server
JFrog Platform URL: https://<your-instance>.jfrog.io/
Artifactory URL:    https://<your-instance>.jfrog.io/artifactory/
Default:            false

If you see [Error] Server ID '<server-id>' does not exist, the server was not added — repeat Step 1.


Step 4: Set as Active Server

To set a server as the active default:

  • Run the following command:

    jf config use <server-id>

The command produces no output on success (exit 0). To confirm the change, run jf config show and verify Default: true appears next to your server.


Step 5: Export Configuration

To export a configuration token for use on another machine:

  • Run the following command:

    jf config export <server-id>

Expected output — a single base64-encoded token:

eyJ2ZXJzaW9uIjoiMSIsInVybCI6Imh0dHBzOi8v...  (truncated)

Copy this token and run jf config import <token> on the target machine to restore the server configuration. See Importing a Server Configuration for details.


Step 6: Remove the Server

To remove a server configuration:

  • Run the following command when you are done:

    jf config remove <server-id> --quiet

The --quiet flag skips the interactive confirmation prompt. The command produces no output on success (exit 0). If the server ID does not exist, the command still exits 0 and prints an informational message — this is intentional idempotent behavior, safe for use in CI/CD cleanup scripts. Note: jf config remove and its alias jf config rm are equivalent.


Summary

You have added a server, viewed its configuration, set it as active, exported it, and removed it. You can repeat this flow for multiple servers. For CI/CD, use --interactive=false and environment variables for --url and --access-token.


Common Issues and Fixes

ProblemFix
jf config add exits 0 silently but jf config show says server missing$JFROG_URL or $JFROG_ACCESS_TOKEN was empty when you ran the command — set both env vars and re-run
"Server ID already exists"Add --overwrite to jf config add
jf config show returns no outputNo servers have been added yet — run jf config add first
Config token from jf config export doesn't importThe access token in the config may have expired — re-add with a fresh token
Wrong server is used for commandsRun jf config use <correct-server-id> to switch the active server

Tips for CI/CD

  • Always use --interactive=false in pipelines — interactive prompts hang CI runners.
  • Use environment variables (JFROG_URL, JFROG_ACCESS_TOKEN) as the source of truth. Pass them to jf config add.
  • Add cleanup steps: jf config remove <server-id> --quiet to avoid credential leakage (rm is a short alias for remove).
  • Set CI=true to ensure all commands default to non-interactive behavior.


What’s Next

For advanced customization, review the environment variables reference.