Cronspam

Trials and Tribulations with Technology


Install Docker on an AL2 Lightsail instance

I'm using Docker to run Ghost, as it's the cleanest approach. I don't have to install a lot of dependencies (NPM, NodeJS, etc), it's trivial to update, and I can easily run the same Docker image locally if I need to do any troubleshooting or development.

I'm using AL2 on my Lightsail instance, not Ubuntu, so the commands are different. Mostly, it's using yum instead of apt for package management:

# Install Docker.
sudo yum install docker

# Enable Docker to start automatically on the instance.
sudo systemctl enable docker

# Start Docker.
sudo systemctl start Docker

# Enable the current user ( ec2-user) to use Docker.
sudo usermod -aG docker $USER

# Logout & login to activate the new group membership.

Check that Docker is working: docker run --rm hello-world