npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@hellosufian/vps-mongo-redis-manager

v1.0.8

Published

PowerShell scripts for managing MongoDB and Redis on a VPS

Downloads

58

Readme

VPS Database Manager

Automation tool for installing, testing, and managing MongoDB 8.0, PostgreSQL, and Redis on an Ubuntu VPS.


🚀 Quick Start

1. NPX CLI (Recommended)

Run directly using npx:

npx @hellosufian/vps-mongo-redis-manager <action> <service>

Available Actions: setup, test, remove
Available Services: mongo, postgres, redis

Examples:

npx @hellosufian/vps-mongo-redis-manager setup mongo
npx @hellosufian/vps-mongo-redis-manager test redis
npx @hellosufian/vps-mongo-redis-manager remove postgres

2. NPM Scripts

If cloned locally:

# MongoDB
npm run setup:mongo
npm run test:mongo
npm run remove:mongo

# PostgreSQL
npm run setup:postgres
npm run test:postgres
npm run remove:postgres

# Redis
npm run setup:redis
npm run test:redis
npm run remove:redis

3. Direct PowerShell Execution (Windows)

powershell -ExecutionPolicy Bypass -File .\setup-mongodb-vps.ps1
powershell -ExecutionPolicy Bypass -File .\setup-postgres-vps.ps1
powershell -ExecutionPolicy Bypass -File .\setup-redis-vps.ps1

4. Interactive Bash Manager (Linux / Direct on VPS)

If running directly on an Ubuntu VPS terminal:

sudo ./manager.sh

📋 Required Inputs Reference

When executing any script or CLI command, you will be prompted for specific inputs. Below is the full breakdown of inputs required for each service and action:

🍃 MongoDB Commands

| Input Parameter | Description | Default Value | Required For | | :--- | :--- | :--- | :--- | | VPS IP | IP Address of target VPS (e.g. 168.231.79.31) | None | Windows SSH remote | | VPS Root Password | Root SSH password for target VPS | None | Windows SSH remote | | MongoDB Port | Target Port for MongoDB | 27018 | setup, test, remove | | MongoDB User | Admin Username | admin | setup, test | | MongoDB Password | Admin Password | Required | setup, test | | MongoDB Database | Database Name | mydatabase | setup |

Generated Connection URI:
mongodb://<USER>:<PASS>@<VPS_IP>:<PORT>/<DB>?authSource=admin&replicaSet=rs0


🐘 PostgreSQL Commands

| Input Parameter | Description | Default Value | Required For | | :--- | :--- | :--- | :--- | | VPS IP | IP Address of target VPS (e.g. 168.231.79.31) | None | Windows SSH remote | | VPS Root Password | Root SSH password for target VPS | None | Windows SSH remote | | PostgreSQL Port | Target Port for PostgreSQL | 5432 | setup, test, remove | | PostgreSQL User | Username to create / connect | admin | setup, test | | PostgreSQL Password | User Password | Required | setup, test | | PostgreSQL Database | Database Name | mydatabase | setup, test |

Generated Connection URL:
postgresql://<USER>:<PASS>@<VPS_IP>:<PORT>/<DB>


🔴 Redis Commands

| Input Parameter | Description | Default Value | Required For | | :--- | :--- | :--- | :--- | | VPS IP | IP Address of target VPS (e.g. 168.231.79.31) | None | Windows SSH remote | | VPS Root Password | Root SSH password for target VPS | None | Windows SSH remote | | Redis Port | Target Port for Redis | 6379 | setup, test, remove | | Redis Password | Requirepass Auth Password | Required | setup, test |

Generated Connection URI:
redis://:<PASS>@<VPS_IP>:<PORT>


⚡ What Each Script Does

MongoDB Setup (setup-mongodb-vps.ps1)

  1. Updates Ubuntu packages (apt update & upgrade).
  2. Installs MongoDB 8.0 official repo and mongodb-org.
  3. Configures /etc/mongod.conf (bindIp: 0.0.0.0, custom port).
  4. Creates Admin user with root role.
  5. Generates /etc/mongo-keyfile and enables authentication + Single-Node Replica Set (rs0).
  6. Configures UFW firewall rule for the specified port.

PostgreSQL Setup (setup-postgres-vps.ps1)

  1. Installs PostgreSQL & postgresql-contrib.
  2. Configures listen_addresses = '*' and updates pg_hba.conf for MD5 auth.
  3. Creates custom Database, User, and assigns privileges.
  4. Opens custom port in UFW.

Redis Setup (setup-redis-vps.ps1)

  1. Installs redis-server.
  2. Binds to 0.0.0.0, sets custom port, and enables requirepass password authentication.
  3. Enables and restarts redis-server.
  4. Opens custom port in UFW.

📄 License

ISC