How do I use s5cmd with Linode Object Storage?
If you're running on Linux or MacOS, the steps below should be able to get s5cmd working with your Object Storage buckets.
Before getting started, you'll want to make sure you've done the following:
- Install s5cmd. You can find the installation steps for your specific operating system here.
- Obtain an Access Key for your bucket. Our Generate an Object Storage Access Key guide can walk you through this.
Now that s5cmd is installed and you have an Object Storage Access Key, we can get started configuring s5cmd.
Run the following commands to create a few environment variables that s5cmd will use to authenticate to your bucket. You'll want to make sure to replace
$SECRET_KEY with your actual access and secret keys respectively. You'll also need to edit
AWS_DEFAULT_REGION with the region your bucket is located. In the example below I used
ap-south-1 for Singapore.
export AWS_ACCESS_KEY_ID=$ACCESS_KEY export AWS_SECRET_ACCESS_KEY=$SECRET_KEY export AWS_DEFAULT_REGION=ap-south-1
Now that your environment variables are created, you can begin to use s5cmd. When using s5cmd, you'll need to specify the endpoint-url to point to Linode's Object Storage endpoint. An example command that lists the bucket on your account in a specific region would look like the one below.
s5cmd --endpoint-url https://ap-south-1.linodeobjects.com ls
If you want to persist those environment variables so you don't have to recreate them every time you create a new shell, our Setting and Using Linux Environment Variables can walk you through how to do so.