# External storage

External storage allows to use external servers for storing user uploads, which helps to leverage your server load and deliver a more reliable website. If you use multiple external storage servers, it will help to distribute the traffic of these assets.

💡 Asset storage

Check the documentation on Asset variables (opens new window) if you want to control where to store the website assets (backgrounds, avatars, etc.)

# How it works?

External storage works by adding external storage server(s) where file uploads will be stored. These external storage servers expose those files using HTTP, enabling users and visitors of your Chevereto installation to access these images directly.

# Storage URL

💡 The storage server must provide the URL for public-read file access. Check the documentation of your service provider.

Chevereto maps external storage uploads to the corresponding external storage server using the given Storage URL as a base URL to locate that file in the external storage.

Using Amazon S3 with direct storage:

Property Value
Bucket my-bucket
Storage URL https://s3.amazonaws.com/my-bucket/
Stored image my-bucket/image.jpg
Mapped URL https://s3.amazonaws.com/my-bucket/image.jpg

CNAME

Is recommended that you use URLs that match your domain so try to take advantage of using a CNAME record (opens new window).

Amazon S3 with folder-based storage and custom CNAME (img.domain.com):

Property Value
Bucket my-bucket
Storage URL https://img.domain.com/my-bucket/
Stored image /my-bucket/2020/10/06/image.jpg
Mapped URL https://img.domain.com/my-bucket/2020/10/06/image.jpg

# Storage URL with CDN

Add a CDN for each storage URL you want to use. At your CDN provider create a pull zone for the origin storage URL.

If you are using Amazon S3, the source (origin) URL will be something like this:

https://s3.amazonaws.com/my-bucket/

The CDN URL provided by your CDN service will be something like this:

https://pullzone-url.at.cdn-service.com/

Adding a CNAME record for the above URL will allow you to end up with a Storage URL like this:

https://s3-cdn.domain.com/

# Lifecycle settings

DANGER

Providers of cloud storage may use a feature called "lifecycle" for the files stored there. Make sure to edit the storage provider configuration to don't use this feature.

When enabled, the storage provider will keep copies of all the states of the files (modified, deleted, etc.) which may seriously increase your storage costs. We highly recommend to always disable this kind of settings, when asked select to keep only the last version of the file.

# Providers

# Alibaba Cloud OSS

The Alibaba Cloud OSS API allows to upload images to Alibaba Cloud (Aliyun) Object Storage System (OSS) (opens new window).

# Amazon S3

The Amazon S3 API allows to upload images to an Amazon S3 (opens new window) bucket. You will need an Amazon Web Services (opens new window) (AWS) account for this.

To setup Amazon S3:

  • Create access credentials from Identity and Access Management (opens new window) console
    • Click on Create users and create a new user
    • On permissions, click on Add permissions and select Attach policies directly and associate AmazonS3FullAccess
    • Click on Create access key and proceed to create the access key for Third-party service
    • Store the user name, Access Key and Secret access key at the end of the process
  • Create a bucket from the S3 console (opens new window)
    • Click on Create bucket and select AWS Region and Bucket name (store these)
    • On Object Ownership, make sure to select ACLs enabled and select Bucket owner preferred for the access control list
    • On Block Public Access make sure to leave unchecked Block all public access and make sure objects have public access
    • On Bucket Versioning, make sure to disable Bucket Versioning

If you want to use a custom domain follow the CNAME (opens new window) documentation. Otherwise just make sure that the Storage URL ends with /<your_bucket_name>/

# Backblaze B2

The Backblaze B2 API allows to upload images to Backblaze's cloud storage system (opens new window).

  1. Go to B2 Cloud Storage and click on Create a Bucket
  2. Files in Bucket are: Public
  3. Go to App Keys and click on Add a New Application Key
    1. Type of Access: Read and Write
  4. When done, use the following reference:

Select S3 Compatible storage API for B2 S3 Storage (current offering):

B2 Value Chevereto Storage
Region us-west-002 (take note from your Endpoint)
keyID Storage key
applicationKey Storage secret
Endpoint* https://s3.us-west-002.backblazeb2.com
URL https://f002.backblazeb2.com/file/your_bucket/

(*) You will find the endpoint under the bucket details.

Select Backblaze B2 storage API for legacy B2 Storage:

B2 Value Chevereto Storage
keyID Storage key (Account ID)
applicationKey Storage secret (Master Application Key)

# FTP

The FTP API allows to upload images to a server implementing the File Transfer Protocol (opens new window).

# Google Cloud

The Google Cloud API allows to upload images to a Google Cloud Storage bucket. You will need a Google Cloud (opens new window) service account and activate cloud storage (opens new window) for this.

To setup Google Cloud Storage:

  • Create a project
  • Go to APIs & services dashboard and make sure that Google Cloud Storage JSON API is enabled.
    • If is not enabled click on Enable API and Services and enable Google Cloud Storage JSON API
  • Go to Cloud Storage then click on Browser
  • Create a bucket by clicking Create bucket button. Make sure to:
    • Prevent public access: Unselect Enforce public access prevention on this bucket as you want public access for the bucket
    • Access control: Fine-grained
  • Go to Credentials under APIs & services, click on Create credentials then click on Service account. Make sure to use the following settings:
    • Grant access: Role owner
    • Key type: JSON
  • When done, go to your newly created service account under Service Accounts
  • Go yo keys and create a new JSON key
  • Your browser will start to download the JSON key file, the contents of the file is what you need to paste on Chevereto's Secret Key textarea

# Local

The Local API allows to upload images to any filesystem path in the server.

# Microsoft Azure

The Microsoft Azure API allows to upload images to Microsoft Azure Storage (opens new window).

# OpenStack

The OpenStack API allows to upload images to an OpenStack (opens new window) container.

  • OpenStack configuration for RunAbove:
    • Identity URL: https://auth.Runabove.io/v2.0 (opens new window)
    • Username: Your RunAbove username
    • Password: Your RunAbove password
    • Region: SBG-1 or BHS-1 This is the data center where your container was created
    • Container: Name of your created container
    • Tenant id: Leave it blank
    • Tenant name: Your project id, found on OpenStack Horizon on the left side (CURRENT PROJECT))
    • URL: Your URL to access the container (see RunAbove CNAME (opens new window))

# S3 Compatible

The S3 Compatible API allows to upload images to any server implementing the Amazon S3 standard, also known as "AWS S3 API". The configuration is exactly the same as Amazon S3, but it requires to provide the provider endpoint.

Some providers supporting S3 API are:

  • Vultr Object Storage (use region us-east-1)
  • Ceph
  • DigitalOcean Spaces
  • Dreamhost Cloud Storage
  • IBM COS S3
  • Minio
  • Scaleway
  • StackPath
  • Tencent Cloud Object Storage (COS)
  • Wasabi

# SFTP

The SFTP API allows to upload images to a server implementing the SSH File Transfer Protocol (opens new window).