# Setting up Public repository

**URL:** https://community.sonatype.com/t/setting-up-public-repository/6673
**Category:** Sonatype Nexus Repository
**Tags:** help
**Created:** [June 7, 2021, 7:37am UTC](https://community.sonatype.com/t/setting-up-public-repository/6673 "2021-06-07T07:37:08Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![mohamedsultan.ms304](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@mohamedsultan.ms304](https://community.sonatype.com/u/mohamedsultan.ms304)
#### Post date: [June 7, 2021, 7:37am UTC](https://community.sonatype.com/t/setting-up-public-repository/6673/1 "2021-06-07T07:37:10Z")

</div>

Hi. I’m new to Nexus. Glad to be a part of community.  
I have an use case where i need to make the particular repository public and it shouldn’t be asking for any auth when docker pull. Please help me out.  
Nexus - OSS 3.29.2-02

Thanks! 🙂

---

<div class="post-metadata">

### Author: ![mmartz](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@mmartz](https://community.sonatype.com/u/mmartz)
#### Post date: [June 7, 2021, 1:26pm UTC](https://community.sonatype.com/t/setting-up-public-repository/6673/2 "2021-06-07T13:26:18Z")

</div>

Basically, you need to add permissions to access that repository to the assigned anonymous user (by default it’s the anonymous user, with the nx-anonymous role).

---

<div class="post-metadata">

### Author: ![mohamedsultan.ms304](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@mohamedsultan.ms304](https://community.sonatype.com/u/mohamedsultan.ms304)
#### Post date: [June 7, 2021, 1:33pm UTC](https://community.sonatype.com/t/setting-up-public-repository/6673/3 "2021-06-07T13:33:22Z")

</div>

Thanks for replying. Can you please bit more explain the steps need to be followed?

---

<div class="post-metadata">

### Author: ![mmartz](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@mmartz](https://community.sonatype.com/u/mmartz)
#### Post date: [June 7, 2021, 2:03pm UTC](https://community.sonatype.com/t/setting-up-public-repository/6673/4 "2021-06-07T14:03:35Z")

</div>

I’d suggest looking at the documentation for [Access Control](https://help.sonatype.com/repomanager3/system-configuration/access-control)

---

<div class="post-metadata">

### Author: ![mohamedsultan.ms304](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@mohamedsultan.ms304](https://community.sonatype.com/u/mohamedsultan.ms304)
#### Post date: [June 7, 2021, 2:30pm UTC](https://community.sonatype.com/t/setting-up-public-repository/6673/5 "2021-06-07T14:30:15Z")

</div>

Thanks for sharing.  
Here is what i have tried.

1. Created a role with,  
privileges - nx-repository-admin-\* and nx-repository-view-\* (i.e selected all privileges of the repository)  
role - nx-anonymous
2. I have attached the role to the anonymous user

I couldn’t able to pull the image in local without docker login the artifactory  
I’m getting “no basic auth credentials” again

Please help me out if i did something wrong

---

<div class="post-metadata">

### Author: ![rseddon](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/rseddon/32/341_2.png) [@rseddon](https://community.sonatype.com/u/rseddon)
#### Post date: [June 7, 2021, 2:50pm UTC](https://community.sonatype.com/t/setting-up-public-repository/6673/6 "2021-06-07T14:50:37Z")

</div>

Do not grant nx-repository-admin access, that allows UI administration of the repository. Grant the “read” and “browse” nx-repository-view” privileges for the repository to the “anonymous” user.

Enable the docker bearer token realm under “security —\> realms”, and also enable anonymous pull support in the repo itself:

[https://help.sonatype.com/display/NXRM3/Docker+Authentication#DockerAuthentication-UnauthenticatedAccesstoDockerRepositories](https://help.sonatype.com/display/NXRM3/Docker+Authentication#DockerAuthentication-UnauthenticatedAccesstoDockerRepositories)

Rich

---

<div class="post-metadata">

### Author: ![mohamedsultan.ms304](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@mohamedsultan.ms304](https://community.sonatype.com/u/mohamedsultan.ms304)
#### Post date: [June 7, 2021, 3:18pm UTC](https://community.sonatype.com/t/setting-up-public-repository/6673/7 "2021-06-07T15:18:43Z")

</div>

Thanks Rich.  
I did modifications as you mentioned.  
Created a new role with nx-repository--read and nx-repository--browse  
Attached to the anonymous user.  
But I couldn’t able to pull image without auth. I’m not sure where i’m doing wrong ☹

---

<div class="post-metadata">

### Author: ![mpiggott](https://avatars.discourse-cdn.com/v4/letter/m/f0a364/32.png) [@mpiggott](https://community.sonatype.com/u/mpiggott)
#### Post date: [June 7, 2021, 3:25pm UTC](https://community.sonatype.com/t/setting-up-public-repository/6673/8 "2021-06-07T15:25:56Z")

</div>

I believe the docker repository also has an anonymous pull option.

---

<div class="post-metadata">

### Author: ![mohamedsultan.ms304](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@mohamedsultan.ms304](https://community.sonatype.com/u/mohamedsultan.ms304)
#### Post date: [June 7, 2021, 3:29pm UTC](https://community.sonatype.com/t/setting-up-public-repository/6673/9 "2021-06-07T15:29:31Z")

</div>

Yes. it has been enabled in settings
