Create an Artifactory group with jf rt group-create
Create a new Artifactory group using the jf rt group-create command.
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
This command takes the following argument.
| Argument | Required | Description |
|---|---|---|
<group-name> | Yes | The name of the new group |
Options
This command supports the following 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.
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, not a JSON array — use a comma-separated list to specify one or more repository keys. 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. Without--replace, runninggroup-createagainst a group name that already exists fails with an error instead of overwriting it. - Creating a group does not automatically assign any permissions — you need to create a permission target that references the group. See Create and Manage Permissions.
Frequently Asked Questions
FAQs
Q: How do I create a new Artifactory group?
A: Run jf rt group-create <group-name>. See Create a New Group for an example.
Q: What happens if I create a group that already exists?
A: The command fails with an error instead of overwriting it. Use --replace if you want to overwrite an existing group with the same name.
Q: Why does jf rt group-create produce no output on success?
A: No output on exit code 0 is expected behavior for this command. See Verifying the Group Was Created to confirm the group exists.
Q: Does creating a group assign any permissions automatically?
A: No. Creating a group does not assign permissions — you must create a permission target that references the group. See Related Topics.
Q: What's the difference between jf rt group-create and jf rt group-add-users?
A: jf rt group-create creates the group itself; jf rt group-add-users adds existing users to a group that already exists.
Related Topics
- Add Users to a Group with jf rt group-add-users
- Delete an Artifactory Group with jf rt group-delete
- Group Management
- Permission Targets
Updated 3 days ago
