Manage Server Configurations
Prerequisites
- JFrog CLI installed (installation guide)
- JFrog Platform URL and access token
- Environment variables set:
JFROG_URLandJFROG_ACCESS_TOKEN(or equivalent values ready)
What You Will Do
- Add a server configuration
- View configurations
- Switch the active server
- Export a configuration
- 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 --overwriteReplace <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 showStep 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> --quietSummary
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
| Problem | Fix |
|---|---|
| "Server ID already exists" | Add --overwrite to jf config add |
jf config show returns empty | You haven't added a server yet — run jf config add |
Config token from jf config export doesn't import | The access token in the config may have expired — re-add with a fresh token |
| Wrong server is used for commands | Run jf config use <correct-server-id> to switch the active server |
Tips for CI/CD
- Always use
--interactive=falsein pipelines — interactive prompts hang CI runners. - Use environment variables (
JFROG_URL,JFROG_ACCESS_TOKEN) as the source of truth. Pass them tojf config add. - Add cleanup steps:
jf config rm <server-id> --quietto avoid credential leakage. - Set
CI=trueto ensure all commands default to non-interactive behavior.
Updated 7 days ago
