XRAY: How to Automatically Enable Xray Indexing for All New Repositories

AuthorFullName__c
Abhinav Chauhan
articleNumber
000007066
FirstPublishedDate
2026-07-16T13:55:19Z
lastModifiedDate
2026-07-16

XRAY: How to Automatically Enable Xray Indexing for All New Repositories

Introduction
As the number of repositories grows, automating Xray indexing helps ensure consistent configuration across your environment.
This article will walk you through the process of configuring Xray to automatically index all newly created repositories by default.
Resolution
Step-by-Step Instructions
To automate Xray indexing for every new repository, you must modify Xray’s system.yaml file..
1. Locate Xray’s system.yaml file It is typically found in the directory $JFROG_HOME/xray/var/etc/ in each Xray instance.
2. Edit the system.yaml file: Open the file with a text editor and add (or modify) the following configuration under the server section:
server:
  enableXrayOnNewRepos: true
Note
Maintaining correct indentation is crucial here; improper spacing in the YAML structure could cause configuration errors and affect Xray startup.

3. Restart Xray For the changes to take effect, you must restart Xray. Use the appropriate command for your operating system (e.g., systemctl restart xray)
4. Verification: Create a new repository in Artifactory. You will notice that:
  • The repository Enable Indexing In Xray is toggled on by default.
       

  • Even if the "Enable Indexing In Xray" switch is manually toggled off during creation, the system will automatically override and enable it.
  • To verify the changes, navigate to the Artifactory UI and go to Administration > Xray Settings> Indexed Resources, then search for your repository to confirm it has been successfully added.


Conclusion
By setting enableXrayOnNewRepos to true, you ensure a "indexed by default" environment. This automation removes manual overhead for administrators and ensures that no new repository remains unscanned.

Note
Existing repositories created before this change will not be affected; they must still be indexed manually or via the Xray REST API.