Deploy laravel using docker on EC2 on AWS ③ (SSH connection ~ Docke-compose installation)

Overview##

-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②

SSH to your EC2 instance

** 1: Enter the instance you created on the EC2 dashboard and click "Connect" in the upper right corner ** スクリーンショット 2020-10-10 22.11.55.png

** 2: Confirm connection code to instance ** Click "SSH Client" スクリーンショット 2020-10-10 22.12.06.png

** 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.

Install Git

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]

Installation of Docker, Docker-compose

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

Deploy laravel using docker on EC2 on AWS ③ (SSH connection ~ Docke-compose installation)
Deploy laravel using docker on EC2 on AWS ① (Create EC2 instance)
Deploy laravel using docker on EC2 on AWS ② (Elastic IP acquisition-linking)
Deploy laravel using docker on EC2 on AWS ④ (git clone ~ deploy, migration)
Deploy with EC2 / Docker / Laravel
Install docker on AWS EC2
Deployed using Docker + Rails + AWS (EC2 + RDS)
Docker installation on CentOS 6
Deploy RAILS on EC2
[Docker] Build an Apache container on EC2 using dockerfile
Docker installation on WSL2
Creating a docker host on AWS using Docker Machine (personal memorandum)
[Amateur remarks] Build multiple WordPress on AWS using Docker Compose
Install Docker on Ubuntu and set up remote connection using tls
[For beginners] Laravel Docker AWS (EC2) How to easily deploy a web application (PHP) from 0 (free) ①-Overview-
Install Docker on AWS Ubunt 20.04 LTS
How to deploy Laravel on CentOS 7
Try using Redmine on Mac docker
To beginners launching Docker on AWS
Run the AWS CLI on Docker
Deploy Flask's Docker image on Heroku
Deploy Rails on Docker to heroku
Deploy SpringBoot application to AWS EC2
Using Docker on Windows10 Home WSL2
[AWS ELB] Using ELB and Docker, EC2 has two domains for WEB servers.
[For beginners] Laravel Docker AWS (EC2) How to easily deploy Web application (PHP) from 0 (free) ②-Docker development environment construction-