- Sign in to the AWS Management Console and open the Amazon S3 console. Click the Create bucket button. Specify a unique bucket name and save the bucket.
- In the Identity and Access Management (IAM) Management Console, open the My security credentials page. Expand the Access keys (access key ID and secret access key) section. Click the Create New Access Key button. In a new window, click the Show Access Key link. Copy or write down the
Access Key ID
and Secret Access Key
.
- In the Identity and Access Management (IAM) Management Console, go to the Access management section and allow access to the bucket. Click Policies, then press the Create New Policy button. Switch to the JSON tab and add the following code:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1492520443000",
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets"
],
"Resource": [
"arn:aws:s3:::*"
]
},
{
"Sid": "Stmt1492520492000",
"Effect": "Allow",
"Action": [
"s3:GetBucketLocation",
"s3:ListBucket",
"s3:ListBucketMultipartUploads"
],
"Resource": "arn:aws:s3:::my-s3-bucketname"
},
{
"Sid": "Stmt1492521245000",
"Effect": "Allow",
"Action": [
"s3:AbortMultipartUpload",
"s3:GetObject",
"s3:ListBucket",
"s3:ListMultipartUploadParts",
"s3:PutObject",
"s3:PutObjectAcl"
],
"Resource": "arn:aws:s3:::my-s3-bucketname/*"
}
]
}
Replace my-s3-bucketname
with your actual bucket name. Then follow the wizard to save the new policy.
- In the Amazon S3 console, click your bucket name. Choose Permissions. In the Cross-origin resource sharing (CORS) section, click Edit and add the following code:
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"GET",
"HEAD"
],
"AllowedOrigins": [
"https://documentserver_adress"
],
"ExposeHeaders": []
}
]
Replace https://documentserver_adress
with your actual ONLYOFFICE Docs address. Save the settings.
- Open the ONLYOFFICE Docs configuration file:
/etc/onlyoffice/documentserver/default.json
If you change the parameters in the default.json
file, all the changes will be lost after the ONLYOFFICE Docs update or Docker container restart. To ensure that your changes persist after the update, please edit the /etc/onlyoffice/documentserver/local.json
file.
Add the settings to connect to the bucket:
"storage": {
"name": "storage-s3",
"fs": {
"folderPath": "",
"urlExpires": 900,
"secretString": "verysecretstring"
},
"region": "us-east-1",
"endpoint": "https://s3.us-east-1.amazonaws.com/",
"bucketName": "my-s3-bucketname",
"storageFolderName": "files",
"urlExpires": 604800,
"accessKeyId": "***",
"secretAccessKey": "***",
"sslEnabled": false,
"s3ForcePathStyle": false,
"externalHost": ""
},
Specify your actual bucket name, Access Key ID and Secret Access Key. Save the changes.
- Restart the ONLYOFFICE Docs services:
systemctl restart ds-converter ds-docservice ds-example ds-metrics