Getting Started with Object Storage Using S3tools
Publisher: Psychz Networks, April 10,2024Introduction
Object storage solutions have become increasingly prevalent due to their scalability and flexibility. Amazon S3 (Simple Storage Service) is a widely adopted object storage service that offers seamless integration with various applications and platforms. To interact with Amazon S3 or S3-compatible storage systems, tools like s3cmd provide a convenient command-line interface.
This guide will walk you through setting up and using s3cmd on a Linux server to manage object storage.
Important Note: While creating the object storage, the system will display the following details
- access key
- secret key
- endpoint url
You must copy and save the data in a secure place, as you will need this information while creating the bucket. After 60 minutes, this information will disappear from the dashboard.
Install S3tools
You can use tools like s3cmd or any S3-compatible client to interact with your object storage. Let us begin with installing s3cmd on a Linux server.
Debian & Ubuntu
Import S3tools signing key:
# wget -O- -q http://s3tools.org/repo/deb-all/stable/s3tools.key | apt-key add -
Add the repo to sources.list:
# wget -O/etc/apt/sources.list.d/s3tools.list http://s3tools.org/repo/deb-all/stable/s3tools.list
Refresh package cache and install the newest s3cmd:
# apt-get update && apt-get install s3cmd
Check s3cmd version
# S3cmd --version
Output
s3cmd version 2.2.0
Before using s3cmd, you must configure your credentials (access and secret access keys) for authentication. Create a configuration file (.s3cfg in your home directory) or use environment variables.
Add your credentials:
Inside the .s3cfg file, add the following lines, replacing <access_key> and <secret_key> with your actual credentials:
# cd ~
# nano .s3cfg
Add the following data to the file
[default]
access_key = <access_key>
secret_key = <secret_key>
S3.endpoint = http://12.345.67.890
Create Your First Bucket:
Use your client's command to create a new bucket. For example, with s3cmd:
# s3cmd mb s3://my-first-bucket
Congratulations! You have successfully created your first bucket. You can now start transferring files to your storage space.