window는 cmd창에서 ubuntu에 접속한 후 실행한다.
CURL 설치
sudo apt-get install -y curl
APT 패키지 설치
sudo apt update
노드 JS 다운로드
sudo apt install nodejs
버전 확인
node -v
터미널에서 다음 명령을 실행하여 https://www.mongodb.org/static/pgp/server-4.4.asc 에서 MongoDB public GPG key를 가져온다.
wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
우분투 버전에 맞는 리스트 파일을 생성해준다.
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
데이터베이스 불러온다.
sudo apt-get update
몽고디비 패키지 설치
sudo apt-get install -y mongodb-org
init 시스템 확인
ps --no-headers -o comm 1
다음 밑에 연결 실행
터미널에서 아래 명령어로 몽고디비를 실행시켜보자.
$ sudo systemctl start mongod
$ sudo systemctl status mongod
하면 밑으로 주르륵 몽고디비 실행됐다고 나옴