# Public read-only s3 remote

**URL:** <https://discuss.dvc.org/t/public-read-only-s3-remote/355>\
**Category:** Questions\
**Created:** [April 21, 2020, 10:34pm UTC](https://discuss.dvc.org/t/public-read-only-s3-remote/355 "2020-04-21T22:34:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dlite](https://avatars.discourse-cdn.com/v4/letter/d/58956e/32.png) [@dlite](https://discuss.dvc.org/u/dlite)\
**Post date:** [April 21, 2020, 10:34pm UTC](https://discuss.dvc.org/t/public-read-only-s3-remote/355/1 "2020-04-21T22:34:17Z")

</div>

Hey folks,

The DVC [getting started example](https://github.com/iterative/example-get-started) has a read-only HTTP remote.

Is it possible to do the same with S3 so the public can have read-only permission? I believe I’ve set my bucket permissions correctly\* (I can download w/o AWS creds), but when I try `dvc pull` w/o creds I get an error:

```auto
$ dvc pull
ERROR: unexpected error - Unable to locate credentials 

```

It looks like `dvc pull` is checking for credentials regardless.

- 
  - allowing s3:GetObject and s3:GetObject

If this isn’t possible, does anyone have a suggestion on the easiest approach to allow read-only access to DVC data analogous to a public GitHub repo?

Thanks!

---

<div class="post-metadata">

**Author:** ![kupruser](https://avatars.discourse-cdn.com/v4/letter/k/e95f7d/32.png) [@kupruser](https://discuss.dvc.org/u/kupruser)\
**Post date:** [April 21, 2020, 10:38pm UTC](https://discuss.dvc.org/t/public-read-only-s3-remote/355/2 "2020-04-21T22:38:37Z")

</div>

Hi @dlite !

Indeed, aws requires you to have at least some creds to access even public buckets through s3 protocol. But, you could do that another way: by accessing it through HTTP. For example, in our core repo we use public s3 bucket to store some images, but we use it as an HTTP remote for `dvc pull`ing. See [https://github.com/iterative/dvc/blob/master/.dvc/config#L2](https://github.com/iterative/dvc/blob/master/.dvc/config#L2) (we do route it through our own domain, but it doesn’t matter, you could do the same with regular `https://<bucket>.s3.amazonaws.com/..` URL for your bucket.

---

<div class="post-metadata">

**Author:** ![kupruser](https://avatars.discourse-cdn.com/v4/letter/k/e95f7d/32.png) [@kupruser](https://discuss.dvc.org/u/kupruser)\
**Post date:** [April 21, 2020, 10:42pm UTC](https://discuss.dvc.org/t/public-read-only-s3-remote/355/3 "2020-04-21T22:42:24Z")

</div>

@dlite So just to make it clear, you could configure two remotes in your dvc project: one to access your bucket through s3 to push stuff to and one http one to allow anyone to download from. E.g.

```auto
dvc remote add mys3 s3://bucket/path
# note -d, which makes it the default one
dvc remote add -d mys3http https://bucket.s3.amazonaws.com/path 
# now you could
dvc push -r mys3
# or you could set it as a default one for your machine using --local flag,
# which uses .dvc/config.local which is .gitignored and will only stay on your machine.
dvc remote default mys3 --local

```

---

<div class="post-metadata">

**Author:** ![dlite](https://avatars.discourse-cdn.com/v4/letter/d/58956e/32.png) [@dlite](https://discuss.dvc.org/u/dlite)\
**Post date:** [April 21, 2020, 10:45pm UTC](https://discuss.dvc.org/t/public-read-only-s3-remote/355/4 "2020-04-21T22:45:24Z")

</div>

Interesting! I’ll give this a shot tomorrow.

Thanks for the quick reply @kupruser!

---

<div class="post-metadata">

**Author:** ![dlite](https://avatars.discourse-cdn.com/v4/letter/d/58956e/32.png) [@dlite](https://discuss.dvc.org/u/dlite)\
**Post date:** [April 22, 2020, 12:32pm UTC](https://discuss.dvc.org/t/public-read-only-s3-remote/355/5 "2020-04-22T12:32:40Z")

</div>

Thanks again @kupruser - the process you outlined above is working well for me.

```auto
dvc remote default mys3 --local

```

I like this as it makes the flow very similar to working on a public GitHub repo (I can push by default and others can read by default).
