Accessing Object Storage with rclone
Please use the “Print” function at the bottom of the page to create a PDF.
Valid for VPS+ and migrated Cloud Servers.
Object Storage is fully S3-compatible. This enables seamless integration with common S3 tools. This article explains how to access your Object Storage with the open source software, rclone.
rclone is a powerful command line program for managing files in the cloud. It is available for Microsoft Windows, macOS, and Linux, and offers features such as an integrated HTTP server for remote control via API or GUI.
rclone offers the following functions:
- Backing up and encrypting files in a cloud storage.
- Restore and decrypt files from cloud storage.
- Mirroring cloud data to other cloud services or locally.
- Transferring data to the cloud or between cloud storage providers.
- Integrating multiple encrypted, cached, or different cloud storage devices into a single hard drive.
- Analysing and evaluating data stored in cloud storage using the commands lsf, lsjson, size, and ncdu.
Determine endpoint URL
- Log in to your IONOS account.
Click on Menu > Servers & Cloud in the title bar.
Optional: If you have multiple server contracts, select the desired contract.
- Click on Infrastructure > Object Storage in the navigation bar on the left.
- Click on the three-dot icon in the line with the bucket name.
- Click on Bucket Settings. The Bucket settings area opens.
The endpoint URL is displayed in the Bucket properties section. Make a note of the complete URL.
Determine Access Key and Secret Key
Requirement
You are in the Infrastructure > Object Storage section of the Cloud Panel.
- Click on the Key management tab.
- Optional: If you haven't generated a key yet, click on Generate a key.
- Click on one of the generated keys under Access keys.
- Click on Copy in the Access Key area.
- Open a text editor and paste the copied Access Key.
- Click on Copy in the Secret Key area.
- Switch to the text editor and paste the copied Secret Key.
Note
Treat the Secret Key like a password and keep it in a safe place.
Download rclone
The official repositories of Ubuntu, Debian, Fedora, Brew, and Chocolatey contain rclone. You can also download rclone from the following page:
Install rclone
Installation instructions can be found on the following page of the manufacturer:
Configure rclone for access to the Object Storage
The rclone installation guide in the link above includes configuration with the rclone config command. During this process, you will enter your Access Key and Secret Key to connect to your Object Storage.
Configurations that you set up with the rclone config command are referred to as remotes. If you already have buckets in different bucket regions or would like to use them, you must set up a separate remote for each region used.
Syntax note for operating systems
To use the commands listed below, you must adapt them before entering them. Note the differences in the path specification in the following examples:
Linux/macOS: Uses slashes /.
For example:
~/my-dir/
Windows: Uses backslashes \.
For example:
C:\Data\
In PowerShell, paths containing special characters must be enclosed in quotation marks "".
For example:
"C:\My Documents"
Note
To mount Object Storage in Microsoft Windows with rclone as a virtual drive, you must download and install WinFsp. Further information on mounting can be found on the following manufacturer's page:
Important commands
List remote
To list the remotes that have already been created, enter the following command:
rclone listremotes
List buckets of the remote
To list buckets of a specific remote, use the following command:
rclone lsd REMOTENAME
Example:
rclone lsd ionos1
Create a new bucket on a remote
To create a new bucket on a remote, enter the following command:
rclone mkdir REMOTENAME:BUCKETNAME
In the following example, a bucket with the name my-bucket is created on the remote ionos1:
rclone mkdir ionos1:my-bucket
Listing objects in a bucket
To list the objects of a bucket, use the following command:
rclone lsf REMOTENAME:BUCKETNAME
Example:
rclone lsf ionos1:my-bucket
Uploading a file from the current directory to a bucket
To upload a file from the current directory to a bucket, enter the following command:
rclone copy --progress filename.txt REMOTENAME:BUCKETNAME
Example:
rclone copy --progress filename.txt ionos1:my-bucket
Copying the contents of a local directory to a bucket
To copy the contents of a local directory to a bucket, use the following command:
rclone copy --progress DIRECTORY NAME REMOTENAME:BUCKETNAME/DIRECTORYNAME
Example:
rclone copy --progress my-dir ionos1:my-bucket/my-dir
Copy all objects with a specific prefix to another bucket
To copy all objects with a specific prefix from a specific bucket to another bucket, enter the command below. The buckets can be located in different regions and even with different providers. If the buckets are not in the same region, the data is not copied directly from the source to the target. For cross-region copy operations, the data is downloaded from the source bucket to you and then uploaded to the destination.
rclone copy --progress REMOTENAME1:BUCKETNAME/REMOTENAME/ REMOTENAME2:BUCKETNAME/REMOTENAME
Example:
rclone copy --progress ionos1:my-bucket/my-dir/ ionos2:my-bucket/my-dir
Download all objects from a bucket to a local directory
To download all objects from a bucket to a local directory, use the following command:
rclone copy --progress REMOTENAME:BUCKETNAME DIRECTORY NAME
Example:
rclone copy --progress ionos1:my-bucket my-dir
Synchronising a bucket with the contents of a local directory
To synchronise a bucket with the contents of a local directory, enter the following command:
rclone sync --progress DIRECTORYNAME/ REMOTENAME:BUCKETNAME
Example:
rclone sync --progress my-dir/ ionos1:my-bucket
Caution
sync makes the destination identical to the source, and deletes data at the destination if necessary.
Determining the total size and number of objects on the remote
To determine the total size and the number of objects in the path of the remote, use the following command:
rclone size REMOTENAME:BUCKETNAME/PATH
Example:
rclone size ionos1:my-bucket/path
Check whether the files in the local directory and at the target match
To check whether the files in the local directory and at the destination match, enter the following command:
rclone check DIRECTORY NAME/ REMOTENAME:BUCKETNAME
Example:
rclone check my-dir/ ionos1:my-bucket
Create MD5 sum file for all objects in the path
To create an MD5 sum file for all objects in the path, use the following command:
rclone md5sum REMOTENAME:BUCKETNAME/PATH
Example:
rclone md5sum ionos1:my-bucket/path