Reference

Environment variables

Everything the server reads from its environment. With the compose setup, put them in /opt/homespace/.env and recreate the server: sudo docker compose up -d --force-recreate server.

Empty values count as unset. Booleans accept true or false; sizes are in bytes. The server checks the settings on start and stops with a message naming the variable if one is wrong.

Database

The compose file builds the database address for you.

DATABASE_URLRequired

PostgreSQL connection URL. The compose file sets it without a password, which comes from HOMESPACE_DB_PASSWORD; set it yourself only for a database outside the compose file. A password in the URL must be percent-encoded where it has URL-special characters (@ / : ?), so prefer HOMESPACE_DB_PASSWORD.

Format
postgres://USER@HOST:PORT/DATABASE or postgres://USER:PASSWORD@HOST:PORT/DATABASE
Example
postgres://homespace@db:5432/homespace
Default
none

HOMESPACE_DB_PASSWORDRequired

The password of the database user, used when DATABASE_URL has none, so it needs no URL encoding. compose.yaml also gives it to Postgres, which applies it only when the database is first created. homespace-ctl reads it too. Set this or HOMESPACE_DB_PASSWORD_FILE, not both.

Values
text, e.g. from openssl rand -hex 24
Default
none, compose refuses to start without it

HOMESPACE_DB_PASSWORD_FILE

Path of a file holding the database password, for Docker or Podman secrets. A trailing newline is ignored.

Values
a file path inside the container
Example
/run/secrets/db_password
Default
unset

Sign-in tokens and secrets

See also the note on the signing secret and rotating the secrets.

HOMESPACE_JWT_SECRETRequired

Secret that signs access tokens and one-time tickets. Anyone who knows it can sign tokens, so generate it and keep it private. Set this or HOMESPACE_JWT_SECRET_FILE, not both.

Values
at least 32 characters, at least 10 different ones, not a change-me… placeholder
Generate
openssl rand -base64 48
Default
none, the server refuses to start without it

HOMESPACE_JWT_SECRET_FILE

Path of a file holding the signing secret, for Docker or Podman secrets. A trailing newline is ignored.

Values
a file path inside the container
Example
/run/secrets/homespace_jwt_secret
Default
unset

HOMESPACE_SECRETS_KEY

Key that seals the secrets of authenticator apps (two-factor sign-in) in the database, so a backup does not give them away. Without it nobody can add an authenticator app; everything else works. Never lose it and never change it by hand: what it sealed opens with no other key, and the server refuses to start with a key other than the one it sealed with. Change it only with homespace-ctl secrets rotate. Set this or HOMESPACE_SECRETS_KEY_FILE, not both.

Values
same rules as HOMESPACE_JWT_SECRET, and different from it
Generate
openssl rand -base64 48
Default
unset: no authenticator apps

HOMESPACE_SECRETS_KEY_FILE

Path of a file holding the secrets key, for Docker or Podman secrets. A trailing newline is ignored.

Values
a file path inside the container
Example
/run/secrets/secrets_key
Default
unset

HOMESPACE_JWT_SECRET_PREVIOUS

No longer read: earlier versions kept a rotated-out signing secret here, which went on working. The server refuses to start while it is set (as with HOMESPACE_SECRETS_KEY_PREVIOUS). Remove it and rotate with homespace-ctl secrets rotate.

Default
unset, and must stay unset

HOMESPACE_ACCESS_TTL_SECS

Lifetime of an access token in seconds. Clients renew them in the background with their refresh token.

Values
whole seconds
Default
900 (15 minutes)

HOMESPACE_REFRESH_TTL_SECS

Lifetime of a refresh token in seconds: how long a device stays signed in without being used.

Values
whole seconds
Default
2592000 (30 days)

Network and proxy

HOMESPACE_PUBLIC_URL

The address users open, without a trailing path. Required for single sign-on; otherwise it names the origin of the web client when a proxy does not pass Host on.

Values
an https:// URL (http:// only for localhost)
Example
https://files.example.com
Default
unset

HOMESPACE_TRUST_FORWARDED_FOR

Take the client's address from X-Forwarded-For. Failed sign-ins are counted per client address; behind a proxy, without this, every client counts as one. Leave it off when clients reach the server directly, as they could forge the header.

Values
true or false
Default
false

HOMESPACE_BIND

Address and port the server listens on. The image already listens on all interfaces in the container; change the published port with HOMESPACE_PORT instead.

Values
IP:PORT
Default
0.0.0.0:8080 in the image, 127.0.0.1:8080 outside it

HOMESPACE_PORT

Host port the compose file publishes the server on (on 127.0.0.1). The server only shows it on the administration page.

Values
a port number
Default
8080

Storage

HOMESPACE_STORAGE

Where file content is kept. Object storage (S3, Azure Blob) is planned.

Values
local
Default
local

HOMESPACE_STORAGE_ROOT

Directory of the file content for local storage. In the image it is the /data volume.

Values
a directory path
Default
/data in the image, ./data outside it

HOMESPACE_WEB_ROOT

Directory with the web client the server serves. The image has it built in; unset means the server serves only the API.

Values
a directory path
Default
/srv/web in the image

Uploads and transfers

HOMESPACE_MAX_UPLOAD_BYTES

Largest file accepted, however it is uploaded.

Values
bytes
Example
53687091200 (50 GiB)
Default
10737418240 (10 GiB)

HOMESPACE_UPLOAD_CHUNK_BYTES

Largest single upload request. Smaller files go up in one request, larger ones in chunks of this size. Keep it below the request limit of any proxy in front (nginx client_max_body_size; Cloudflare 100 MB). It does not limit the file size.

Values
bytes
Default
33554432 (32 MiB)

HOMESPACE_UPLOAD_EXPIRY_HOURS

Unfinished chunked uploads that receive nothing for this long are deleted.

Values
hours
Default
24

HOMESPACE_TRANSFER_TTL_HOURS

Files sent to a device are deleted this long after they were sent, received or not.

Values
hours, at least 1
Default
24

HOMESPACE_MAX_TRANSFER_BYTES

Most bytes one transfer to a device may hold.

Values
bytes
Default
unset: no limit beyond HOMESPACE_MAX_UPLOAD_BYTES per file

Housekeeping

HOMESPACE_USER_DELETION_DELAY_MINUTES

A user an administrator deleted is removed with all their files this long afterwards. Until then the deletion can be cancelled.

Values
minutes
Default
10

HOMESPACE_CHANGES_RETENTION_DAYS

How long the change journal keeps entries. Clients offline for longer do a full resync.

Values
days
Default
unset: the journal is compacted to the latest entry per file and kept

Single sign-on (OpenID Connect)

Setting HOMESPACE_OIDC_ISSUER turns single sign-on on. Guides: Keycloak, other providers.

HOMESPACE_OIDC_ISSUER

Issuer URL of the provider; turns single sign-on on. Must match the issuer of the provider's discovery document exactly. Needs HOMESPACE_OIDC_CLIENT_ID and HOMESPACE_PUBLIC_URL.

Values
an https:// URL
Example
https://auth.example.com/realms/homespace
Default
unset: single sign-on off

HOMESPACE_OIDC_CLIENT_ID

Client ID registered at the provider. Required with an issuer.

Values
text
Default
unset

HOMESPACE_OIDC_CLIENT_SECRET

Client secret registered at the provider. Set this or HOMESPACE_OIDC_CLIENT_SECRET_FILE, not both.

Values
text
Default
unset

HOMESPACE_OIDC_CLIENT_SECRET_FILE

Path of a file holding the client secret, for Docker or Podman secrets. A trailing newline is ignored.

Values
a file path inside the container
Example
/run/secrets/oidc_client_secret
Default
unset

HOMESPACE_OIDC_SCOPES

Scopes requested from the provider, separated by spaces.

Values
space-separated scopes, including openid
Example
openid profile email groups
Default
openid profile email

HOMESPACE_OIDC_NAME

Label of the sign-in button.

Values
text
Default
Single sign-on

HOMESPACE_OIDC_REQUIRED_GROUP

Only users with this group in their ID token may sign in through the provider.

Values
a group name as the provider sends it
Example
family
Default
unset: every user of the provider

HOMESPACE_OIDC_GROUPS_CLAIM

ID token claim that lists the user's groups, as one string or a list of strings.

Values
a claim name
Example
https://files.example.com/groups (Auth0)
Default
groups

HOMESPACE_PASSWORD_LOGIN

Allow signing in with a username and password. Set false to turn passwords off: users sign in through the provider, and local accounts with a passkey. Turn it off only after an administrator has signed in through the provider.

Values
true or false
Default
true

Logging

RUST_LOG

Which log messages the server writes to its output (docker compose logs server). A list of directives separated by commas: a bare level applies to everything, target=level to one part of the server.

Levels
off, error, warn, info, debug, trace (each includes the ones before it)
Targets
homespace (startup, background jobs, commands), api (requests), auth (sign-in and single sign-on), files (uploads, storage, transfers), search (the search index), and libraries such as sqlx (database) and hyper (HTTP)
Default
info
ValueLogs
infoStartup, migrations, warnings and errors. Right for most servers.
warnOnly warnings and errors.
info,files=debugAlso why a transfer to a device was refused.
info,sqlx=debugAlso every database query, for database problems.
debug,sqlx=warnDebug output of the server and its libraries, without each database query.

debug and trace are verbose and can include file paths and database queries: use them for troubleshooting, then go back to info.