AWS – EC2 and SystemCtl – Making Sure Docker Starts on Boot

Saving this so I don’t have to find this again.

Context – this is for enabling docker to start on boot of a EC2 virtual machine using Amazon Linux 2.

Apparently I had to not only enable the systemctl service – but also flip a flag for “enable lingering” – found via an obscure Stack Exchange link?

I must be doing something wrong here – it just doesn’t sound correct to have to “enable a lingering” login session.

Commands I used that worked are as follows:

#Enable Docker on Boot
sudo systemctl enable docker.service
sudo systemctl enable containerd.service

#Enable Lingering on loginctl
loginctl enable-linger $USER

Credit at the below Stack Exchange Links:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s