Settings

Most settings are in the Control panel. A few are given when the container starts.

On this page
  1. The settings
  2. With docker run
  3. With Docker Compose
  4. Memory
  5. Where the data is kept

The settings

SettingDefaultDescription
THIRTYFILE_ADMIN_PASSWORDrandomPassword of the admin account. Used on the first start only. The example choose-a-password counts as not set
THIRTYFILE_ADMIN_PASSWORD_FILEA file holding that password instead, for example a Docker secret
THIRTYFILE_SECURE_COOKIEfalseSet to true when the site uses HTTPS (a Site URL starting with https:// does the same). Cookies are then only sent over HTTPS, and browsers are told to use HTTPS only for a year (HSTS)
THIRTYFILE_TRUST_PROXYfalseSet to true when the site is behind a reverse proxy on the same computer or Docker network. For a proxy on another computer, list its addresses instead, for example 203.0.113.7, 10.1.0.0/16. An address written the IPv6 way, like ::ffff:172.18.0.1, counts as the IPv4 address it holds (a network needs at least /96: ::ffff:172.18.0.0/112 is 172.18.0.0/16). true trusts every private address, including other computers on your network; a list of the proxy's addresses is safer. What a proxy says about the request (X-Forwarded-For, -Host and -Proto) is only believed from these addresses
THIRTYFILE_TRASH_DAYS30Days items stay in the trash. 0 keeps them forever
THIRTYFILE_MAX_UPLOAD_MB0Largest file that can be uploaded. 0 means no limit
THIRTYFILE_DB_CACHE_MB16Database cache per connection, in MB (up to 8 connections). Raise it on a large server with many users
THIRTYFILE_THUMBNAIL_JOBS1 or 2Thumbnails made at the same time: 1 when the server or container has less than 2 GB of memory, else 2
THIRTYFILE_RUN_AS1000:1000User and group the server runs as. The data and storage folders are given to them on start. Set by the image; the server program on its own keeps running as the user who started it
THIRTYFILE_LOG_FORMATtextjson writes one JSON object per log line, for log collectors
RUST_LOGthirtyfile=infoHow much is logged, for example thirtyfile=debug while looking into a problem
TZUTCTime zone, for example Asia/Taipei
THIRTYFILE_SECRET_KEYsecret.key in /dataKey that encrypts the passwords and keys saved in the database (storage locations, single sign-on, the signing secret): 64 hex characters, for example from openssl rand -hex 32. Without it, a key is created in /data/secret.key on first start. See Upgrade and backup
THIRTYFILE_SECRET_KEY_FILEA file holding that key instead, for example a Docker secret
THIRTYFILE_ADDR0.0.0.0:8080Address and port the server listens on inside the container. To use another port on your computer, change the published port (-p 9000:8080) instead
THIRTYFILE_DATA/dataFolder for the database, thumbnails and uploads in progress. Set by the image; mount a folder there rather than changing it. The server program on its own uses ./data
THIRTYFILE_STORAGE/storageFolder of the built-in storage location. Set by the image, like THIRTYFILE_DATA. The server program on its own uses blobs in the data folder

Settings that are on or off take true or false (also 1/0, yes/no and on/off, in any letter case). In compose.yaml, put them in quotes ("true"), otherwise YAML turns them into something else.

With docker run

Add one -e for each setting:

docker run -d --name thirtyfile --restart unless-stopped -p 8080:8080 \
  -v /srv/thirtyfile/data:/data -v /srv/thirtyfile/storage:/storage \
  -e THIRTYFILE_ADMIN_PASSWORD='choose-a-password' \
  -e TZ=Asia/Taipei \
  -e THIRTYFILE_TRASH_DAYS=60 \
  ghcr.io/thirtyfile/thirtyfile:latest

To change a setting later, stop and remove the container, then run the command again with the new value. Your files are kept.

docker stop thirtyfile && docker rm thirtyfile

With Docker Compose

Add them under environment: in compose.yaml, then run docker compose up -d again:

    environment:
      TZ: Asia/Taipei
      THIRTYFILE_TRASH_DAYS: "60"

Memory

ThirtyFile needs about 100 MB of memory while idle and usually stays below 300 MB. Making thumbnails of large pictures takes the most: up to about 280 MB for each thumbnail made at the same time. It runs on a NAS or Raspberry Pi with 1 GB of memory: with less than 2 GB, it makes one thumbnail at a time and lowers the memory a picture may take to decode (pictures above the limit get no thumbnail).

To keep ThirtyFile from using more than a set amount, give the container a memory limit, for example --memory 512m with docker run, or mem_limit: 512m in compose.yaml. ThirtyFile reads the limit on start and adjusts to it.

Where the data is kept

The container uses two folders. Mount a folder of your computer on each:

In the containerContents
/dataAccounts, settings, logs, thumbnails and uploads in progress. Stays small
/storageYour files, in the built-in storage location, as ordinary folders: company, teams/<space name>, users/<user name>. Grows with your files

They don't have to be on the same disk: /storage can be a large disk or a NAS mount. Missing folders are created, and on start both are given to user 1000 (see THIRTYFILE_RUN_AS), so there is no need to change their owner yourself.

Other disks can be added as more storage locations: mount them into the container, for example -v /mnt/nas:/nas, then add /nas under Control panel › Storage locations. See Storage locations.