Amazon Lightsail is a new service on AWS which appears to be targeted at hosts like Digital Ocean and Linode. There’s a pretty neat “Launch Script” feature! Here’s a quick guide to automated Docker installs.

Login to AWS, jump to Lightsail, and select “Base OS” and the option for “Ubuntu 16.04”.


For this example, we’re going to use the Docker PHP Image. You’ll probably want to modify the last two lines of this script to pull your own Docker image. In the “Launch Script” box, enter this code:

You can login to DockerHub using:

sudo docker login --username=your_username --password=your_password123!



Select your SSH key. Choose your Instance plan. Give your instance a name.


Wait a few minutes… Even though the instance is “Running” the install script hasn’t completed. This takes between 2-5minutes, depending on how big the Docker image is.


View the page. In this example, a 403 error means the container is running but there’s nothing to serve. Success! You can SSH in and start editing.

That’s it and that’s all!


  1. bob

    Thank you, your example was very helpful! Do you know if there’s any way to view your launch script once the instance is launched? I couldn’t find it on the aws console, or anywhere on my instance file system.

Leave a Reply

Your email address will not be published. Required fields are marked *