Last active
June 30, 2023 07:37
-
-
Save nrjdalal/ce3db7894834a6d36b19aa7008a19f22 to your computer and use it in GitHub Desktop.
ec2 node app deployment guide for brand new instance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt update && sudo apt upgrade -y && sudo apt install build-essential -y && sudo passwd ubuntu | |
sudo apt install zsh -y && chsh -s $(which zsh) | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
(echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> /home/ubuntu/.zprofile | |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" && brew install gcc | |
brew install nvm && mkdir -p ~/.nvm && export NVM_DIR="$HOME/.nvm" | |
[ -s "/home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh" ] && \. "/home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh" | |
[ -s "/home/linuxbrew/.linuxbrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/home/linuxbrew/.linuxbrew/opt/nvm/etc/bash_completion.d/nvm" | |
nvm install --lts --latest-npm && npm list -g corepack && corepack enable | |
corepack prepare pnpm@latest --activate && pnpm setup | |
export PNPM_HOME="/home/ubuntu/.local/share/pnpm" | |
case ":$PATH:" in | |
*":$PNPM_HOME:"*) ;; | |
*) export PATH="$PNPM_HOME:$PATH" ;; | |
esac | |
pnpm i -g yarn && pnpm i -g pm2 && pm2 startup | |
sudo env PATH=$PATH:/home/ubuntu/.nvm/versions/node/$(node -v)/bin /home/ubuntu/.local/share/pnpm/global/5/.pnpm/pm2@$(pm2 -v | tail -n 1)/node_modules/pm2/bin/pm2 startup systemd -u ubuntu --hp /home/ubuntu | |
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https | |
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg | |
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list | |
sudo apt update | |
sudo apt install caddy | |
sudo chown -R ubuntu /etc/caddy | |
# reload configs by `sudo systemctl reload caddy` | |
cd /srv && mkdir -p actions-runner && cd actions-runner | |
./config.sh --url https://github.com/warewe/google-serp-manager --token <token> | |
sudo ./svc.sh install && sudo ./svc.sh start && sudo chown -R ubuntu /srv | |
# personal prefs | |
brew install zsh-autosuggestions zsh-syntax-highlighting zsh-history-substring-search |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment