Skip to content

Instantly share code, notes, and snippets.

@serenitii
Last active December 8, 2022 07:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save serenitii/867333945a7db67a335cc915cddd43be to your computer and use it in GitHub Desktop.
Save serenitii/867333945a7db67a335cc915cddd43be to your computer and use it in GitHub Desktop.
Setup ec2 ubuntu(22.04) 2022_12
# Set user to root before execute this script
# sudo su
echo "whoami"
whoami
sleep 2s
cd /root
# Korean time
date
sudo ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
date
#Install NGINX and Certbot
apt install -y nginx certbot python3-certbot-nginx
# my ip
curl -4 icanhazip.com
# install Node(LTS), yarn, pm2
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
exec $SHELL
nvm install --lts
npm install -g yarn
npm install -g pm2
node -v
npm -v
pm2 -v
# Install Docker
# curl -fsSL https://get.docker.com -o get-docker.sh
# sudo sh ./get-docker.sh DRY_RUN=1 -o-
# docker --version
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
apt-cache policy docker-ce
sudo apt install docker-ce
sudo systemctl status docker
# mariadb 실행
docker run --name ave-maria -d -p 3306:3306 --restart=always -e MYSQL_ROOT_PASSWORD="<YOUR_PASSWORD>" mariadb
docker ps
# redis 실행
docker run --name my-redis -d -p 6379:6379 --restart=always redis
docker ps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment