Docker with Ubuntu LTS on AWS
This 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.
- Start by logging on to AWS and assume an admin role.
- Go to Services > EC2.
- Click the Launch instance button.
- In the Choose an Amazon Machine Image (AMI) section, search for Ubuntu.
- Select the Quick start tab (left pane).
- Select an entry from Canonical (e.g. ami-006a0174c6c25ac06).
- Choose your Instance type (e.g. t2.micro)
- Click Next: Configure instance details.
- Click Next: Add storage.
- Configure your storage needs.
- Click Next: Add tags.
- Click Next: Configure Security Group.
- Create a new security group.
- Security group name: ubuntu-docker
- Description: ubuntu-docker with SSH, http and https access.
- Add any Rules required: (e.g. SSH, HTTP and HTTPS)
- Click Review and Launch.
- Select your existing Key pair: (e.g. admin).
- Check the acknowledgement and click the Launch Instances button.
Click View instances to see your instance launching.
Here are the next steps towards accessing your newly created instance.
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:
- Configuring grub-pc: Click Ok.
- Grub install devices: Select both.
- Keep the default setting of Keep the local version currently installed.
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.