Docker with Ubuntu LTS on AWS

awsThis article describes how to get started with an EC2 instance of Ubuntu Server running Docker. If you need to use Docker at scale, then I recommend you use ECS.


Ubuntu 18.04 LTS

Be warned that once you start a server up, you will start to be charged in accordance with Amazon's pricing structure.  Once you've finished with a server instance make sure you terminate the instance to stop being charged.

  1. Start by logging on to AWS and assume an admin role.
  2. Go to Services > EC2.
  3. Click the Launch instance button.
  4. In the Choose an Amazon Machine Image (AMI) section, search for Ubuntu.
  5. Select the Quick start tab (left pane).
  6. Select an entry from Canonical (e.g. ami-006a0174c6c25ac06).
  7. Choose your Instance type (e.g. t2.micro)
  8. Click Next: Configure instance details.
  9. Click Next: Add storage.
    1. Configure your storage needs.
  10. Click Next: Add tags.
  11. Click Next: Configure Security Group.
    1. Create a new security group.
    2. Security group name: ubuntu-docker
    3. Description: ubuntu-docker with SSH, http and https access.
    4. Add any Rules required: (e.g. SSH, HTTP and HTTPS)
  12. Click Review and Launch.
  13. Select your existing Key pair: (e.g. admin).
  14. Check the acknowledgement and click the Launch Instances button.

Click View instances to see your instance launching.

 

Configuration options

Here are the next steps towards accessing your newly created instance.

 

Update ubuntu

Once you've gained remote access to your server, it's important to make sure that your installation of ubuntu is upto date.

$ sudo apt-get update
$ sudo apt-get dist-upgrade

You will get the following screens:

  1. Configuring grub-pc: Click Ok.
  2. Grub install devices: Select both.
  3. Keep the default setting of Keep the local version currently installed.

 

Install Docker

Now you can install Docker in the traditional method, or simply use Docker snap on your Ubuntu instance, by running the following command.

$ sudo snap install docker

 

Thanks for visiting.