Manage Server Configurations

Prerequisites

  • JFrog CLI installed (installation guide)
  • JFrog Platform URL and access token
  • Environment variables set: JFROG_URL and JFROG_ACCESS_TOKEN (or equivalent values ready)

What You Will Do

  1. Add a server configuration
  2. View configurations
  3. Switch the active server
  4. Export a configuration
  5. Clean up

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.

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.


Step 2: Show All Configurations

View all configured servers:

jf config show

Step 3: Show a Specific Server

View details for one server:

jf config show <server-id>

Step 4: Set as Active Server

Set the server you want to use by default:

jf config use <server-id>

Step 5: Export Configuration

Export a configuration token for use on another machine:

jf config export <server-id>

The command prints a token you can pass to jf config import elsewhere.


Step 6: Remove the Server

Remove the server configuration when you are done:

jf config remove <server-id> --quiet

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
"Server ID already exists"Add --overwrite to jf config add
jf config show returns emptyYou haven't added a server yet — run jf config add
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 rm <server-id> --quiet to avoid credential leakage.
  • Set CI=true to ensure all commands default to non-interactive behavior.


What’s Next

For advanced customization, review the environment variables reference.