How to NOT start a container at boot?

Hi everyone!
My setup uses an external encrypted LUKS disk for Nextcloud data.
I’d like Nextcloud to start only after the LUKS disk has been mounted.

How can I configure Nextcloud (or any other app) not to start automatically at boot, and only start it manually after the disk is mounted?

Thanks in advance!

my test umbrel is currently offline, but can you try whether the docker-compose.yml sits here? There, you should be able to alter the autostart.

sudo ~/umbrel/scripts/app stop nextcloud
nano ~/umbrel/app-data/nextcloud/docker-compose.yml

and look if there is already a restart attribute

services:
  app:
    image: nextcloud:fpm-alpine
    restart: "no" # <--- THIS IS THE LINE YOU CHANGE

and then restart the node, try sudo docker ps whether it really is off. You can then safely start it with sudo ~/umbrel/scripts/app start nextcloud.

Lmk if that works.

Btw More sophisticated would be to create a new systemd unit file, which fires the docker start command once the mount is on. Something like this:

create a systemd file: sudo nano /etc/systemd/system/start-nextcloud-on-mount.service

[Unit]
Description=Start Nextcloud container after external drive is mounted
# This shoulld wait for the specified path to be a valid mount point.
RequiresMountsFor=/mnt/data  # <-- CHANGE THIS to your exact LUKS mount path

[Service]
Type=oneshot
RemainAfterExit=true
# chck the container name with sudo docker ps
ExecStart=/usr/bin/docker start nextcloud_app_1 # <-- CHANGE THIS to your container name
ExecStop=/usr/bin/docker stop nextcloud_app_1  # <-- CHANGE THIS to your container name

[Install]
WantedBy=multi-user.target

Then reload systemd to read the new file with sudo systemctl daemon-reload
Enable your service to start on boot (once the mount is available): sudo systemctl enable start-nextcloud-on-mount.service

Ah and sorry, the docker-compose.yml will always be reset when umbrel updates something. :person_shrugging: