8.4. File store configuration

DHIS2 is capable of capturing and storing files. By default files will be stored on the file system of the server which runs DHIS2 in a files directory under the DHIS2_HOME external directory location.

You can also configure DHIS2 to store files on cloud-based storage providers. Currently, AWS S3 is the only supported provider. To enable cloud-based storage you must define the following addtional properties in your dhis.conf file:

# File store provider. Currently 'filesystem' and 'aws-s3' are supported.
filestore.provider = filesystem

# Directory / bucket name. Refers to subdirectory in external directory on file system and bucket on AWS S3.
filestore.container = files

# The following configuration is applicable only on non-filesystem providers (AWS S3)

# Datacenter location. Not required but recommended for performance reasons.
filestore.location = eu-west-1

# Public identity / username
filestore.identity = xxxx

# Secret password (sensitive)
filestore.secret = xxxx

This configuration is an example reflecting the defaults and should be changed to fit your needs. In other words, you can omit it entirely if you plan to use the default values. If you want to use an external provider the last block of properties need to be defined, as well as the provider property being set to a supported provider (currently only AWS S3).

For a production system the initial setup of the file store should be carefully considered as moving files across storage providers while keeping the integrity of the database references could be complex. Keep in mind that the contents of the file store might contain both sensitive and integral information and protecting access to the folder as well as making sure a backup plan is in place is recommended on a production implementation.

A note on external provider support: AWS S3 is the only supported provider at the moment but more providers are likely to be added, such as Google Cloud Store and Rackspace Cloud Files. Let the developers know if you have inquiries about adding support for more providers.