Skip to content

Environments and secrets ​

Keep development work separate from production by configuring each environment with its own services and credentials.

The default Fly.io setup uses one Fly app per environment. Desktop and the CLI read fly.toml for a single target. To add a named target, run this from your app directory with your intended Fly app name.

sh
npm exec -- kambium backend setup --env dev --fly-app my-app-dev

This creates fly.dev.toml and adds a fly:deploy:dev script to package.json. Deploy with npm run fly:deploy:dev after configuring the Fly app. Use the same setup command to add a missing script for an existing TOML. Commit both files. When named targets exist, Desktop and the Kit CLI use those targets. Give each named environment its own Fly app.

In Desktop, pick an environment below the Cloud tab. The menu next to the picker opens Manage environments, which lists each Fly app, TOML file and secrets provider.

Save commit-safe settings such as the app URLs in the selected file's [env] table. Put private runtime values in that Fly app's secrets. Desktop stages private values and applies them on the next deployment. Follow the Fly deployment guide to set up the app.

Manage secrets in Doppler

With the Doppler CLI installed, select an environment in the Cloud sidebar. In Configuration, choose Change secrets provider on the Fly sign-in screen, or open Secrets provider options and choose Doppler if you're signed in to Fly. Sign in to Doppler through your browser. Select the Doppler project and configuration, then confirm Switch to Doppler. Switching changes where Desktop saves future settings. Copy the existing values you need into Doppler, then set up a sync from that config to the matching Fly app. Use separate configs for development and production. Doppler Fly sync setup

Desktop saves private values to Doppler, including generated keys, the Supabase backend key, and the Redis connection URL. Public settings still go in the Fly TOML's [env] table. Sign in to Fly to create an app or Redis database, check the synced values' deployment status, or deploy.

The Configuration count reflects the settings in Doppler and TOML. Review deployment checks which required settings have reached Fly. If a sync is still in progress, refresh and review again after it completes. Turn off the sync for the app in Doppler before switching its secrets provider back to Fly.

To run code on your computer with the same development credentials, see Run locally with hosted services.

Service roles ​

Default Kambium Kit production deploymentThe browser sends dashboard and API requests to one Fly.io app. That app serves the Vue dashboard and runs the API and workers. It uses Supabase for Auth and Postgres and Redis for caching and coordination.Dashboard and API requestsUser browserOne Fly.io appVue dashboard, API andworkersSupabaseAuth and PostgresRedisCaching and coordination
  • One Fly.io app runs the API and background workers and serves the Vue dashboard by default. Deploy to Fly
  • Supabase provides Auth and Postgres, which stores workspaces, engines and queued tasks. Set up Supabase
  • Redis handles caching and coordination. Desktop can create a managed Upstash database in your Fly organization or connect an existing Redis instance. Connect Redis
  • For production sign-in email, configure SMTP in Supabase or use Kit's optional Postmark email hook. Configure sign-in email

Sentry reporting is optional.

Use another deployment host

Install private npm package read credentials on the build host. Commit the app's source, package.json and package-lock.json; use npm ci for subsequent builds. From the app directory, run npm run build, then start with npm start.

Build the generated Docker image from the app directory:

sh
docker build --secret id=npmrc,src="$HOME/.npmrc" -t my-app .

The npm configuration must contain usable private registry credentials. Supply the required runtime settings through the host's secret store and publish port 3000. The image runs Node as a non-root user. Docker mounts the registry credentials during dependency installation.

Serve the backend and dashboard through HTTPS, configure proxy trust for the host and provide the dashboard's API routing. Keep the backend running for background jobs with a supervisor that forwards SIGTERM and allows more than ten seconds for shutdown. Rebuild after source changes and restart after changing settings.

Follow deployment verification for callbacks and engine checks, and updates and rollback for later releases.

For local code using shared development infrastructure, see Run locally with hosted services.