Docker Manager

Stacks

Create, deploy, edit, import and export your stacks.

A stack is a Compose project Docker Manager manages: a compose.yaml, an optional .env and any other files its services need. Docker Manager keeps each stack in its own folder on its server and runs exactly what the files say.

Create a stack

  1. Open Stacks and press Create Stack.
  2. Pick the Environment (only when you have more than one).
  3. Enter a Name, for example photos: up to 63 lowercase letters, digits, - and _, starting with a letter or digit.
  4. Write or paste your Compose File, and a .env File if you use one.
  5. Press Create Stack, or choose Create Stack ▾ → Create and Deploy to deploy it right away. Validate checks the files first.

To start from a template, use Create Stack ▾ → Create Stack From Template (see Templates). Docker Manager never overwrites anything: if a folder or Compose project with that name already exists, it tells you and suggests importing it.

A stack runs on an environment. Until you have one, Stacks offers Add Environment instead; the ways to create or import a stack appear once you have one.

You can also copy a folder with a compose.yaml into Docker Manager's stacks folder (the docker-manager_stacks volume on that server). It becomes a stack within about 30 seconds (later while a restore, an import, a move or a rename runs on that server), but nothing starts until you press Deploy. If a file such as .env is missing, Deploy says what to fix.

The stack page

  • Overview: status, CPU, memory and the services with their containers, images, volumes, networks and ports. Each service row can start, restart, stop or force recreate that service, or open its logs or a terminal.
  • Files, Logs and Terminal: see File Manager, Logs and Terminal.
  • Revisions: every version of the Compose files.
  • Backups, Settings and Activity: its backups, whether updates and backups cover it, and its jobs and audit records. The Backups card on Settings shows Covered, Excluded or how the last backup went (Last Backup Failed, Partly Backed Up), the volumes it uses that another stack's backup holds, and the folders outside its own folder that aren't backed up.

Deploy, start and stop

Deploy makes the server run what your files say; only services whose settings changed are recreated. The menu next to it has:

  • Pull and Deploy: downloads every image first, for newer images.
  • Pull: only downloads the images; the next deploy runs them.
  • Force Recreate: asks first, then replaces every container, even if nothing changed. Volumes and files are kept; changes made inside a container outside its volumes are lost.
  • Remove Orphans and Deploy: asks first, then removes the containers of services you deleted from compose.yaml and deploys. Volumes and files are kept.
  • Down: asks first, then removes the containers and networks, like docker compose down; the stack shows Down. Named volumes, images and files stay. Anonymous volumes are left behind, so the next start creates new, empty ones.

A stack whose Compose file has a build: section also has Build: it builds with the base images already on the server and deploys nothing. Its menu adds Pull and Build, Build and Deploy and Pull, Build and Deploy. While a build runs, Show Output opens the full output.

A service with profiles: in compose.yaml runs only when .env names one of its profiles in COMPOSE_PROFILES, for example COMPOSE_PROFILES=analytics,metrics, as with docker compose. The Overview shows its profiles beside its name. A service whose profile the last deploy left out shows Off, with the setting that turns it on, and Validate names the services that are off.

A failed deploy is not rolled back. The stack shows Deploy Failed with Edit Files, View Logs, Open Revisions, Open Job and Deploy Again; fix the files or restore a good revision, then deploy again. Another job of the stack that fails, such as a Start, stays under the tabs until you close it.

The next button is Stop while the stack runs and Start when it's stopped; its menu adds Restart.

  • Stop asks first, then stops the containers and keeps them, like docker compose stop; the stack shows Stopped.
  • Start runs them again; a stack that is Down starts from its last deploy. If you changed the files since, Start is off: use Deploy.
  • A service's Stop, in its row on the Overview, stops only that service.

To act on several stacks, select their rows on Stacks and pick Deploy, Pull and Deploy, Start, Restart, Stop or Down in the bar above the list. The bar offers only the actions that fit at least one selected stack: no Start when they all run. Only Stop and Down ask first. Stacks an action can't run on, for example because their server is offline, are left out, and you see why. On a phone the bar sits at the bottom of the screen; with more than two actions, all but the first are under More Actions (⋯).

More Stack Actions → Delete deletes the stack from Docker Manager and the server; type its name to confirm. Its volumes are kept unless you check Also Remove the Stack’s Volumes (shown only with the “Remove Volumes” permission). Its backups stay, and volumes you keep are backed up as volumes from then on. With Remove Backups of Deleted Stacks and Volumes on, the stack's backups go the set number of days after the deletion, except the newest backup of each volume that still exists.

Deleting a stack deletes its folder

Its folder goes with everything in it, including data its services keep there (for example ./data). The dialog names those folders.

Edit the files

Open Files, change compose.yaml or .env and press Save (Ctrl S). Saving does not deploy: the stack shows Undeployed Changes until you press Deploy.

Docker Manager checks the files after each save and shows what it finds above the text. Unfinished files are saved too, for example a compose.yaml that needs a variable .env doesn't set yet: the editor marks them Not Valid Yet, and the stack doesn't deploy until you fix the errors.

A deploy, a build and a pull use the files as saved. If open files still have unsaved edits when you start one (for example Deploy, Deploy Again or Build), Docker Manager names them and asks: Save and Deploy (Save and Build, Save and Pull), Deploy Without Them (Build Without Them, Pull Without Them; the edits stay in the editor) or Cancel. Force Recreate and Remove Orphans and Deploy ask in their own confirmation instead, with Save N Files First checked. If a file can't be saved, nothing runs and you see why.

Files that compose.yaml pulls in with include or extends belong to the stack: they are kept in its revisions and need the same permissions. They must be inside the stack's folder, or the stack doesn't deploy. Saving them isn't checked; the next deploy shows any mistake.

Revisions

Every saved change to the Compose files is a revision. The Revisions tab shows who made each one and whether it was deployed. Pick two and press Show Changes to compare them.

  • With undeployed changes, choose Deploy These Changes or Restore Deployed Revision to undo them.
  • To go back to an older version, open its menu and choose Restore and Deploy. Restore to Disk only writes the files back, so you can check them before you press Deploy.

Import a project

Docker Manager can take over the Compose projects you already run on the server, with their names, volumes and data.

  1. Open Stacks and press Import Projects.
  2. Pick the Environment (only when you have more than one). The list shows the projects Docker Manager doesn't manage yet (projects in its stacks folder become stacks on their own).
  3. Press Import next to a project. To import several, select them (or Select All) and press Import Selected: you confirm once, they are imported one after the other, and one message at the end says what was imported and what failed.

Docker Manager copies the project's folder into its stacks folder; your original folder is never changed. A running project asks you to Stop and Import: it stops, is copied and checked, and starts again from the copy, or from its original folder if the copy fails.

The agent must be able to read the project's folder. If a row says Why and How to Fix It, mount the folder into the agent below /import (read-only is enough), then run docker compose up -d:

compose.yaml
services:
  docker-agent:
    volumes:
      # ...keep the existing lines...
      - /opt/stacks:/import/stacks:ro

Good to know:

  • Projects without containers (never started, or stopped with docker compose down) are found by their Compose file below /import and show No Containers. Importing one adds it as Not Deployed.
  • Copying a project is refused when its files don't load or its running containers don't match them. Redeploy the project in the old tool first.
  • After the import, stop the old tool from managing the project.

Export a stack as an archive

An archive is one file with the stack's folder and the data of its volumes, to keep a copy or to create the stack on another server or another Docker Manager.

  1. On the stack's page, open More Stack Actions → Export Archive.
  2. Uncheck Include for any volume you don't want in the archive.
  3. Press Export Archive. The stack stops while the archive is written, then starts again, and the download starts. If you closed the dialog, open Export Archive again and press Download Archive.

The archive holds your .env values and your volumes' data. Keep it somewhere safe.

Create a stack from an archive

  1. Open Stacks and choose Create Stack ▾ → Create Stack From Archive.
  2. Press Choose Archive and pick the file, or drop the file there.
  3. Pick the Environment (only when you have more than one).
  4. Keep the Name or enter a new one. Volumes named after the stack get the new name too.
  5. Press Create Stack, or choose Create Stack ▾ → Create and Deploy to deploy it right away, then Open Stack.

Docker Manager checks the environment before it writes anything and lists what to fix, for example a name, folder, volume or port already in use.

Good to know:

  • An exported archive stays in Docker Manager for one day. Closing the dialog before the stack is created discards the uploaded archive, so Docker Manager asks first.
  • If the stack was created but its deploy didn't start, Deploy Stack in the dialog deploys it.
  • Archives can be up to 53.69 GB. Change the limit with DOCKER_MANAGER_STACK_ARCHIVE_MAX_MB (see Configuration).
  • Only plain local volumes are in the archive. Left out, and listed in the dialog: external volumes, volumes with driver options or another driver, anonymous volumes, folders mounted from outside the stack's folder, and images (they are pulled or built on deploy).
  • If compose.yaml sets name: at the top, the new stack must use that name.

Rename a stack

Press the pencil next to the stack's name, type the new name and press Enter. The rename starts right away: the stack stops, its folder and volumes move to the new name with their data and history, and what was running starts again. If compose.yaml sets name: at the top, change it there first, then rename the stack to exactly that name.

To change only the name shown in lists, or to add a description and up to 10 Links (for example to the software's website), use More Stack Actions → Edit Details.

Docker Manager's own stack

Importing Docker Manager's own Compose project doesn't stop it. Once it is imported, Deploy, Pull and Deploy and Force Recreate work, so you can upgrade Docker Manager from the app. Restart, Stop, Down, Migrate, Export Archive, renaming and Delete are off for it.

On this page