Skip to Content
LogiStackDocs
Deploy

Production, staging and custom environments

Create production, staging and custom environments in a LogiStack project, duplicate one into another, recolor them and set the default.

An environment is an isolated set of services, variables and domains inside a project. Services in one environment share a private network and can't reach services in another, so a staging app never talks to the production database by accident. Use environments to run the same project at different stages, such as Production and Staging, or to give a client their own copy.

Environment kinds

Every project starts with a Production environment. When you create another, you pick its Kind:

KindTypical use
ProductionWhat your users reach
StagingA pre-release copy for testing
PreviewA short-lived copy for a pull request. LogiStack creates these itself; see Preview environments
CustomAnything else, like demo or client-acme

The kind sets the default color of the environment's dot. It doesn't change how services run.

Create an environment

Open the project

Select Projects in the sidebar and open the project. The environment tabs sit above the services.

The Storefront project page with its environment tabs and services

Add the environment

Select New environment. In the dialog, enter a Name such as Staging and pick the Kind. Select Create environment.

Add services

The new environment is empty. Select New service to add services to it, or duplicate an environment instead to start from a copy.

Change an environment

Select the settings icon next to the environment tabs (labelled <name> settings) to open its menu:

  • Open by default: the project opens on this environment.
  • Variables: the variables every service in this environment inherits. See Environment variables.
  • Duplicate…: start a new environment from this one. See below.
  • Export manifest: download the environment as a YAML manifest.
  • Color: pick one of six colors for the environment's dot, shown across the dashboard.

The settings menu of the Production environment, with Open by default, Variables, Duplicate, Export manifest and the colors

Duplicate an environment

Duplicating creates a new environment in the same project with the services, Git stacks, settings and config files of another, for example Staging from Production. You need permission to change the project.

CopiedNot copied
Services, with their source, build, resources, health checks and config filesDomains: a hostname points at one environment
Stacks deployed from GitVolume and database data: new volumes start empty
Environment and service variables, if you choose toBackup policies

Open the source environment's menu

Open the project, select the environment to copy, then select its settings icon and Duplicate….

Name the copy

Copy from shows the source; change it if needed. Enter a Name such as Staging and pick the Kind. Select Continue.

The Name the copy step of the Duplicate environment wizard, copying from Production

Choose what comes over

Under What comes over, pick Copy variables or Start without variables. Copied secrets stay encrypted. Start without variables when the copy must not reach the source's databases or APIs. Select Continue.

Review and duplicate

Check the summary and select Duplicate environment. The project opens on the new environment.

Add domains and deploy

Nothing is deployed yet. Point variables such as DATABASE_URL at the copy's own database, add domains, then select Deploy on each service.

Secrets are copied only if you can read them in the source environment. Otherwise the copy lists each one as a warning and you set it on the new service's Environment tab.

Each environment gets its own volumes and databases. Duplicating copies the configuration, not the data. To copy data, restore a backup into the new database. See Restore.

With the API

POST /api/environments/{id}/duplicate does the same; over MCP it is the environment_duplicate tool. A name already taken in the project returns 409, and a copy that fails halfway is removed, so retrying is safe.

Duplicate Production into Staging
curl -fsS -X POST "https://stack.example.com/api/environments/env_storefront_production/duplicate" \
  -H "x-api-key: $LOGISTACK_API_KEY" \
  -H "content-type: application/json" \
  -d '{ "name": "Staging", "kind": "staging", "includeVariables": true }'

Copy with changes, or into another project

To change hostnames or values on the way, or to copy into another project, use a manifest: open the source environment's menu and select Export manifest, edit the file, then open the target project's actions menu, select Import manifest… and apply it to the target environment. Secret values are never exported, so set them after applying. See Project manifests.

Common problems

  • A service in one environment can't reach another's database: by design. Each environment has its own network. Put both services in the same environment.
  • The import reports a name that matches nothing: the manifest names a Git provider, S3 destination, DNS provider or certificate that doesn't exist in this organization. Create it, or fix the name.
  • The copy's services don't start: duplicating or applying a manifest doesn't deploy. Select Deploy on each service.
  • "This project already has an environment with that name": environment names map to unique slugs within a project. Pick another name.

On this page