To move files from your local Ubuntu desktop to a Hetzner Storage Box or Storage Bucket (which is S3-compatible), you can use several tools depending on the exact service and protocol. Since you mentioned S3 compatible bucket, I assume you are referring to Hetzner's Storage Box with S3 compatibility or their Storage Bucket service.
Step-by-step guide to upload files to Hetzner Storage Bucket (S3 compatible) from Ubuntu:
1. Prerequisites
- You have your Hetzner Storage Bucket created.
- You have your Access Key and Secret Key for the bucket.
- You know the endpoint URL for your bucket (Hetzner provides a specific S3 endpoint URL).
- You have
awscli or s3cmd or rclone installed on your Ubuntu machine.
Option 1: Using AWS CLI (recommended)
The AWS CLI supports custom endpoints, so you can use it with Hetzner's S3-compatible storage.
Install AWS CLI (if not installed):
sudo apt update
sudo apt install awscli -y
Configure AWS CLI for Hetzner Storage Bucket:
Create a new profile for Hetzner:
aws configure --profile hetzner
Enter your Hetzner Access Key, Secret Key, default region (can be anything, e.g., us-east-1), and output format (e.g., json).
Upload file using AWS CLI with custom endpoint:
aws --endpoint-url https://<your-bucket-endpoint> s3 cp /path/to/local/file s3://your-bucket-name/path/in/bucket/ --profile hetzner
- Replace
<your-bucket-endpoint> with the Hetzner S3 endpoint URL (e.g., https://s3.<region>.hetzner.com).
- Replace
/path/to/local/file with your local file path.
- Replace
your-bucket-name with your bucket name.
- Replace
path/in/bucket/ with the desired path inside the bucket (can be empty if you want to upload to root).
Option 2: Using rclone
rclone supports many cloud storage providers including S3-compatible ones.
Install rclone:
sudo apt install rclone -y
Configure rclone for Hetzner:
Run:
rclone config
- Choose
n for new remote.
- Name it (e.g.,
hetzner).
- Choose
4 for S3.
- For provider, choose
Other.
- Enter your Access Key and Secret Key.
- Enter the endpoint URL (e.g.,
https://s3.<region>.hetzner.com).
- Leave other options default or as needed.
- Save config.
Upload file with rclone:
rclone copy /path/to/local/file hetzner:your-bucket-name/path/in/bucket/
Option 3: Using s3cmd
s3cmd is another tool for S3-compatible storage.
Install s3cmd:
sudo apt install s3cmd -y
Configure s3cmd:
s3cmd --configure
- Enter your Hetzner Access Key and Secret Key.
- Set the S3 endpoint URL (e.g.,
s3.<region>.hetzner.com).
- Save config.
Upload file:
s3cmd put /path/to/local/file s3://your-bucket-name/path/in/bucket/
Summary
- AWS CLI is the most straightforward if you already use AWS tools.
- rclone is very flexible and supports many backends.
- s3cmd is lightweight and simple for S3 operations.
If you provide your exact Hetzner service (Storage Box vs Storage Bucket) and endpoint, I can tailor the commands more precisely. Let me know if you want help with that!