# Mount an Object Storage bucket on your server as a folder

https://www.gyrohosting.com/en/knowledgebase/article/mount-object-storage-bucket-on-server

- **What you will learn**: How to mount a bucket of your Object Storage service on your server like a normal folder, how the mount works and how to remove it.
- **Time**: 5 minutes

## 1. What is it for?

Your bucket shows up on the server as a folder such as `/mnt/backups`. Files written to the folder go to the bucket and files in the bucket appear in the folder; your application does not need to speak S3.

- **Free.** Read and write traffic counts towards your storage service's traffic.
- **Installed automatically on Gyro Cloud Istanbul servers.** On other servers you run the one-line command from the panel once.
- **Every mount has its own access key.** The key can only reach the bucket you chose (read-only or read/write), does not use your key limit and is deleted when you remove the mount. Even if the server is compromised, your other buckets stay out of reach.
- **Persistent:** the mount comes back when the server reboots and reconnects if the connection drops.
- **Renaming the bucket does not break the mount.**

> **Info**
> 
> Technically this is an rclone FUSE mount: written files go to a small local cache first (up to 2 GB) and are uploaded to the bucket within seconds. It is not suitable for database files or files that are constantly modified in small pieces; it is ideal for backups, archives, media and user files.

## 2. Mounting from the panel

1. Open the **Mount storage** tab on your server's service page.
2. Choose the **Storage service** and the **Bucket**.
3. Type a **Mount point** or leave it empty (default `/mnt/<bucket name>`). The path must be under `/mnt`, `/srv`, `/data`, `/media`, `/opt`, `/home` or `/var/www`; the folder is created if missing, and **a non-empty folder is never used** (so its contents are not hidden).
4. Tick **Read only** if the server only needs to read (restoring backups, web assets).
5. Click **Mount**.

**On Gyro Cloud Istanbul servers** the mount is set up automatically within seconds and the state becomes **Mounted** (the server must be running).

**On other servers** the panel shows a one-line **install command**. Connect to your server over SSH and run it once as root or with `sudo`:

```
curl -fsSL https://www.gyrohosting.com/.../gyro-s3mount.sh -o /tmp/gyro-s3mount.sh && echo "<checksum>  /tmp/gyro-s3mount.sh" | sha256sum -c --quiet && sudo bash /tmp/gyro-s3mount.sh install <one-time-token> https://www.gyrohosting.com
```

The command is **valid for 60 minutes and works once.** The script's SHA-256 checksum is verified before it runs; the script installs the required packages (FUSE, rclone), fetches the credentials from the panel once and starts the mount. A few seconds later the panel shows **Mounted**.

> **Warning**
> 
> Do not share the install command or paste it into tickets or e-mails. If it expires, or after reinstalling the server, click **New command** on the row (the old key stops working at once).

## 3. Using it on the server

```
ls /mnt/backups                          # files in the bucket
cp backup-2026-11-13.tar.gz /mnt/backups/  # uploads to the bucket
gyro-s3mount list                          # mounts on this server and their state
systemctl status gyro-s3mount@backups      # details
```

The mount is a systemd service named `gyro-s3mount@<name>`. Files are owned by root and readable by other users (`0755` / `0644`). The credentials live in `/etc/gyro-s3mount/<name>.conf`, readable by root only; the panel never shows them.

## 4. Removing a mount

Click **Remove** on the row in the panel. The mount's access key is deleted **at once**; **files in the bucket are not deleted.**

- On Gyro Cloud Istanbul servers the service and folder on the server are removed automatically.
- On other servers run the command shown by the panel to clean up: `sudo gyro-s3mount remove <name>`. If you run it on the server yourself, the panel shows the mount as removed too.

## 5. If the storage service is suspended or ends

- **Suspended:** the mount cannot reach the bucket (you will see I/O errors in the folder). It comes back by itself when the service is reactivated.
- **Cancelled / ended:** the mount key is deleted and the mount shows **Ended**. When your server is cancelled, its mounts are closed too.

## 5a. Protected Storage buckets

Protected Storage (versioned, lockable) buckets can be mounted too. Differences:

- **Read-only by default.** When you pick a Protected storage service in the panel, **Read only** is ticked. This is the safest use: reading and restoring your backups on the server.
- **If you choose read/write** the panel shows a warning and asks for confirmation (API: `accept_versioning: true`):
  - Every save or overwrite on the server creates a **new version**.
  - A delete does not remove the file permanently, it only adds a **delete marker**; the previous version stays and can be restored on the Versions page.
  - **Locked** files cannot be deleted before their lock ends.
  - Therefore **used space and cost grow over time.** Limit old versions with **Lifecycle** ("delete old versions after N days"); keep frequently changing files (logs, databases, caches) on standard Object Storage.
- To avoid needless versions, the mount does not write file modification times to the bucket and batches writes for about 30 seconds.
- Renaming the bucket does not break the mount: the mount always uses the bucket's fixed **S3 name**.

## 6. Command line, API and Terraform

```
gyro server storage-mount list 12345
gyro server storage-mount create 12345 --storage-service-id 6789 --bucket backups --mount-point /mnt/backups
gyro server storage-mount command 12345 3        # new one-time command
gyro server storage-mount remove 12345 3 --yes
```

API: `GET/POST /cloud/servers/{id}/storage-mounts`, `GET/DELETE /cloud/servers/{id}/storage-mounts/{mid}`, `POST .../{mid}/command`. `automatic: true` in the answer means the mount was applied automatically; `install_command` is the command to run on the server.

```
resource "gyro_server_storage_mount" "backups" {
  server_id          = gyro_server.web.id
  storage_service_id = 6789
  bucket             = "backups"
  mount_point        = "/mnt/backups"
}
```

## 7. Frequently asked questions

**Can I mount it on a Windows server?**

No. The feature is for Linux servers with systemd (Ubuntu, Debian, AlmaLinux, Rocky Linux, CentOS Stream, Fedora). On Windows you can connect yourself with an S3 client such as rclone: [Connecting with aws-cli and rclone](https://www.gyrohosting.com/en/knowledgebase/article/s3-aws-cli-rclone).

**I got a "not empty" error.** The mount point you chose contains files. Pick an empty or new folder (e.g. `/mnt/backups2`) and try again with **New command**.

**Can I mount a Protected Storage bucket?**

Yes (see Section 5a). It is read-only by default; read/write turns every write into a new version and the used space grows. For regular backups restic, Veeam or rclone are usually more efficient.

**How many buckets can I mount?**

Up to 10 buckets per server; a storage service allows up to 20 server mounts.

**Does it cost anything?**

No. Only your storage service's space and traffic are used.
