EC2 Stuff 22nd October 2024

I’ve used very basic stuff while dealing with EC2. I’m documenting this as and when I figure out new stuff so that it’s easier for future me to find stuff that I would need.

SSH

  1. Setting up aliases

    Create a config file under ~/.ssh (tab on second line is important)

    ~/.ssh/config
    Host myHost
    HostName MyHostName
    User ec2-user
    IdentityFile ~/.ssh/identity.pem

tmux

  1. Start session

    Terminal window
    tmux

  2. Detach from session

    Ctrl-b + D

  3. Attach to session

    Terminal window
    tmux ls
    tmux attach -t 0

  4. Delete session

    Terminal window
    tmux kill-session -t 0

Node

  1. Basics

    Terminal window
    nvm use 16.15.1 // or install other versions and use

Docker

  1. Start services. Best to use docker for everything on ec2

    Terminal window
    sudo systemctl start docker // run before doing anything docker related