Configuration
Brick Bin is configured with environment variables. There are fourteen. Most installs set two and leave the rest alone.
On this page
Put them in the .env file beside your compose file, then run docker compose up -d again so the app restarts with them. The .env.example next to each compose file lists them. Every variable name below is a link you can share.
The Default column is the app's own default, and a variable you leave out keeps it. The note under a row says what the compose files do instead.
The ones you must set
With either compose file, these are all most installs need. You don't set DATABASE_URL: the compose files build it from POSTGRES_PASSWORD.
| Variable | Purpose | Default |
|---|---|---|
| POSTGRES_PASSWORD | Password for the app’s own Postgres. Both compose files refuse to start without it. | Set it |
| TS_AUTHKEY | Tailscale auth key for the sidecar, in the Tailscale install.The try-out compose file doesn’t use it. | Set it |
Server
| Variable | Purpose | Default |
|---|---|---|
| DATABASE_URL | Postgres connection string.Both compose files build it from POSTGRES_PASSWORD. Set it yourself only when running Brick Bin without them. | Built for you |
| APP_PORT | Port the app is published on.Only the try-out compose file reads it. The Tailscale install always publishes 3000. | 3000 |
| COOKIE_SECURE | Set true once the app is served over HTTPS.The Tailscale install sets it to true itself. | false |
| DATA_DIR | Where covers, instruction PDFs and catalog files are kept.Both compose files keep it at /data, on the app-data volume. | ./data |
| AUTO_MIGRATE | false skips database migrations on start. | true |
| APP_VERSION | Release label, sent in the catalog import’s User-Agent.Both compose files pass it on only when it's set. Otherwise the Tailscale install uses the commit its image was built from, and the try-out compose file uses dev. | 0.1 |
Storage and limits
| Variable | Purpose | Default |
|---|---|---|
| TRASH_RETENTION_DAYS | Days a deleted item waits in the trash before it's deleted for good. 0 keeps it until an admin deletes it. | 30 |
| INSTRUCTIONS_MAX_MB | Largest PDF the app will store, in megabytes. | 200 |
Catalog import
These control where the catalog import may download from. Catalog data comes from Rebrickable, and the defaults point there.
| Variable | Purpose | Default |
|---|---|---|
| REBRICKABLE_PAGE_FETCH | true lets the import fetch the downloads page itself. Otherwise an admin pastes the page's source. | false |
| REBRICKABLE_DOWNLOADS_PAGE | Address of the downloads page, https://rebrickable.com/downloads/. | Rebrickable’s page |
| REBRICKABLE_ALLOWED_ORIGINS | Origins the import may download from, comma-separated. HTTPS only. By default https://rebrickable.com and https://cdn.rebrickable.com. | Rebrickable and its CDN |
| CATALOG_IMAGE_ORIGIN | The only origin set covers are downloaded from, https://cdn.rebrickable.com. | Rebrickable’s CDN |
Leave the page fetch off for now
Until Rebrickable confirms that automated page reads are fine, keep REBRICKABLE_PAGE_FETCH at false and paste the page. The tutorial shows how.
A typical .env
The recommended Tailscale install, with everything else left at its default.
POSTGRES_PASSWORD=choose-something-long
TS_AUTHKEY=tskey-auth-…Keep a copy of this file with your backups, and keep it out of any repository.
Variables used only by the project's tests aren't listed.
Questions?FAQ →Short answers, including the ones that are “not yet”.