Bought a new VPS? Don't know to use it? this will be help you!
Probably you came from my YouTube so I will say you how to connect
-
Download the Git Bash setup from the official website: https://git-scm.com/
-
Download the installer.
-
Run the
.exe
file you just downloaded and follow the instructions in the installer. -
Run Git Bash by right-clicking on any folder and selecting the Git Bash Here option from the context menu(right-click menu).
If you came from my YouTube you will have .pem
file
- Private Key(
.ppk
or.pem
- IP of the VPS
- Username of the VPS
- Git Bash
Run this command on Git Bash terminal
ssh -i "Private Key.pem" Username@ip
Follow the above method. When you follow you will get something like
ssh -i "Private Key.pem" ubuntu@38.21.32.2
After you run say yes
it ask you something
You have successfully connected! If you got a screenshot like this
sudo -i && sudo apt update -Y && sudo apt install npm && npm i n -g && n lts && ssh-keygen && cat /home/root/.ssh/id_rsa.pub
When you done you will have Node.js!
Then add the ssh key to github
When you connected do sudo -i
so you get root access!
Update your ubuntu by sudo apt update -Y
Run ssh-keygen
then keep press enter untill it stop asking questions
So now you will have to copy the ssh key and need to paste on your GitHub(if you dont have github account then create)
Run this command to show ssh key cat /home/root/.ssh/id_rsa.pub
Now you get something like this
Now copy that key!
Quick link: https://github.com/settings/ssh/new
Now you can access your account on GitHub which means you can clone private repo also
Im lazy to type so run this command lol
sudo apt install npm && npm i n -g && n lts
Now you have Node.js v12
- On GitHub, navigate to the main page of the repository.
- Above the list of files, click Code.
- To clone the repository using an SSH key, including a certificate issued by your organization's SSH certificate authority, click Use SSH, then click . To clone a repository using GitHub CLI, click Use GitHub CLI, then click .
- Type git clone, and then paste the URL you copied earlier.
$ git clone PasteCopiedURLHere
- Press Enter to create your local clone.
- Change ExpressApp to the name of the folder you need
$ git clone PasteCopiedURLHere ExpressApp
> Cloning into "ExpressApp"...
> remote: Counting objects: 10, done.
> remote: Compressing objects: 100% (8/8), done.
> remove: Total 10 (delta 1), reused 10 (delta 1)
> Unpacking objects: 100% (10/10), done.
- When it cloned you can see the folder by using
ls
command - Do
cd ExpressApp
. Change ExpressApp to the folder you cloned
Install yarn yarn nice. npm not nice
- Run
npm i yarn -g
- Do
yarn
in the folder you cloned - Now you have installed all packages! Time to run the code
- Run
screen
then press enter now run the code usingnode index
ornpm start
or anything. - After the code executing and running you can do
CTRL + A + D
to deattach. So terminal runs 24/7 so your app will be 24/7! - If you want to return back to that terminal do
screen -r
!
There you go. Have questions? Comment or Join Discord
Wow Nice