Alibaba Cloud OSS: mainland China without a filing
This route uses the OSS default endpoint, so no domain, no ICP filing and no certificate are needed. About 10 minutes to prepare one bucket and one key pair in Alibaba Cloud for Guyun.
This only works for accounts that activated OSS before 2025-03-20. If you are not sure when you activated it, or activated it later, follow the mainland China + full ICP filing route instead.
Step by step
-
Step 1
Register and verify your identity
- Register an Alibaba Cloud account and complete identity verification when the console asks; skip this if you already have one.
- Two separate sign-up entries, and the accounts do not carry over: the international site www.alibabacloud.com (mostly English; international card or PayPal) and the China site www.aliyun.com (Simplified Chinese; real-name verification, Alipay or WeChat Pay). Use the console of whichever site you registered on for the rest of this guide.
-
Step 2
Activate OSS
- Search the console for Object Storage Service and choose Activate.
- An old account already has it, so you can skip this step; activation itself is free.
-
Step 3
Create a bucket
- In the bucket list choose Create bucket, enter a globally unique name such as
your-bucket-nameand pick a mainland region, for examplecn-beijing. - Set access to private and leave block public access on.
- In the bucket list choose Create bucket, enter a globally unique name such as
-
Step 4
Create a RAM user and get its key
- Open Access Control (RAM) → Users → Create user and tick OpenAPI (programmatic) access; do not enable console logon.
- The AccessKey ID and secret are shown once; copy both now, and never use the root account key.
-
Step 5
Attach the least-privilege policy to that user
- Create a custom policy under Permissions → Policies, switch to the script (JSON) editor, paste the policy below and replace
your-bucket-namewith your real bucket name. - Open the user again and attach that policy to it.
- Create a custom policy under Permissions → Policies, switch to the script (JSON) editor, paste the policy below and replace
-
Step 6
Enter the four values in Guyun and test
- In Guyun's Add storage screen choose Alibaba Cloud OSS and enter the bucket name, region, endpoint and key.
- The endpoint is
https://oss-{region}.aliyuncs.com(the default mainland address) with the virtual host addressing mode; then choose Test connection & save.
Least-privilege policy (required)
Create a custom policy in RAM, switch to the script editor and paste this JSON.
{
"Version": "1",
"Statement": [
{
"Effect": "Allow",
"Action": ["oss:ListObjects", "oss:GetBucketLocation", "oss:ListMultipartUploads"],
"Resource": ["acs:oss:*:*:your-bucket-name"]
},
{
"Effect": "Allow",
"Action": ["oss:GetObject", "oss:PutObject", "oss:DeleteObject", "oss:AbortMultipartUpload", "oss:ListParts"],
"Resource": ["acs:oss:*:*:your-bucket-name/*"]
}
]
}
Replace your-bucket-name with your real bucket name. Do not narrow the resource range to one folder: Guyun writes the trash manifest and device records under the .guyun/ prefix.
Other cases (skip if not needed)
How to check that you are an old account
What counts is when the OSS service was activated, not when the bucket was created: only accounts activated before 2025-03-20 can reach a mainland bucket through the default endpoint.
Buckets you create later are fine too; conversely, on an account activated on or after 2025-03-20 this route's requests are refused.
If you do hit the restriction
A new account calling data APIs on a mainland bucket through the default public endpoint is refused with PublicEndpointForbidden (HTTP 400).
It restricts the domain, not your permissions: a private bucket with public access blocked and no shared links is refused just the same.
When that happens, take the other half of this route: mainland China + full ICP filing (bind a domain that has a filing).
One-shot ROS template (optional shortcut)
Let Resource Orchestration Service (ROS) build the private bucket, the RAM user limited to it and the AccessKey in one go.
- It builds, from the template below, a private bucket, a RAM user limited to that bucket and an AccessKey for that user.
- Copy the whole template and paste it into Specify template → Enter template on the ROS create page.
- Tick the safety confirmation on that page, or creation is blocked.
- When it fails, open the stack's Events: a taken bucket name is the most common cause.
ROS template
{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "为孤云创建:私有且阻止公共访问的 OSS Bucket、只授权该桶读写的 RAM 用户、以及该用户的 AccessKey。AccessKey ID 与 Secret 会出现在资源栈的「输出」里,复制回应用即可。",
"en": "Creates, for Guyun: a private OSS bucket with public access blocked, a RAM user limited to that bucket, and an AccessKey for it. The AccessKey ID and secret appear in the stack outputs; copy them back into the app."
},
"Parameters": {
"BucketName": {
"Type": "String",
"Label": {
"zh-cn": "Bucket 名称",
"en": "Bucket name"
},
"Description": {
"zh-cn": "全局唯一。3–63 位,只能用小写字母、数字和短横线,首尾必须是字母或数字。例如 my-photos-2026。",
"en": "Globally unique. 3–63 characters: lowercase letters, digits and hyphens, starting and ending with a letter or digit. For example my-photos-2026."
},
"AllowedPattern": "^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$",
"MinLength": 3,
"MaxLength": 63
},
"RamUserName": {
"Type": "String",
"Label": {
"zh-cn": "RAM 用户名",
"en": "RAM user name"
},
"Description": {
"zh-cn": "给应用专用的子账号。如果账号下已经有同名用户,请改成别的名字再创建。",
"en": "A dedicated sub-account for the app. If a user with this name already exists, pick another one."
},
"Default": "guyun-app",
"AllowedPattern": "^[a-zA-Z0-9._-]{1,64}$",
"MinLength": 1,
"MaxLength": 64
}
},
"Resources": {
"Bucket": {
"Type": "ALIYUN::OSS::Bucket",
"Properties": {
"BucketName": {
"Ref": "BucketName"
},
"AccessControl": "private",
"StorageClass": "Standard",
"BlockPublicAccess": true
}
},
"AppUser": {
"Type": "ALIYUN::RAM::User",
"Properties": {
"UserName": {
"Ref": "RamUserName"
},
"DisplayName": {
"Fn::Sub": "孤云存储"
},
"Comments": {
"Fn::Sub": "孤云专用存储用户;授权桶 ${BucketName} 的读写;随资源栈删除。"
}
}
},
"BucketPolicy": {
"Type": "ALIYUN::RAM::ManagedPolicy",
"DependsOn": "AppUser",
"Properties": {
"PolicyName": {
"Fn::Sub": "guyun-${BucketName}-rw"
},
"Description": {
"Fn::Sub": "Guyun: read and write ${BucketName} only. No bucket-level administration."
},
"PolicyDocument": {
"Version": "1",
"Statement": [
{
"Effect": "Allow",
"Action": [
"oss:ListObjects",
"oss:GetBucketLocation",
"oss:ListMultipartUploads"
],
"Resource": [
{
"Fn::Sub": "acs:oss:*:*:${BucketName}"
}
]
},
{
"Effect": "Allow",
"Action": [
"oss:GetObject",
"oss:PutObject",
"oss:DeleteObject",
"oss:AbortMultipartUpload",
"oss:ListParts"
],
"Resource": [
{
"Fn::Sub": "acs:oss:*:*:${BucketName}/*"
}
]
}
]
},
"Users": [
{
"Fn::GetAtt": [
"AppUser",
"UserName"
]
}
]
}
},
"AccessKey": {
"Type": "ALIYUN::RAM::AccessKey",
"DependsOn": "AppUser",
"Properties": {
"UserName": {
"Fn::GetAtt": [
"AppUser",
"UserName"
]
}
}
}
},
"Outputs": {
"BucketName": {
"Label": {
"zh-cn": "Bucket 名称",
"en": "Bucket name"
},
"Description": {
"zh-cn": "填到应用的「Bucket 名称」里。",
"en": "Paste into the app's bucket name field."
},
"Value": {
"Ref": "BucketName"
}
},
"RegionId": {
"Label": {
"zh-cn": "地域",
"en": "Region"
},
"Description": {
"zh-cn": "资源栈所在地域,也就是 Bucket 的地域。",
"en": "The stack's region, which is the bucket's region."
},
"Value": {
"Ref": "ALIYUN::Region"
}
},
"Endpoint": {
"Label": {
"zh-cn": "HTTPS Endpoint",
"en": "HTTPS endpoint"
},
"Description": {
"zh-cn": "走默认域名时填到应用的「HTTPS Endpoint」里(地址方式选「Bucket 子域名」);如果之后绑了自定义域名,Endpoint 要改成那个域名。",
"en": "With the default endpoint, paste this into the app's HTTPS endpoint field (addressing: virtual host). If you bind a custom domain later, the endpoint becomes that domain instead."
},
"Value": {
"Fn::Sub": "https://oss-${ALIYUN::Region}.aliyuncs.com"
}
},
"AccessKeyId": {
"Label": {
"zh-cn": "AccessKey ID",
"en": "AccessKey ID"
},
"Description": {
"zh-cn": "复制后填到应用的「AccessKey ID」里。",
"en": "Copy into the app's AccessKey ID field."
},
"Value": {
"Fn::GetAtt": [
"AccessKey",
"AccessKeyId"
]
}
},
"AccessKeySecret": {
"Label": {
"zh-cn": "AccessKey Secret",
"en": "AccessKey secret"
},
"Description": {
"zh-cn": "只在这里显示,复制后填进应用的 Keychain;不要粘贴到聊天、文档或代码里。",
"en": "Shown here only. Copy it into the app's Keychain; never paste it into a chat, document or repository."
},
"Value": {
"Fn::GetAtt": [
"AccessKey",
"AccessKeySecret"
]
}
}
},
"Metadata": {
"ALIYUN::ROS::Interface": {
"ParameterGroups": [
{
"Parameters": [
"BucketName"
],
"Label": {
"default": "OSS"
}
},
{
"Parameters": [
"RamUserName"
],
"Label": {
"default": "RAM"
}
}
],
"Outputs": [
"BucketName",
"RegionId",
"Endpoint",
"AccessKeyId",
"AccessKeySecret"
]
}
}
}
The template creates exactly the same resources and permissions as doing it by hand.
Console addresses
International site https://www.alibabacloud.com/; China site https://www.aliyun.com/.
Wording differs slightly between the two; use the equivalent button.
Official sources
- Regions and endpoints (opens in a new tab)
- Access buckets via custom domain names (mainland restriction) (opens in a new tab)
The four values to copy
These four go into Guyun's Add storage screen:
| This value | Where it goes in Guyun |
|---|---|
Bucket nameyour-bucket-name (your real bucket name) | Bucket name |
| Region the mainland region the bucket is in, e.g. cn-beijing | Region |
| Endpoint the default address https://oss-{region}.aliyuncs.com, e.g. https://oss-cn-beijing.aliyuncs.com | Endpoint |
| Credentials the RAM user's AccessKey ID and secret | AccessKey ID and secret |
How to tell it worked
- Guyun reports success and lists the bucket root; an empty bucket returning an empty list counts as success.
- Then upload, download and delete one file to confirm the default endpoint is not read-only for you.
- If it fails, see common errors.
Go back to Guyun and choose Test connection & save.