> ## Documentation Index
> Fetch the complete documentation index at: https://kmerhosting.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy common stacks on a VPS

> Secure a VPS, install runtimes, run applications, and expose them through a reverse proxy.

VPS Hosting provides server-level control. The customer is responsible for security and maintenance unless a managed agreement states otherwise.

<Frame caption="Retrieve the credentials from the protected service page and redact them in documentation screenshots.">
  <img src="https://mintcdn.com/kmerhosting-a736a8a9/qmzUGdL1AajWuhXn/images/screenshots/vps-credentials.png?fit=max&auto=format&n=qmzUGdL1AajWuhXn&q=85&s=2b0378690b6bbafcc2624e5317ac4a44" alt="Retrieve the credentials from the protected service page and redact them in documentation screenshots." width="1600" height="900" data-path="images/screenshots/vps-credentials.png" />
</Frame>

## Connect through SSH

```bash theme={null}
ssh root@SERVER_IP
```

<Frame caption="A successful SSH session should show only non-sensitive system information.">
  <img src="https://mintcdn.com/kmerhosting-a736a8a9/qmzUGdL1AajWuhXn/images/screenshots/vps-ssh-terminal.png?fit=max&auto=format&n=qmzUGdL1AajWuhXn&q=85&s=20f46fbd80fc0c18cf48dc2eb0dd12cd" alt="A successful SSH session should show only non-sensitive system information." width="1600" height="900" data-path="images/screenshots/vps-ssh-terminal.png" />
</Frame>

## Initial security

```bash theme={null}
apt update
apt upgrade -y
adduser deploy
usermod -aG sudo deploy
```

Add an SSH public key for the non-root user, confirm key login, then reduce password and root-login exposure according to the server policy.

## Node.js with PM2

```bash theme={null}
apt install -y git nginx
# Install a supported Node.js release using your chosen package source.
git clone YOUR_REPOSITORY_URL /var/www/application
cd /var/www/application
npm ci
npm run build
npm install --global pm2
pm2 start npm --name application -- start
pm2 save
```

Configure Nginx as a reverse proxy to the local application port and obtain HTTPS after DNS points to the server.

## Docker Compose

Install Docker from its official repository, deploy a reviewed Compose file, store secrets outside source control, and configure restart policies and backups.

## Maintenance checklist

* Apply operating-system updates.
* Back up application data and databases.
* Monitor disk, memory, load, and certificate renewal.
* Restrict firewall ports.
* Rotate credentials after team changes.
