ec2 basic install

Amazon Linux 2023

sudo dnf install zsh git util-linux-user htop -y
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
cd ~/.oh-my-zsh/custom/plugins
git clone https://github.com/zsh-users/zsh-autosuggestions.git
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
vi ~/.zshrc
plugins=( git zsh-autosuggestions zsh-syntax-highlighting )

Dust

wget https://github.com/bootandy/dust/releases/download/v1.1.1/dust-v1.1.1-x86_64-unknown-linux-gnu.tar.gz
tar xvfz dust-v1.1.1-x86_64-unknown-linux-gnu.tar.gz
sudo mv dust-v1.1.1-x86_64-unknown-linux-gnu/dust /usr/local/bin
rm -rf dust-v1.1.1-x86_64-unknown-linux-gnu*
sudo dust /
wget https://github.com/bootandy/dust/releases/download/v1.1.1/dust-v1.1.1-aarch64-unknown-linux-gnu.tar.gz
tar xvfz dust-v1.1.1-aarch64-unknown-linux-gnu.tar.gz
sudo mv dust-v1.1.1-aarch64-unknown-linux-gnu/dust /usr/local/bin
rm -rf dust-v1.1.1-aarch64-unknown-linux-gnu*
sudo dust /

Mount Volume

df -h
lsblk
sudo mkfs -t xfs /dev/nvme1n1
sudo mkdir /data
sudo mount /dev/nvme1n1 /data
ln -s /data ~/app
cd ~/app
sudo chown ec2-user:ec2-user .
# sudo chown ubuntu:ubuntu .
touch hello
cd /data
ls -altr
sudo vi /etc/fstab
/dev/nvme1n1     /data       xfs        defaults     0    0

심볼릭 링크 생성

mkdir -p ~/app/.cache ~/app/git ~/app/miniconda3
ln -s ~/app/.cache ~/.cache
ln -s ~/app/git ~/git
ln -s ~/app/miniconda3 ~/miniconda3

Node.js, Docker

# node
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
. ~/.zshrc
nvm i 20
npm i -g pnpm
pnpm setup
. ~/.zshrc
sudo usermod -a -G docker ec2-user
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -SL https://github.com/docker/compose/releases/download/v2.29.7/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
curl -SL https://github.com/docker/compose/releases/download/v2.29.7/docker-compose-linux-armv7 -o $DOCKER_CONFIG/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
docker compose version
sudo reboot

Ubuntu

sudo apt install zsh git zip unzip -y
sudo snap install docker dust
sudo groupadd docker
sudo usermod -aG docker ${USER}
sudo reboot
What Else?
inflearn react api server -50% 할인쿠폰: 15108-f2af1e086101 buy me a coffee