-I will write the process of deploying laravel / docker on AWS for those who are stuck at the same point as the point where they are stuck.
Previous article Deploy laravel using docker on AWS②
** 1: Enter the instance you created on the EC2 dashboard and click "Connect" in the upper right corner **
** 2: Confirm connection code to instance ** Click "SSH Client"
** 3: SSH access to EC2 instance ** Start the terminal
chmod 400 test-docker.pem
ssh -i "test-docker.pem" [email protected]
For test-docker.pem, specify the directory where you downloaded and stored it.
Since you have to make changes to EC2 as a super user, hit "sudo"
ubuntu@ip:~$ sudo su
root@ip:/home/ubuntu#
The "$ (dollar)" at the beginning of the line represents the general user, and the "# (sharp)" represents the root user.
** 1: Update apt **
root@ip:/home/ubuntu# apt-get update
** 2: Install Git ** Install and initialize Git.
#git install
root@ip:/home/ubuntu# apt-get install git
#git initialization
root@ip:/home/ubuntu# git config --global user.name [Any username]
root@ip:/home/ubuntu# git config --global user.email [Any email address]
Follow the steps for ubuntu on the Docker official page (https://docs.docker.com/engine/install/ubuntu/). Install Docker and Docker-compose.
root@ip:/home/ubuntu# apt-get install \apt-transport-https \ca-certificates \curl \gnupg-agent \software-properties-common
root@ip:/home/ubuntu# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
root@ip:/home/ubuntu# apt-key fingerprint 0EBFCD88
root@ip:/home/ubuntu# add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
root@ip:/home/ubuntu# apt-get install docker-ce docker-ce-cli containerd.io
#docker-installation of compose
root@ip:/home/ubuntu# apt install docker-compose
** Previous article ** Deploy laravel using docker on EC2 on AWS②
** Click here to continue ** [Deploy laravel using docker on AWS ④] (https://qiita.com/JXnj8uVrUkiBh90/items/65f55ad1f79f32f26547)
** Please point out any mistakes **
Recommended Posts