Install JFrog CLI and Verify Your Setup
Install JFrog CLI, authenticate with your JFrog Platform instance, and verify the connection.
This procedure walks you through installing JFrog CLI, authenticating with your JFrog Platform instance, and verifying the connection. Complete the following steps to confirm that JFrog CLI is ready to use.
This topic covers the following steps:
- Step 1: Install
- Step 2: Authenticate
- Step 3: Verify the Connection
- Step 4: View Environment Variables
- Step 5: Clean Up
Step 1: Install
This step installs the JFrog CLI binary on your computer.
To install JFrog CLI:
-
Install JFrog CLI via cURL:
curl -fL https://install-cli.jfrog.io | sh -
Verify the installation:
jf --version
Note
If
jf --versionreturns "command not found", the binary is not in your PATH. Try/usr/local/bin/jf --version. If that works, add it to your PATH withexport PATH=$PATH:/usr/local/bin. For other installation methods, see Download and Install JFrog CLI.
Step 2: Authenticate
This step adds a server configuration so JFrog CLI can connect to your JFrog Platform instance.
To authenticate JFrog CLI with your JFrog Platform instance:
-
Add a server configuration with your access token:
jf config add <server-id> --url=<your-url> --access-token=<your-token> --interactive=falseWhere:
<server-id>: A name you choose for this configuration (for example,my-server).<your-url>: Your JFrog Platform URL (for example,https://acme.jfrog.io).<your-token>: A valid JFrog access token.
For example:
jf config add my-server --url=https://acme.jfrog.io --access-token=eyJ... --interactive=false
Note
If you see "Server ID already exists", add
--overwriteto the command. If you see a connection error, verify your URL includeshttps://and is reachable withcurl -I <your-url>/api/system/ping. If you don't have an access token yet, generate one in the JFrog Platform UI at Administration > Identity and Access > Access Tokens.
Step 3: Verify the Connection
This step confirms that JFrog CLI can reach JFrog Artifactory with your credentials.
To verify the connection to Artifactory:
-
Ping Artifactory to confirm authentication works:
jf rt ping --server-id=<server-id>You should see
OKwhen the connection is valid.
Note
A 401 error means invalid credentials. Regenerate your access token. A connection timeout means the URL is wrong or unreachable. Verify with
curl -I <your-url>. A TLS error means certificate issues.
Step 4: View Environment Variables
This step lists environment variables that JFrog CLI recognizes.
To view all supported environment variables:
-
Run the following command:
jf optionsUse this output to configure
JFROG_CLI_*runtime variables. For authentication, pass--urland--access-tokenas command flags, or runjf config add. See Authenticate via the JFrog CLI.
Step 5: Clean Up
This step removes the server configuration you added for testing.
To remove the test server configuration:
-
Run the following command:
jf config remove <server-id> --quiet
Expected Output
When everything works correctly, your session looks similar to the following example.
$ jf --version
jf version 2.x.x
$ jf config add my-server --url=https://acme.jfrog.io --access-token=eyJ... --interactive=false
Server configuration successfully added.
$ jf rt ping --server-id=my-server
OK
$ jf options
JFROG_CLI_LOG_LEVEL Log verbosity. DEBUG, INFO, WARN or ERROR
JFROG_CLI_LOG_TIMESTAMP Timestamp format for log messages...
... (full list of environment variables)
$ jf config remove my-server --quietTroubleshooting
Use the following table to resolve common problems, or see the JFrog CLI Command Reference for full command syntax.
| Problem | Fix |
|---|---|
jf: command not found | The CLI is not in your PATH. Re-run the install script or add the binary location to your PATH |
jf rt ping returns an error | Check your URL (must include https://) and verify the access token is valid |
| "Server ID already exists" | Add --overwrite to the jf config add command |
Frequently Asked Questions
This section provides answers to frequently asked questions.
FAQs
Q: How do I install JFrog CLI?
A: Run curl -fL https://install-cli.jfrog.io | sh, then confirm the install with jf --version. See Step 1: Install for the full command.
Q: What happens if jf --version returns "command not found"?
jf --version returns "command not found"?A: The jf binary isn't in your PATH. Try /usr/local/bin/jf --version, and if that works, add it to your PATH with export PATH=$PATH:/usr/local/bin.
Q: What do I need before authenticating JFrog CLI with my JFrog Platform instance?
A: You need a server ID, your JFrog Platform URL, and a valid access token. Generate a token in the JFrog Platform UI, then run the command in Step 2: Authenticate.
Q: What does a 401 error mean when I verify the connection with jf rt ping?
jf rt ping?A: A 401 error means invalid credentials, so you need to regenerate your access token. See Step 3: Verify the Connection for other connection errors.
Q: Can I remove a test server configuration after I finish verifying JFrog CLI?
A: Yes. Run jf config remove <server-id> --quiet to remove it without a confirmation prompt, as shown in Step 5: Clean Up.
Related Topics
Updated 2 days ago
What’s Next
Now that you're up and running, set up your first build tool with Artifactory.
