Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the acf domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php on line 6131

Deprecated: Creation of dynamic property ACF::$fields is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/fields.php on line 138

Deprecated: Creation of dynamic property acf_loop::$loops is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/loop.php on line 28

Deprecated: Creation of dynamic property ACF::$loop is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/loop.php on line 269

Deprecated: Creation of dynamic property ACF::$revisions is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/revisions.php on line 397

Deprecated: Creation of dynamic property acf_validation::$errors is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/validation.php on line 28

Deprecated: Creation of dynamic property ACF::$validation is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/validation.php on line 214

Deprecated: Creation of dynamic property acf_form_customizer::$preview_values is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-customizer.php on line 28

Deprecated: Creation of dynamic property acf_form_customizer::$preview_fields is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-customizer.php on line 29

Deprecated: Creation of dynamic property acf_form_customizer::$preview_errors is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-customizer.php on line 30

Deprecated: Creation of dynamic property ACF::$form_front is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-front.php on line 598

Deprecated: Creation of dynamic property acf_form_widget::$preview_values is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-widget.php on line 34

Deprecated: Creation of dynamic property acf_form_widget::$preview_reference is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-widget.php on line 35

Deprecated: Creation of dynamic property acf_form_widget::$preview_errors is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-widget.php on line 36

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the all-in-one-wp-migration domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php on line 6131

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/wp_plugin/wp_plugin.php on line 23

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 54

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 1539

Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 828

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the rocket domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php on line 6131

Deprecated: Creation of dynamic property acf_field_oembed::$width is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/fields/class-acf-field-oembed.php on line 31

Deprecated: Creation of dynamic property acf_field_oembed::$height is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/fields/class-acf-field-oembed.php on line 32

Deprecated: Creation of dynamic property acf_field_google_map::$default_values is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/fields/class-acf-field-google-map.php on line 33

Deprecated: Creation of dynamic property acf_field__group::$have_rows is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/fields/class-acf-field-group.php on line 31

Deprecated: Creation of dynamic property acf_field_clone::$cloning is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/pro/fields/class-acf-field-clone.php on line 34

Deprecated: Creation of dynamic property acf_field_clone::$have_rows is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/pro/fields/class-acf-field-clone.php on line 35

Deprecated: Creation of dynamic property jh_acf_field_table::$settings is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-table-field/class-jh-acf-field-table.php on line 23

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902
{"id":24918,"date":"2021-01-06T07:26:03","date_gmt":"2021-01-06T05:26:03","guid":{"rendered":"https:\/\/upcloud.com\/community\/tutorials\/mount-object-storage-cloud-server-s3fs-fuse"},"modified":"2021-01-06T07:26:03","modified_gmt":"2021-01-06T05:26:03","slug":"mount-object-storage-cloud-server-s3fs-fuse","status":"publish","type":"tutorial","link":"https:\/\/studiogo.tech\/upcloudold\/tutorial\/mount-object-storage-cloud-server-s3fs-fuse\/","title":{"rendered":"How to mount Object Storage on Cloud Server using s3fs-fuse"},"content":{"rendered":"\n

UpCloud Object Storage offers an easy-to-use file manager straight from the control panel. There are also a number of S3-compliant third-party file manager clients that provide a graphical user interface for accessing your Object Storage. However, using a GUI isn\u2019t always an option, for example when accessing Object Storage files from a headless Linux Cloud Server. This is where s3fs-fuse comes in.<\/p>\n\n\n\n

s3fs-fuse<\/a> is a popular open-source command-line client for managing object storage files quickly and easily. It is frequently updated and has a large community of contributors on GitHub. In this guide, we will show you how to mount an UpCloud Object Storage bucket on your Linux Cloud Server and access the files as if they were stored locally on the server.<\/p>\n\n\n\n

\n
Test hosting on UpCloud!<\/a><\/div>\n<\/div>\n\n\n\n

Installing and configuring s3fs<\/h2>\n\n\n\n

To get started, you\u2019ll need to have an existing Object Storage bucket. If you do not have one yet, we have a guide describing how to get started with UpCloud Object Storage<\/a>.<\/p>\n\n\n\n

After logging into your server, the first thing you will need to do is install s3fs using one of the commands below depending on your OS:<\/p>\n\n\n\n

# Ubuntu and Debian\nsudo apt install s3fs\n\n# CentOS\nsudo yum install epel-release\nsudo yum install s3fs-fuse<\/pre>\n\n\n\n

Once the installation is complete, you\u2019ll next need to create a global credential file to store the S3 Access and Secret keys. These would have been presented to you when you created the Object Storage.
\"S3<\/p>\n\n\n\n

If you did not save the keys at the time when you created the Object Storage, you can regenerate them by clicking the Settings<\/em> button at your Object Storage details.
\"S3<\/p>\n\n\n\n

Then scrolling down to the bottom of the Settings page where you\u2019ll find the Regenerate<\/em> button. After new Access and Secret keys have been generated, download the key file and store it somewhere safe.<\/p>\n\n\n\n

\"S3<\/figure>\n\n\n\n

Next, on your Cloud Server, enter the following command to generate the global credential file. Be sure to replace ACCESS_KEY<\/span> and SECRET_KEY<\/span> with the actual keys for your Object Storage:<\/p>\n\n\n\n

echo \"ACCESS_KEY<\/span>:SECRET_KEY<\/span>\" | sudo tee \/etc\/passwd-s3fs\n<\/pre>\n\n\n\n

Then use chmod<\/tt> to set the necessary permissions to secure the file. 600 ensures that only the root will be able to read and write to the file. If this step is skipped, you will be unable to mount the Object Storage bucket:<\/p>\n\n\n\n

sudo chmod 600 \/etc\/passwd-s3fs\n<\/pre>\n\n\n\n

With the global credential file in place, the next step is to choose a mount point. This is the directory on your server where the Object Storage bucket will be mounted. It can be any empty directory on your server, but for the purpose of this guide, we will be creating a new directory specifically for this.<\/p>\n\n\n\n

sudo mkdir \/mnt\/my-object-storage<\/pre>\n\n\n\n

Any files will then be made available under the directory \/mnt\/my-object-storage\/<\/tt>.<\/p>\n\n\n\n

Mounting your Object Storage bucket<\/h2>\n\n\n\n

We\u2019re now ready to mount the bucket using the format below. Please note that this is not the actual command that you need to execute on your server. You must first replace the parts highlighted in red<\/span> with your Object Storage details:<\/p>\n\n\n\n

sudo s3fs {bucketname}<\/span> {\/mountpoint\/dir\/}<\/span> -o passwd_file=\/etc\/passwd-s3fs -o allow_other -o url=https:\/\/{private-network-endpoint}<\/span>\n<\/pre>\n\n\n\n

{bucketname}<\/span><\/strong> is the name of the bucket that you wish to mount.<\/p>\n\n\n\n

{\/mountpoint\/dir\/}<\/span><\/strong> is the empty directory on your server where you plan to mount the bucket (it must already exist).<\/p>\n\n\n\n

\/etc\/passwd-s3fs<\/strong> is the location of the global credential file that you created earlier. If you created it elsewhere you will need to specify the file location here.<\/p>\n\n\n\n

-o allow_other<\/strong> allows non-root users to access the mount. Otherwise, only the root user will have access to the mounted bucket.<\/p>\n\n\n\n

-o url<\/strong> specifies the private network endpoint for the Object Storage. This can be found by clicking the S3 API access<\/em> link. Don\u2019t forget to prefix the private network endpoint with https:\/\/<\/strong><\/p>\n\n\n\n

\"S3<\/figure>\n\n\n\n

The private network endpoint allows access to Object Storage via the utility network. This avoids the use of your transfer quota for internal queries since all utility network traffic is free of charge. However, note that Cloud Servers can only access the internal Object Storage endpoints located within the same data centre.<\/p>\n\n\n\n

Using all of the information above, the actual command to mount an Object Storage bucket would look something like this:<\/p>\n\n\n\n

sudo s3fs my-bucket \/mnt\/my-object-storage -o passwd_file=\/etc\/passwd-s3fs -o allow_other -o url=https:\/\/my-object-storage-internal.sg-sin1.upcloudobjects.com\n<\/pre>\n\n\n\n

You can now navigate to the mount directory and create a dummy text file to confirm that the mount was successful.<\/p>\n\n\n\n

touch \/mnt\/my-object-storage\/testing.txt\n<\/pre>\n\n\n\n

If all went well, you should be able to see the dummy text file in your UpCloud Control Panel under the mounted Object Storage bucked.<\/p>\n\n\n\n

\"S3<\/figure>\n\n\n\n

Likewise, any files uploaded to the bucket via the Object Storage page in the control panel will appear in the mount point inside your server.<\/p>\n\n\n\n

\"File<\/figure>\n\n\n\n

If you then check the directory on your Cloud Server, you should see both files as they appear in your Object Storage.<\/p>\n\n\n\n

\"List<\/figure>\n\n\n\n

Mounting your Object Storage bucket automatically on boot<\/h2>\n\n\n\n

To detach the Object Storage from your Cloud Server, unmount the bucket by using the umount command like below:<\/p>\n\n\n\n

umount \/mnt\/my-object-storage\n<\/pre>\n\n\n\n

You can confirm that the bucket has been unmounted by navigating back to the mount directory and verifying that it is now empty.<\/p>\n\n\n\n

Unmounting also happens every time the server is restarted. After every reboot, you will need to mount the bucket again before being able to access it via the mount point.<\/p>\n\n\n\n

However, it is possible to configure your server to mount the bucket automatically at boot. You can do so by adding the s3fs mount command to your \/etc\/fstab<\/tt> file. For the command used earlier, the line in fstab would look like this:<\/p>\n\n\n\n

s3fs#my-bucket \/mnt\/my-object-storage fuse _netdev,allow_other,passwd_file=\/etc\/passwd-s3fs,url=https:\/\/my-object-storage-internal.sg-sin1.upcloudobjects.com\/ 0 0\n<\/pre>\n\n\n\n

If you then reboot the server to test, you should see the Object Storage get mounted automatically.<\/p>\n","protected":false},"featured_media":16932,"comment_status":"open","ping_status":"closed","template":"","community-category":[113,127,128],"class_list":["post-24918","tutorial","type-tutorial","status-publish","has-post-thumbnail","hentry","community-category-integrations","community-category-managed-services","community-category-object-storage"],"acf":[],"_links":{"self":[{"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/tutorial\/24918","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/tutorial"}],"about":[{"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/types\/tutorial"}],"replies":[{"embeddable":true,"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/comments?post=24918"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/media\/16932"}],"wp:attachment":[{"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/media?parent=24918"}],"wp:term":[{"taxonomy":"community-category","embeddable":true,"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/community-category?post=24918"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}