How to do Node.js Deployment on VPS

Log in to your server

Once your machine is up and running SSH to the server.

ssh root@IP.x.x.x
OR
ssh -i key.pem root@IP.x.x.x

System Update/Upgrade

Now we are inside the machine, update and upgrade the system.

sudo ap…


This content originally appeared on DEV Community and was authored by MUHAMMAD ARBAB ANJUM

Log in to your server

Once your machine is up and running SSH to the server.

ssh root@IP.x.x.x
OR
ssh -i key.pem root@IP.x.x.x

System Update/Upgrade

Now we are inside the machine, update and upgrade the system.

sudo apt update -y
sudo apt upgrade -y

Change Password

Once system has been updated/upgraded You can change your password (optional)

passwd

Add a new non-root user and add it to sudoers

sudo usermod -aG sudo username
sudo -l -U username #Verify the user has sudo access

OR 

useradd -m -s /bin/bash username
groups username
usermod -aG sudo username 

Set password for new user

sudo passwd username

Now log in as a new user:

ssh username@192.IP.IP.IP

Authenticate using SSH and Restrict Password Login

ssh-keygen -t ed25519 -C "user@domain.com"

To view all public keys

Windows: C:\Users\YourUser\.ssh\id_ed25519.pub
Linux: cat ~/.ssh/id_ed25519.pub

Copy the content of the public(.pub) key file. Paste the public key into the file.

nano ~/.ssh/authorized_keys

Now add it to the ssh utility

ssh-add -k ~/.ssh/id_ed25519

Disable password login if you only want authentication using ssh only.

sudo nano /etc/ssh/sshd_config

Search for: PasswordAuthentication=no
For root user: PermitRootLogin=no

Now restart the ssh service:

sudo service ssh restart

OR

sudo systemctl restart ssh

Login With ssh

ssh username@IP.x.x.x

Secure server with firewall

View firewall setup doc


This content originally appeared on DEV Community and was authored by MUHAMMAD ARBAB ANJUM


Print Share Comment Cite Upload Translate Updates
APA

MUHAMMAD ARBAB ANJUM | Sciencx (2025-07-26T06:25:49+00:00) How to do Node.js Deployment on VPS. Retrieved from https://www.scien.cx/2025/07/26/how-to-do-node-js-deployment-on-vps/

MLA
" » How to do Node.js Deployment on VPS." MUHAMMAD ARBAB ANJUM | Sciencx - Saturday July 26, 2025, https://www.scien.cx/2025/07/26/how-to-do-node-js-deployment-on-vps/
HARVARD
MUHAMMAD ARBAB ANJUM | Sciencx Saturday July 26, 2025 » How to do Node.js Deployment on VPS., viewed ,<https://www.scien.cx/2025/07/26/how-to-do-node-js-deployment-on-vps/>
VANCOUVER
MUHAMMAD ARBAB ANJUM | Sciencx - » How to do Node.js Deployment on VPS. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/07/26/how-to-do-node-js-deployment-on-vps/
CHICAGO
" » How to do Node.js Deployment on VPS." MUHAMMAD ARBAB ANJUM | Sciencx - Accessed . https://www.scien.cx/2025/07/26/how-to-do-node-js-deployment-on-vps/
IEEE
" » How to do Node.js Deployment on VPS." MUHAMMAD ARBAB ANJUM | Sciencx [Online]. Available: https://www.scien.cx/2025/07/26/how-to-do-node-js-deployment-on-vps/. [Accessed: ]
rf:citation
» How to do Node.js Deployment on VPS | MUHAMMAD ARBAB ANJUM | Sciencx | https://www.scien.cx/2025/07/26/how-to-do-node-js-deployment-on-vps/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.