# Portainer

Markdown version of <https://sam-dumont.github.io/immich-memories/docs/run/platforms/portainer/>.

Use a **Docker Standalone** environment in Portainer. This recipe runs the app on that Docker host, which may be a different machine from the Portainer server. The interface steps follow [Portainer's stack documentation](https://docs.portainer.io/user/docker/stacks/add).

This recipe was run with Portainer CE on Docker Standalone on an Apple Silicon host (Web editor
deploy, app readiness, the Console commands below), not on a remote NAS.
[Tested deployments](https://sam-dumont.github.io/immich-memories/docs/run/tested-deployments.md) covers the other platforms.

## 1. Create the stack

Open **Stacks → Add stack**, name it `immich-memories`, and select **Web editor**. Enter your Immich URL below, then copy the generated `docker-compose.yml` into the editor and replace `replace-with-your-immich-api-key` with your own [API key](https://sam-dumont.github.io/immich-memories/docs/run/docker.md#the-api-key). The builder never asks for it. No `.env` upload is needed.

GPU and Full need an NVIDIA host with the Container Toolkit, or a separate GPU box. Full also needs a reader. Replace the generated reader-key placeholder with its API key, or empty it if that server does not require one.

The setup builder on [the HTML page](https://sam-dumont.github.io/immich-memories/docs/run/platforms/portainer/) generates the setup files for your choices in the browser. Pick a platform, a tier and the options there; nothing is sent anywhere.

Keep **Single file for a stack editor** selected. The generated file includes a Settings
encryption key; keep it with your backups and restrict access after adding your API keys.

Docker-managed volumes retain settings, prepared facts and films across container replacement.
Download films through the app. To use a NAS share instead, follow
[folder permissions](https://sam-dumont.github.io/immich-memories/docs/run/nas.md#the-output-folder) before changing the output mount.

For GPU/Full on this NVIDIA host, select **Use NVIDIA CUDA containers**. For a separate worker,
fill in **GPU box address** and start the provided worker files on that machine first.

The app asks for a sign-in either way. To open it to your trusted LAN, tick **Open the UI to
other machines on my LAN** in the builder above. Leave the login empty to get a generated password
(read it with `docker logs immich-memories` or in the container's log view), or enter a username
and a password of at least 12 characters and the generated file carries them.

To do it by hand, edit the lines the file already has. Do not add a second copy: Compose refuses a
file that defines the same key twice. To pick your own login, change the two empty values under the
app service's `environment:` block:

```yaml
IMMICH_MEMORIES_AUTH_USERNAME: admin
IMMICH_MEMORIES_AUTH_PASSWORD: replace-with-your-own-long-password
```

The password needs at least 12 characters. To publish the port, in the same service's `ports:` change
`127.0.0.1:22830:8080` to `0.0.0.0:22830:8080`. If the host already uses 22830, choose another host
port, for example `0.0.0.0:22831:8080`. The last number remains 8080.

This is the app's login; the container manager's account does not protect this port. These
settings use HTTP on your LAN. For HTTPS or private access through localhost, use the
[other access routes](https://sam-dumont.github.io/immich-memories/docs/run/docker.md#reaching-the-ui-from-another-machine).

## 2. Deploy

Click **Deploy the stack**. Wait for `immich-memories` to be running.

Set film language after startup in [Settings](https://sam-dumont.github.io/immich-memories/docs/get-started/after-install.md).

## 3. Open the app and download models

Open `http://your-server-address:22830` (or your chosen host port) and sign in with the
login you set, or with the generated password from the container's **Logs**. With private
localhost access, use the forwarded URL instead.

On **Memory**, click **Download models** and wait for it to finish. The card lists the files and
download hosts; it disappears when the required files are ready. If it is absent and no error is
shown, those files are already present. Downloads are kept on the config volume for later starts.

## 4. Check and make a film

**Basic:** continue to [your first film](https://sam-dumont.github.io/immich-memories/docs/get-started/first-film.md).

**GPU and Full:** the browser download does not check the external model services. Open **Containers → immich-memories → Console** and connect with `/bin/sh`.
Run:

```bash
immich-memories preflight
```

This runs inside the app container, so do not add `docker exec`. Wait for inference and captions
(and the Full reader) to become ready, and resolve any required-service or storage errors before
making [your first film](https://sam-dumont.github.io/immich-memories/docs/get-started/first-film.md). Optional upload permissions can warn
while still allowing local films.

[Installation help](https://sam-dumont.github.io/immich-memories/docs/reference/installation-help.md) covers connection, port, permission and
startup errors. It also gives the CLI model-download command if you need it.
