Create an Artifactory group with jf rt group-create
Create a new users group in Artifactory.
Prerequisites
- JFrog CLI installed and configured: run
jf config showto verify an active server is set. - Admin privileges on the Artifactory instance are required.
- Confirm your server is reachable before running commands.
Synopsis
jf rt group-create <group-name> [options]
Aliases: rt gc
Arguments
| Argument | Required | Description |
|---|---|---|
<group-name> | Yes | The name of the new group |
Options
| Flag | Default | Description |
|---|---|---|
--access-token | — | JFrog access token |
--password | — | JFrog password (for authentication) |
--replace | false | Set to true to replace an existing group (or its users) with the same name |
--server-id | — | Server ID configured using the jf config command |
--ssh-key-path | — | SSH key file path |
--ssh-passphrase | — | SSH key passphrase |
--url | — | JFrog Artifactory URL (example: https://acme.jfrog.io/artifactory) |
--user | — | JFrog username |
Examples
Create a New Group
To create a new group:
- Run:
jf rt group-create <group-name>Where:
<group-name>— name for the new group (see Arguments).
Full example:
jf rt group-create my-teamOn success, the command exits with code 0 and produces no output. See Verifying the group was created below.
Create a Group with Replace
To create or replace a group:
- Run:
jf rt group-create <group-name> --replaceFull example:
jf rt group-create developers --replaceWhen to Use
Use jf rt group-create to create a logical grouping of users for access control. Groups simplify permission management — instead of assigning permissions to individual users, assign them to groups and add users to those groups.
Typical access control workflow:
To set up a group and grant repository permissions:
- Create the group:
jf rt group-create backend-teamNote
On success, the command exits with code 0 and produces no output. This is expected behavior.
- Add users to the group (see jf rt group-add-users for full options):
jf rt group-add-users backend-team alice,bob,charlie- Generate a permission target template interactively, then create it (
jf rt pttrequires an interactive terminal; in CI, write the JSON manually instead):
jf rt ptt ./backend-permissions.json
jf rt ptc ./backend-permissions.jsonjf rt ptt walks you through prompts and writes the template file. If you prefer to write the JSON manually, the minimal schema looks like this:
{
"name": "backend-permissions",
"repo": {
"repositories": "libs-release-local",
"actions": {
"groups": {
"backend-team": ["read", "write", "annotate", "delete", "manage"]
}
}
}
}Important
repositoriesmust be a string (a single repository key), not a JSON array. Using an array produces:json: cannot unmarshal array into Go struct field. See Permission Target Template for the full schema reference.
Verifying the Group Was Created
The group-create command produces no output on success.
To confirm the group exists:
- Query the groups API:
jf rt curl /api/security/groups/<group-name>Full example:
jf rt curl /api/security/groups/backend-teamImportant Notes
- Requires admin privileges on the Artifactory instance.
- Use
--replaceto overwrite an existing group with the same name. - Creating a group does not automatically assign any permissions — you need to create a permission target that references the group. See Creating Permission Targets.
Updated about 1 month ago
