Skip to content

Instantly share code, notes, and snippets.

@monnoval
Last active May 14, 2025 09:16
Show Gist options
  • Save monnoval/dccb2c996b531e6117964fb45993f061 to your computer and use it in GitHub Desktop.
Save monnoval/dccb2c996b531e6117964fb45993f061 to your computer and use it in GitHub Desktop.
DDEV systemd service units to auto start and off containers during boot and poweroff
[Unit]
Description=DDEV turn off all instance before shutdown
Requires=containerd.service
After=multi-user.target containerd.service
[Service]
User=ddevuser
Group=docker
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/true
ExecStop=/usr/bin/ddev poweroff
[Install]
WantedBy=multi-user.target
[Unit]
Description=DDEV start on boot
Requires=containerd.service
After=multi-user.target containerd.service
[Service]
User=ddevuser
Group=docker
Type=oneshot
ExecStart=/usr/bin/ddev start yourproject
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment