{"id":621,"date":"2026-07-27T16:38:54","date_gmt":"2026-07-27T11:08:54","guid":{"rendered":"https:\/\/www.bhuvankrishna.in\/blog\/?p=621"},"modified":"2026-07-27T16:38:54","modified_gmt":"2026-07-27T11:08:54","slug":"configuring-rclone-to-access-hetzner-object-stroage","status":"publish","type":"post","link":"https:\/\/www.bhuvankrishna.in\/blog\/2026\/07\/27\/configuring-rclone-to-access-hetzner-object-stroage\/","title":{"rendered":"Configuring rclone to access Hetzner Object Stroage"},"content":{"rendered":"<h1>How to Configure Rclone with Hetzner Object Storage for Automated Backups and Restores<\/h1>\n<p>\nObject storage is an excellent choice for storing backups because it is inexpensive,<br \/>\nscalable, and highly durable. This guide explains how to configure <strong>Rclone<\/strong><br \/>\nto connect to <strong>Hetzner Object Storage<\/strong> so you can manually upload\/download<br \/>\nbackups or automate the process using scripts and cron jobs.\n<\/p>\n<p>\nThis guide is intended for <strong>Developers and DevOps engineers<\/strong> who want a<br \/>\nreliable backup and restore workflow.\n<\/p>\n<hr>\n<h2>Prerequisites<\/h2>\n<ul>\n<li>A Linux server or workstation<\/li>\n<li>A Hetzner Object Storage bucket<\/li>\n<li>An Access Key and Secret Key<\/li>\n<li>Sudo access<\/li>\n<li>Internet connectivity<\/li>\n<\/ul>\n<hr>\n<h2>Step 1: Install Rclone<\/h2>\n<p>Install the latest version of Rclone.<\/p>\n<pre><code>curl https:\/\/rclone.org\/install.sh | sudo bash<\/code><\/pre>\n<p>Verify the installation.<\/p>\n<pre><code>rclone version<\/code><\/pre>\n<hr>\n<h2>Step 2: Generate the Configuration Directory<\/h2>\n<p>Run Rclone once to generate the configuration directory.<\/p>\n<pre><code>rclone<\/code><\/pre>\n<p>The default configuration file is located at:<\/p>\n<pre><code>~\/.config\/rclone\/rclone.conf<\/code><\/pre>\n<p>You can exit Rclone after the directory has been created.<\/p>\n<hr>\n<h2>Step 3: Configure Hetzner Object Storage<\/h2>\n<p>Edit the configuration file.<\/p>\n<pre><code>nano ~\/.config\/rclone\/rclone.conf<\/code><\/pre>\n<p>Add the following configuration:<\/p>\n<pre><code>[hetzner]\ntype = s3\nprovider = Other\n\naccess_key_id = &lt;ACCESS_KEY&gt;\nsecret_access_key = &lt;SECRET_KEY&gt;\n\nendpoint = https:\/\/hel1.your-objectstorage.com\n\n# Use fsn1, nbg1, or hel1 depending on your bucket region.\nregion = hel1\n<\/code><\/pre>\n<h3>Configuration Parameters<\/h3>\n<table border=\"1\" cellpadding=\"8\" cellspacing=\"0\">\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>hetzner<\/td>\n<td>Name of the Rclone remote. You may choose any name.<\/td>\n<\/tr>\n<tr>\n<td>access_key_id<\/td>\n<td>Hetzner Object Storage Access Key.<\/td>\n<\/tr>\n<tr>\n<td>secret_access_key<\/td>\n<td>Hetzner Object Storage Secret Key.<\/td>\n<\/tr>\n<tr>\n<td>endpoint<\/td>\n<td>Object Storage endpoint for your bucket.<\/td>\n<\/tr>\n<tr>\n<td>region<\/td>\n<td>Bucket region (hel1, fsn1 or nbg1).<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Note:<\/strong> The endpoint and region must match the region where your bucket was created.<\/p>\n<hr>\n<h2>Step 4: Verify the Configuration<\/h2>\n<p>List all configured remotes.<\/p>\n<pre><code>rclone listremotes<\/code><\/pre>\n<p>Expected output:<\/p>\n<pre><code>hetzner:<\/code><\/pre>\n<p>List all buckets.<\/p>\n<pre><code>rclone lsd hetzner:<\/code><\/pre>\n<hr>\n<h2>Step 5: Upload Files to Object Storage<\/h2>\n<p>Upload a file or directory.<\/p>\n<pre><code>rclone copy &lt;SOURCE&gt; hetzner:&lt;BUCKET_NAME&gt;\/PATH\/ \\\n    --transfers 24 \\\n    --progress\n<\/code><\/pre>\n<p><strong>Example<\/strong><\/p>\n<pre><code>rclone copy \/backups\/database.sql.gz \\\n    hetzner:production-backups\/database\/ \\\n    --transfers 24 \\\n    --progress\n<\/code><\/pre>\n<h3>Command Options<\/h3>\n<table border=\"1\" cellpadding=\"8\" cellspacing=\"0\">\n<thead>\n<tr>\n<th>Option<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>copy<\/td>\n<td>Copies files without deleting anything from the destination.<\/td>\n<\/tr>\n<tr>\n<td>&#8211;transfers 24<\/td>\n<td>Runs up to 24 parallel file transfers.<\/td>\n<\/tr>\n<tr>\n<td>&#8211;progress<\/td>\n<td>Displays upload progress.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr>\n<h2>Step 6: Download Files from Object Storage<\/h2>\n<p>Download files from your bucket.<\/p>\n<pre><code>rclone copy \\\n    hetzner:&lt;BUCKET_NAME&gt;\/PATH\/ \\\n    &lt;DESTINATION&gt; \\\n    --transfers 24 \\\n    --progress\n<\/code><\/pre>\n<p><strong>Example<\/strong><\/p>\n<pre><code>rclone copy \\\n    hetzner:production-backups\/database\/ \\\n    \/restore\/database \\\n    --transfers 24 \\\n    --progress\n<\/code><\/pre>\n<hr>\n<h2>Useful Commands<\/h2>\n<h3>List Buckets<\/h3>\n<pre><code>rclone lsd hetzner:<\/code><\/pre>\n<h3>List Files<\/h3>\n<pre><code>rclone ls hetzner:&lt;BUCKET_NAME&gt;<\/code><\/pre>\n<h3>Display Folder Structure<\/h3>\n<pre><code>rclone lsf -R hetzner:&lt;BUCKET_NAME&gt;<\/code><\/pre>\n<h3>Check Bucket Size<\/h3>\n<pre><code>rclone size hetzner:&lt;BUCKET_NAME&gt;<\/code><\/pre>\n<h3>Delete a File<\/h3>\n<pre><code>rclone deletefile hetzner:&lt;BUCKET_NAME&gt;\/PATH\/file.tar.gz<\/code><\/pre>\n<h3>Delete a Folder<\/h3>\n<pre><code>rclone purge hetzner:&lt;BUCKET_NAME&gt;\/PATH\/<\/code><\/pre>\n<p><strong>Warning:<\/strong> The purge command permanently deletes all contents under the specified directory.<\/p>\n<hr>\n<h2>Backup Best Practices<\/h2>\n<p>Organize backups by date.<\/p>\n<pre><code>production-backups\/\n\n\u251c\u2500\u2500 database\/\n\u2502   \u251c\u2500\u2500 2026-07-27.sql.gz\n\u2502   \u251c\u2500\u2500 2026-07-28.sql.gz\n\u2502\n\u251c\u2500\u2500 volumes\/\n\u2502   \u251c\u2500\u2500 2026-07-27.tar.gz\n\u2502\n\u2514\u2500\u2500 logs\/\n<\/code><\/pre>\n<hr>\n<h2>Automating Backups<\/h2>\n<p>Create a simple backup script.<\/p>\n<pre><code>#!\/bin\/bash\n\nBACKUP_FILE=\"\/backup\/database-$(date +%F).sql.gz\"\n\nrclone copy \\\n    \"$BACKUP_FILE\" \\\n    hetzner:production-backups\/database\/ \\\n    --transfers 24 \\\n    --progress\n<\/code><\/pre>\n<p>Make it executable.<\/p>\n<pre><code>chmod +x backup.sh<\/code><\/pre>\n<p>Run manually.<\/p>\n<pre><code>.\/backup.sh<\/code><\/pre>\n<p>Or schedule it using Cron.<\/p>\n<pre><code>0 2 * * * \/opt\/scripts\/backup.sh<\/code><\/pre>\n<hr>\n<h2>Restore Workflow<\/h2>\n<p>Download the required backup.<\/p>\n<pre><code>rclone copy \\\n    hetzner:production-backups\/database\/2026-07-27.sql.gz \\\n    \/restore \\\n    --progress\n<\/code><\/pre>\n<p>Verify the download.<\/p>\n<pre><code>ls -lh \/restore<\/code><\/pre>\n<hr>\n<h2>Troubleshooting<\/h2>\n<h3>Authentication Failed<\/h3>\n<ul>\n<li>Verify the Access Key<\/li>\n<li>Verify the Secret Key<\/li>\n<li>Check the endpoint<\/li>\n<li>Confirm the region<\/li>\n<\/ul>\n<h3>Bucket Not Found<\/h3>\n<ul>\n<li>Verify the bucket name.<\/li>\n<li>Ensure the bucket exists.<\/li>\n<li>Check the configured endpoint.<\/li>\n<\/ul>\n<h3>Slow Uploads<\/h3>\n<p>Adjust the number of parallel transfers.<\/p>\n<pre><code>--transfers 8<\/code><\/pre>\n<p>or<\/p>\n<pre><code>--transfers 32<\/code><\/pre>\n<h3>Show Configuration Location<\/h3>\n<pre><code>rclone config file<\/code><\/pre>\n<hr>\n<h2>Security Recommendations<\/h2>\n<ul>\n<li>Never commit <code>rclone.conf<\/code> into Git.<\/li>\n<li>Restrict file permissions.<\/li>\n<\/ul>\n<pre><code>chmod 600 ~\/.config\/rclone\/rclone.conf<\/code><\/pre>\n<ul>\n<li>Rotate Access Keys periodically.<\/li>\n<li>Use dedicated credentials for backup automation.<\/li>\n<li>Store secrets securely using a secrets manager whenever possible.<\/li>\n<\/ul>\n<hr>\n<h2>Conclusion<\/h2>\n<p>\nRclone makes it simple to interact with Hetzner Object Storage for backup and restore<br \/>\noperations. Once configured, these commands can easily be integrated into shell scripts,<br \/>\nCron jobs, CI\/CD pipelines, or Kubernetes CronJobs, providing a reliable and scalable<br \/>\nbackup strategy.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Configure Rclone with Hetzner Object Storage for Automated Backups and Restores Object storage is an excellent choice for storing backups because it is inexpensive, scalable, and highly durable. This guide explains how to configure Rclone to connect to Hetzner Object Storage so you can manually upload\/download backups or automate the process using scripts\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.bhuvankrishna.in\/blog\/2026\/07\/27\/configuring-rclone-to-access-hetzner-object-stroage\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,7],"tags":[],"class_list":["post-621","post","type-post","status-publish","format-standard","hentry","category-setup","category-techy"],"_links":{"self":[{"href":"https:\/\/www.bhuvankrishna.in\/blog\/wp-json\/wp\/v2\/posts\/621","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bhuvankrishna.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bhuvankrishna.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bhuvankrishna.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bhuvankrishna.in\/blog\/wp-json\/wp\/v2\/comments?post=621"}],"version-history":[{"count":2,"href":"https:\/\/www.bhuvankrishna.in\/blog\/wp-json\/wp\/v2\/posts\/621\/revisions"}],"predecessor-version":[{"id":623,"href":"https:\/\/www.bhuvankrishna.in\/blog\/wp-json\/wp\/v2\/posts\/621\/revisions\/623"}],"wp:attachment":[{"href":"https:\/\/www.bhuvankrishna.in\/blog\/wp-json\/wp\/v2\/media?parent=621"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bhuvankrishna.in\/blog\/wp-json\/wp\/v2\/categories?post=621"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bhuvankrishna.in\/blog\/wp-json\/wp\/v2\/tags?post=621"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}