Skip to main content
Stashy is configured entirely through environment variables. Create a .env file or export them directly.

Environment Variables

VariableDescriptionDefault
PORTServer listen port8080
HOSTNAMEPublic base URL (used for OAuth redirect)http://localhost:$PORT
DB_DSNDatabase connection stringfile:stashy.db
STORAGE_BACKENDmemory, local, or gcsmemory
LOCAL_STORAGE_DIRDirectory for local file storage./storage
GCS_BUCKETGCS bucket name (required when backend is gcs)
SESSION_SECRETHMAC key for signing session cookiesrequired
GOOGLE_CLIENT_IDGoogle OAuth 2.0 client IDrequired
GOOGLE_CLIENT_SECRETGoogle OAuth 2.0 client secretrequired
ALLOWED_DOMAINSComma-separated list of allowed email domainsall allowed

Example .env

HOSTNAME=https://stashy.example.com
SESSION_SECRET=change-me-to-a-random-string
GOOGLE_CLIENT_ID=123456789.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=GOCSPX-xxxxx
STORAGE_BACKEND=local
LOCAL_STORAGE_DIR=/var/lib/stashy/storage
DB_DSN=file:/var/lib/stashy/stashy.db
ALLOWED_DOMAINS=example.com,mycompany.org
Always set SESSION_SECRET to a strong random value in production. Never use the default.