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

nginx-domain-manager

v1.0.1

Published

A one-command CLI tool to manage Nginx reverse proxy domains, SSL certificates, and application ports on Linux servers

Downloads

304

Readme

nginx-domain-manager

npm version License: MIT Node.js

A one-command CLI tool (ndm) to manage Nginx reverse proxy domains, SSL certificates, and application ports on Linux servers.

Features

  • Interactive domain setup with prompts
  • Automatic SSL via Certbot (Let's Encrypt)
  • Firewall configuration (ufw / firewalld)
  • Safe operations — always runs nginx -t before reloading, rolls back on failure
  • Persistent metadata stored in /var/lib/ndm/domains.json
  • System health check with auto-repair (ndm doctor --fix)
  • One-command VPS bootstrap (ndm bootstrap)

Supported Operating Systems

| OS | Package Manager | |----|----------------| | Ubuntu | apt | | Debian | apt | | Fedora | dnf | | CentOS / RHEL | yum |

Installation

npm install -g nginx-domain-manager

All privileged commands must be run with sudo.

Commands

ndm create

Interactively set up a new reverse proxy domain.

sudo ndm create

Prompts for: domain, www subdomain, app port, SSL, email.


ndm remove <domain>

Remove a domain configuration.

sudo ndm remove example.com

Optionally revokes the SSL certificate.


ndm update-port <domain> <port>

Update the application port for a domain.

sudo ndm update-port example.com 5400

ndm status <domain>

Show detailed status for a domain.

ndm status example.com

Output includes: port, SSL status, nginx service status, certificate expiry.


ndm list

List all managed domains in a table.

ndm list
DOMAIN                           PORT    SSL     CREATED
─────────────────────────────────────────────────────────
example.com                      3000    Yes     2026-05-31
api.example.com                  8080    No      2026-05-31

ndm doctor

Check system health — nginx, certbot, firewall, ports.

ndm doctor
sudo ndm doctor --fix   # auto-repair issues

ndm bootstrap

Prepare a fresh VPS by installing all dependencies.

sudo ndm bootstrap

Installs: nginx, certbot, python3-certbot-nginx, curl, git. Enables nginx and configures the firewall.


ndm ssl-renew

Renew all SSL certificates.

sudo ndm ssl-renew
sudo ndm ssl-renew --dry-run   # test without changes

Examples

Full domain setup

sudo ndm bootstrap          # first time VPS setup
sudo ndm create             # follow the prompts
ndm list                    # verify
ndm status example.com      # check status

Migrate app to a new port

sudo ndm update-port example.com 4000

Clean up a domain

sudo ndm remove example.com

Metadata Storage

All domain configs are stored at /var/lib/ndm/domains.json:

{
  "example.com": {
    "port": 3000,
    "ssl": true,
    "email": "[email protected]",
    "includeWww": true,
    "createdAt": "2026-05-31"
  }
}

Environment Variables

| Variable | Effect | |----------|--------| | NDM_DEBUG=1 | Enable verbose debug logging |

Troubleshooting

"Please run this command with sudo."
All write operations require root. Prefix the command with sudo.

Nginx config test fails after SSL
Run sudo nginx -t to see the error. If certbot modified the config incorrectly, check /etc/nginx/sites-available/<domain>.

certbot not found
Run sudo ndm bootstrap or sudo ndm doctor --fix.

Port already in use
Check what's running: ss -tlnp | grep :PORT. Update with ndm update-port.

Architecture

src/
├── commands/    # Commander.js command handlers (one file per command)
├── services/    # Core business logic (nginx, certbot, firewall, storage, system)
├── utils/       # Shared helpers (logger, validator, permissions)
└── index.ts     # CLI entry point

Development

git clone https://github.com/your-org/nginx-domain-manager.git
cd nginx-domain-manager
npm install
npm run build
npm test

Roadmap

  • [ ] Multi-server management via SSH
  • [ ] ndm backup — export all configs
  • [ ] ndm restore — import configs from backup
  • [ ] Web dashboard (optional)
  • [ ] ndm logs <domain> — tail nginx access/error logs
  • [ ] Slack/webhook notifications for certificate expiry

Contributing

See CONTRIBUTING.md.

License

MIT