You are on page 1of 4

Assignment to install apache2 using docker

Step-1: Start ec2 ubuntu instance

# sudo apt-get update


Step- 2: Install docker engine using command

# sudo apt-get install docker.io -y

# docker –version

Step- 3: Give permission to user for docker

# sudo usermod -a -G docker $USER

# sudo reboot

After reboot reconnect with instance

Step- 4: Pull apache2 image

# docker pull ubuntu/apache2


Step- 5: run apache2 image

#docker run -d --name my_apache -p 80:80 ubuntu/apache2:latest

Step- 6: Open port 80 in EC2 Security group

Step- 7:

Copy EC2 instance public ip and paste it in browser

Final output of apache2 index page

Step- 8:

Checking by stopping container

You might also like