File storage
Local file system
The following options are available from v0.72.0 onwards
If you would like to store file uploads on the same server that Outline is running from then you can do so using the local file system storage option.
Environment Variables
Set the following environment variables.
FILE_STORAGE=local
FILE_STORAGE_UPLOAD_MAX_SIZE=26214400
FILE_STORAGE_IMPORT_MAX_SIZE=
FILE_STORAGE_WORKSPACE_IMPORT_MAX_SIZE=
When running in docker, files are stored inside the container by default (at /var/lib/outline/data
), in order for files to be persisted to the host file system a mapping needs to exist in the docker-compose.yml
. You will find that the configuration is very similar to Postgres, the following two options are available – docker volumes are preferred for simplicity and portability:
Docker Volume
To store the files in a docker volume use the following mapping style:
volumes:
- storage-data:/var/lib/outline/data
File system folder
To store the files in a location on your local file system using a bind mount. This is particularly useful when migrating from previously using Minio, as you can point the app at where the files were previously stored and everything will continue to work.
volumes:
- /location/on/host/filesystem:/var/lib/outline/data
If you get permissions errors writing files, ensure that Outline has permission to write to the directory, by giving the user ID access: chown 1001 /location/on/host/filesystem
AWS S3
This guide assumes that you’ve created a bucket in Amazon S3 region us-east-2
called my-bucket-name
. If your bucket is named differently or in another region update the values appropriately. Since September 2020 all new buckets in S3 must be accessed via the “VirtualHost” method where the bucket and region are contained within the hostname, the config below reflects this change.
Environment Variables
FILE_STORAGE=s3
AWS_REGION=us-east-2
AWS_S3_FORCE_PATH_STYLE=false
AWS_S3_UPLOAD_BUCKET_NAME=my-bucket-name
AWS_S3_UPLOAD_BUCKET_URL=https://my-bucket-name.s3.us-east-2.amazonaws.com
AWS_S3_UPLOAD_MAX_SIZE=26214400
AWS_ACCESS_KEY_ID=AK66L9HZpTtfrpFFgtVxcxOUTn
AWS_SECRET_ACCESS_KEY=97L9HfssZpTtfrxOUTVxcnpgtSa
Permissions
Ensure that “Block public access” (BlockPublicAcls
) is set to “off” at the bucket level.
Cross-origin resource sharing (CORS)
Under your bucket permissions add the following policy json and update the AllowedOrigins to match your installation url.
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"PUT",
"POST"
],
"AllowedOrigins": [
"https://docs.mycompany.com"
],
"ExposeHeaders": []
},
{
"AllowedHeaders": [],
"AllowedMethods": [
"GET"
],
"AllowedOrigins": [
"*"
],
"ExposeHeaders": []
}
]
IAM Policy
The following actions must to be allowed, It is recommended to create an IAM user with only this policy attached but you may add to another user, then generate an access key and secret for the user to be included in the environment variables.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor",
"Effect": "Allow",
"Action": [
"s3:GetObjectAcl",
"s3:DeleteObject",
"s3:PutObject",
"s3:GetObject",
"s3:PutObjectAcl",
"s3:ListBucket"
],
"Resource": "arn:aws:s3:::my-bucket-name/*"
}
]
}
Transfer Acceleration
Note: This configuration is only available from v0.63.0 onwards
S3 offers “transfer acceleration” as an optional feature which takes advantage of Cloudfront’s CDN to improve performance of uploads and downloads. If enabled for your bucket enter the url provided by AWS in the AWS_S3_ACCELERATE_URL
environment variable.
S3-compatible services
Outline can be used with the vast majority of S3-compatible API’s as a very small subset of the available API interface is used, the following have been tested by members of the community.
Service | Compatible |
---|---|
Amazon S3 | ✅ |
Minio | ✅ |
DigitalOcean Object Storage | ✅ |
Alibaba Cloud / Aliyun OSS | ✅ (discussion) |
Scaleway | ✅ (discussion) |
Cloudflare R2 | ❌ (discussion) |
Backblaze | ❌ (discussion) |
OVH Object Storage | ❌ |