Skip to main content
Back to Docs/Configuration
Customer Docs

Configuration

Customer-facing documentation for onboarding, deployment, storage providers, AI providers, and migration planning.

Configuration

Status: PUBLISHED Last updated: 2026-05-04 Applies to: Community Self-Deploy

What it does

Lists the main environment variables used by the current self-host setup so you can move from the default compose evaluation stack to local MongoDB or MongoDB Atlas without guessing at required keys. It also calls out the extra storage settings needed before storage-backed asset upload/download flows will work.

When to use it

  • You want to generate a reusable local env file.
  • You want to point img-man at an existing MongoDB deployment.
  • You want to configure social sign-in, custom ports, or a default storage bucket.

Step-by-step

  1. Generate a starting file — run node --experimental-strip-types scripts/self-host-bootstrap.ts --file .env.self-host.
  2. Edit the values you need — keep the generated secrets, then replace database or auth settings for your environment.
  3. Pass the file to Compose — run docker compose --env-file .env.self-host up --build.
  4. Restart after changes — stop and start the stack again whenever you change env values.

Common variables

VariableRequiredDefault for local evalWhat it controls
PORTYes3000Internal app port inside the container.
IMAGEMAN_PORTNo3000Host port published by Docker Compose.
NEXTAUTH_URLYeshttp://localhost:3000Public base URL used by NextAuth and generated links.
NEXTAUTH_SECRETYesGenerated or compose defaultSession signing and auth security.
ASSET_URL_SIGNING_SECRETRecommendedGenerated or compose defaultSigned asset and fallback delivery URLs.
AUTH_TRUST_HOSTYestrueAllows host trust in self-host setups behind Docker/reverse proxies.
MONGODB_URIYesmongodb://localhost:27017/imageman or compose default mongodb://mongo:27017/imagemanMongoDB connection string.
MONGODB_DBNoimagemanLogical database name.
GCP_PROJECT_IDRequired for default GCP storageunsetDefault Google Cloud project used when an org is not configured for BYOC.
GCP_STORAGE_BUCKETRequired for default GCP storageunsetDefault bucket used for signed upload/download URLs outside BYOC.
GCP_APP_CREDENTIALS_PATHRequired for default GCP storage unless GOOGLE_APPLICATION_CREDENTIALS is already setunsetPath to the service-account JSON used for default GCP storage access.
HEALTHCHECK_REQUIRE_STORAGENo1When 1, /api/health/ready requires both DB and storage checks to pass. Set to 0 to require DB only.
GOOGLE_CLIENT_IDNounsetEnables Google sign-in when paired with the secret.
GOOGLE_CLIENT_SECRETNounsetEnables Google sign-in when paired with the client ID.
GITHUB_CLIENT_IDNounsetEnables GitHub sign-in when paired with the secret.
GITHUB_CLIENT_SECRETNounsetEnables GitHub sign-in when paired with the client ID.

Tips & limits

  • Keep generated secrets stable across restarts if you want persistent sessions.
  • If you publish img-man on a non-default port, update both IMAGEMAN_PORT and NEXTAUTH_URL.
  • The bootstrap script generates local-safe defaults, not production secrets management.
  • Storage-backed asset uploads, signed downloads, and public share asset URLs need either the default GCP variables above or a BYOC bucket configured in the dashboard.
  • Provider-specific storage and AI configuration is separate from the base self-host boot path.

Troubleshooting

ProblemCauseFix
Sign-in loops back to /signinNEXTAUTH_URL or NEXTAUTH_SECRET changed unexpectedly.Set stable values and restart the stack.
Readiness fails after swapping MongoThe new MONGODB_URI is unreachable or incorrect.Test the connection string separately, then restart Compose.
/api/health/ready returns 503 with a bucket/storage promptStorage credentials or bucket config is invalid (for example invalid_grant: account not found) while storage readiness is required.Reconnect bucket credentials in Settings -> Storage or fix GCP_PROJECT_ID, GCP_STORAGE_BUCKET, and service-account credentials, then restart.
OAuth buttons do not show upProvider variables are missing or incomplete.Set both client ID and secret for the provider and restart.

Related

Source: customer-docs/configuration.md