All Products
Search
Document Center

Cloud Storage Gateway:Use a file gateway on the on-premises console

Last Updated:Sep 08, 2026

This topic describes how to use a file gateway on the on-premises console.

Prerequisites

  1. An Alibaba Cloud account is created and real-name verification for the account is complete. For more information, see Create an Alibaba Cloud account.

    Note

    Create a RAM user and log on to the CSG console as the RAM user.

  2. The Cloud Storage Gateway service is activated. When you log on to the Cloud Storage Gateway console for the first time, follow the on-screen instructions to activate the service.

  3. You have deployed the on-premises console for your file gateway.

  4. An OSS Bucket is created.

    Important
    • A file gateway supports only OSS Buckets of the Standard, Infrequent Access (IA), and Archive storage classes. OSS Buckets with the back-to-source feature enabled are not supported.

    • Avoid connecting a gateway directly to an Archive OSS Bucket. If files will not be modified for a long time after being written, consider using a Standard or IA bucket. You can then use lifecycle rules to transition the storage class of the objects to Archive or Cold Archive. This approach is more cost-effective and efficient because it avoids unnecessary restore operations.

    • When a client writes a file to the gateway, the gateway records at least two actions: writing the file and setting the file's modification time. The gateway attempts to merge these actions, but may still initiate multiple operations on the OSS Bucket for a single file. Setting the modification time translates to modifying the object's metadata in the OSS Bucket by using the CopyObject API. For Archive or Cold Archive objects, this requires a time-consuming restore operation, which can slow down uploads and even cause write failures if the cache disk does not have enough space to upload the data in time.

  5. You have added a disk.

Add a cache disk

Each shared folder requires a unique cache disk. A cache disk is used to upload data from a shared folder to Alibaba Cloud OSS and to synchronize data from OSS to your on-premises environment.

  1. In a web browser, enter https://<IP address of your file gateway> to access the on-premises console for the file gateway.

  2. Enter your username and password, and then click OK.

  3. On the Cache Settings page, click Create.

  4. In the Create Cache dialog box, configure the following parameters.

    • Hard disk: Click Select and choose an available disk.

      Disks are available here only after you add a disk on the deployment platform.

    • File system: This is an optional feature. To recover data from a cache disk when you recreate a share, select this option to enable data reuse. This allows you to recover data by recreating the share if it was accidentally deleted.

      Note

      If no file system exists on the cache disk (that is, the cache disk is empty or not initialized), selecting this option causes the cache creation to fail.

  5. Click OK to add the cache disk.

Bind a cloud resource

Create shared resources that use OSS buckets as backend storage. A file gateway supports multiple cloud resources, with each shared resource corresponding to one bucket.

Note

By default, data written to a Cloud Storage Gateway from a client is uploaded to the OSS bucket in real time. You can also configure a sync delay of up to 120 seconds when you create a share.

Depending on your business requirements, you can bind a cloud resource by using the standard method or the custom method.

Standard method

  1. On the on-premises console for the file gateway, go to the Cloud Resource Settings page and click Bind.

  2. In the Bind Cloud Resource dialog box, configure the following parameters.

    Parameter

    Description

    Resource name

    Enter a name for the cloud resource.

    cross-region binding

    Configure cross-region binding.

    • Yes: Allows the file gateway to access an OSS bucket in a different region.

    • No: Allows the file gateway to access only a bucket in the same region.

    Note

    To ensure accurate data synchronization, logging, and operations management, the time zones of the file gateway and the OSS bucket must be identical.

    region

    Select the region where the bucket is located.

    Bucket name

    Select the bucket that you want to bind.

    Use SSL

    If you select Yes, the gateway uses SSL to access the OSS bucket.

  3. Click OK to bind the cloud resource.

Custom method

  1. On the on-premises console for the file gateway, go to the Cloud Resource Settings page and click Bind.

  2. In the Bind Cloud Resource dialog box, configure the following parameters.

    Parameter

    Description

    Resource name

    Enter a name for the cloud resource.

    Use custom region

    Select Use Custom Region.

    endpoint

    The endpoint of the OSS bucket. Example: oss-cn-hangzhou.aliyuncs.com

    Bucket name

    Enter the name of the OSS bucket that you want to bind.

    AccessKey ID

    Enter your Access Key ID.

    AccessKey Secret

    Enter your Access Key Secret.

    Use SSL

    If you select Yes, the gateway uses SSL to access the OSS bucket.

  3. Click OK to bind the cloud resource.

Create a share

On-premises file gateways support NFS shares and SMB shares. Select a share type based on your requirements. This topic uses an NFS share as an example.

  1. Install an NFS client.

  2. Return to the on-premises console for the file gateway. On the NFS page, click Create.

  3. In the Create NFS Share dialog box, configure the following parameters, and then click OK.

    Parameter

    Description

    Share name

    The virtual path for the NFS protocol.

    For NFSv4, you can mount the share directly by using this name. For NFSv3, you must run the showmount -e <gateway IP address> command to obtain the virtual path.

    Read/write client IPs

    The IP addresses or CIDR blocks of clients granted read/write access to the NFS share.

    Example: 192.168.10.10 or 192.168.0.0/24. You can enter multiple IP addresses or CIDR blocks.

    The IP addresses or CIDR blocks of clients granted read-only access to the NFS share.

    Example: 192.168.10.10 or 192.168.0.0/24. You can enter multiple IP addresses or CIDR blocks.

    Read-only client IPs

    User mapping

    Sets the mapping between users on the NFS client and users on the NFS server.

    Note

    This parameter is configurable only when the Protocol is set to NFS.

    • none: An NFS client user is not mapped to the nobody user on the NFS server.

    • root_squash: Restricts the root user. When an NFS client accesses the share as the root user, the client is mapped to the nobody user on the NFS server.

    • all_squash: Maps all users from an NFS client to the nobody user on the NFS server.

    • all_anonymous: Maps all users from an NFS client to the NFS server's anonymous user.

    Enable

    Enable the NFS share.

    To disable the NFS share, select No.

    Mode

    Includes cache mode and replication mode.

    • Replication mode: All data is saved in two copies: one in the offline cache and the other in OSS.

    • Cache mode: Caches all metadata and frequently accessed user data locally. OSS retains the complete dataset.

    Reverse Sync

    Synchronizes metadata from OSS back to a local environment. This applies to gateway disaster recovery, data recovery, and data sharing scenarios.

    Note

    A reverse sync operation scans all objects in a bucket. This process incurs OSS API request fees if the bucket contains a large number of objects.

    Bucket Name

    Select the created Bucket.

    Path prefix

    Enter the path prefix in the bucket.

    Path prefixes support only English letters and numbers.

    Note

    Starting from version 1.0.38, you can mount the root directory of a file system to a specific path prefix in an OSS bucket to facilitate access isolation.

    The path prefix can be an existing directory or a new directory in the OSS bucket. After the share is created, this path prefix will serve as the root directory, and all subsequent files and directories will be created under it.

    Using a metadata disk

    Using a metadata disk separates the data disk from the metadata disk. The metadata disk is used to store metadata for shared folders.

    • If you select Yes, you must select the corresponding metadata disk and data disk.

    • If you select No, you must select the corresponding cache disk.

    Note

    Only whitelisted users can use this feature.

    Ignore Deletion

    File deletions are not synchronized to OSS to prevent accidental operations. OSS retains the complete dataset.

    NFS v4 optimization

    Improves upload efficiency for NFSv4 mounts. After you enable this option, you can no longer mount by using NFSv3.

    Synchronization Delay

    Set Sync Delay. This setting delays file uploads for a period of time after the files are closed to prevent frequent offline modifications from creating OSS fragments. The default value is 5 s, and the maximum value is 120 s.

    Maximum Write Speed

    The maximum write speed is 1280 MB/s. The default value is 0, which indicates that the speed is unlimited.

    Maximum Upload Speed

    The maximum upload speed is 1280 MB/s. The default value is 0, which indicates no speed limit.

    Note

    When speed is limited, the maximum upload speed cannot be less than the maximum write speed.

    Fast Cache Reclaim

    Real-time cache reclamation is suitable for backup-only cloud scenarios.

  4. Click Confirm to create the share.

Access the share

After the share is created, use an NFS client to access the NFS shared folder.