How to switch between S3 buckets quickly

TL;DR

From the AWS CLI: configure named profiles in ~/.aws/credentials and switch with AWS_PROFILE — the right pattern for scripts. From the AWS console: navigate per-account and re-authenticate every time. From S3 Viewer: every connected server and its buckets sit in one sidebar, so switching between an AWS bucket and an R2 bucket is a click, with no sign-in in between.

Steps

Step-by-step.

  1. 01

    In S3 Viewer: pick the server in the sidebar

    Every connection you have added with Add server is listed in the sidebar — AWS, R2, MinIO, anything you have wired up. Selecting one loads its buckets underneath it.
  2. 02

    Click the bucket

    The file list swaps to that bucket's root. No re-authenticating and no profile switching — the credential for that server is already stored and is used to sign the request.
  3. 03

    AWS CLI: named profiles

    Configure profiles in ~/.aws/credentials and switch with AWS_PROFILE. The right pattern for scripts and single-shell workflows.
    AWS_PROFILE=acme aws s3 ls s3://bucket-name
  4. 04

    AWS CLI for R2/B2/MinIO: --endpoint-url

    For Cloudflare R2, Backblaze B2, or MinIO, pass the endpoint explicitly. The credentials format is the same; only the URL changes.
    aws s3 ls --profile r2 \
      --endpoint-url https://<account>.r2.cloudflarestorage.com
  5. 05

    Across multiple AWS accounts

    Add each account's credentials as its own server. In S3 Viewer they are separate entries in the sidebar; in the CLI they are separate profiles.

Under the hood

What's actually happening.

The AWS CLI scopes credentials per profile (~/.aws/credentials) and you switch by setting AWS_PROFILE. That's the right pattern for scripts and single-shell workflows. For interactive sessions where you bounce between many buckets, the cost is not the switch itself but the re-authentication and the context loss around it. S3 Viewer keeps every server you have added in one sidebar and routes each click to that server's stored credential, so moving between an AWS bucket and an R2 bucket is the same gesture as moving between two folders.

FAQ

Common questions.

What's the fastest way to switch between AWS S3 buckets?

It depends on the workflow. For scripts, AWS CLI named profiles toggled with AWS_PROFILE are ideal. For interactive work where you bounce between many buckets in a session, a browser tool that keeps every bucket in one sidebar is faster — in S3 Viewer, switching bucket or provider is a click, with no profile switching and no re-authenticating.

Can I have buckets from multiple AWS accounts open at once?

Yes. Add each AWS account as its own server — S3 Viewer keeps a separate credential and signer per server. Buckets are listed under the server they belong to, so you can tell them apart at a glance. You browse one server at a time and switch from the sidebar.

How do I switch between AWS profiles in the CLI?

Set the AWS_PROFILE environment variable per command (AWS_PROFILE=acme aws s3 ls) or per shell (export AWS_PROFILE=acme). Profiles are configured in ~/.aws/credentials.

Can I jump between an AWS bucket and a Cloudflare R2 bucket?

Yes. Add AWS and R2 as separate servers and both appear in the same sidebar; switching from one to the other is a click, with no re-authenticating, since each server keeps its own credential under the hood.

Use S3 Viewer for this

Skip the CLI. Try it in the browser.

S3 Viewer turns the steps above into a single click. Open source, self-hostable, free.