Synology: Schedule Start & Stop For Docker Containers

Synology: Schedule Start/Stop For Docker Containers

If you have a Synology NAS and are using it extensively, then you’ve likely already installed a number of Docker containers to serve your various needs, whether for work or fun. But circumstance may make it that you may need to stop and start back up again certain containers automatically at scheduled times. So today I’m going to show you how to stop and start, or restart, your Docker containers and organize their activity around a schedule that fits your individual needs.

  • STEP 1

Please Support My work by Making a Donation.

  • STEP 2

Go to Control Panel / Task Scheduler / Create / Scheduled Task / User-defined script. Follow the instructions in the image below.

Synology Schedule Start and Stop For Docker Containers 1

  • STEP 3

Once you click on User-defined script, a new window will open. Follow the instructions below:

  1. General: In the Task field type in Your-Container-Name Stop. Check the “Enabled” option. Select root User.
  2. Schedule: Select Run on the following days then select the time that works for you.
  3. Task Settings: Check “Send run details by email“, add your email then copy paste the code below in the Run command area. After that, click OK.
docker container stop yourcontainername

Note: In the image below bookstack is an example of docker container. You have to choose the name of the container you want to stop at a scheduled time.

Synology Schedule Start and Stop For Docker Containers 2

  • STEP 4

After you click OK on STEP 5 a new warning pop up window will open. Click OK. Follow the instructions in the image below.

Synology Schedule Start and Stop For Docker Containers 3

  • STEP 5

After you click OK on STEP 4 the container of your choice will automatically stop at the scheduled time and date.

Synology Schedule Start and Stop For Docker Containers 4

  • STEP 6

Go to Control Panel / Task Scheduler / Create / Scheduled Task / User-defined script. Follow the instructions in the image below.

Synology Schedule Start and Stop For Docker Containers 5

  • STEP 7

Once you click on User-defined script, a new window will open. Follow the instructions below:

  1. General: In the Task field type in Your-Container-Name Start. Check the “Enabled” option. Select root User.
  2. Schedule: Select Run on the following days then select the time that works for you.
  3. Task Settings: Check “Send run details by email“, add your email then copy paste the code below in the Run command area. After that, click OK.
docker container start yourcontainername

Note: In the image below bookstack is an example of docker container. You have to choose the name of the container you want to start at a scheduled time.

 

Synology Schedule Start and Stop For Docker Containers 6

  • STEP 8

After you click OK on STEP 7 a new warning pop up window will open. Click OK. Follow the instructions in the image below.

Synology Schedule Start and Stop For Docker Containers 7

  • STEP 9

After you click OK on STEP 8 the container of your choice will automatically start at the scheduled time and date.

Synology Schedule Start and Stop For Docker Containers 8

  • STEP 10

In the Task Scheduler area you have the option to enable or disable the schedule for your docker containers. Check or uncheck the boxes according to your needs.

Synology Schedule Start and Stop For Docker Containers 9

This post was updated on Thursday / October 21st, 2021 at 4:57 PM