Skip to main content

ngxctl Banner


ngxctl

A modern command-line utility for generating, managing, validating, and deploying Nginx configurations.

A cleaner way to work with Nginx.


Overview

ngxctl is an open-source command-line utility that simplifies creating, managing, validating, and deploying Nginx configurations.

Whether you're deploying a personal website, hosting a production API, or managing multiple virtual hosts on a VPS, ngxctl removes repetitive work while generating clean, readable, and fully editable Nginx configuration files.

Instead of manually writing server blocks, enabling sites, validating syntax, and reloading Nginx, ngxctl automates the entire workflow through a simple command-line interface.

It doesn't replace Nginx—it makes working with Nginx faster.


Why ngxctl?

Working with Nginx usually means repeating the same workflow:

  • Create a configuration
  • Copy an existing server block
  • Change the domain
  • Change the backend port
  • Enable the site
  • Test the configuration
  • Reload Nginx

Do that often enough and it becomes repetitive.

ngxctl automates those repetitive steps while still producing standard Nginx configuration files that remain completely editable.


Features

Configuration Generation

  • Interactive setup wizard
  • Smart defaults
  • Automatic sudo privilege elevation
  • Reverse proxy generation
  • Static website hosting
  • SPA support (React, Vue, Svelte)
  • Custom entrypoint support
  • PHP-FPM templates
  • Docker reverse proxy templates
  • WebSocket support
  • SSL-ready templates
  • HTTP → HTTPS redirects

Supported Technologies

Reverse Proxies

  • Node.js
  • Express
  • NestJS
  • FastAPI
  • Flask
  • Django
  • Go
  • PHP-FPM

Frontend Applications

  • React
  • Vue
  • Svelte
  • Static Websites

Deployment Targets

  • Docker Containers

Site Management

  • Create sites
  • Enable sites
  • Disable sites
  • List configured sites
  • Inspect configurations
  • Automatic symlink management

Service Management

  • Validate configurations
  • Reload Nginx
  • Restart Nginx
  • Safe validation before reload

Backup & Recovery

  • Automatic snapshots
  • Timestamped backups
  • Restore previous configurations
  • Backup listing
  • Rollback support

Installation

Requirements

  • Python 0+
  • Nginx
  • Linux

Install from PyPI

pip install ngxctl-cli

Install with pipx

pipx install ngxctl-cli

Install from Source

Clone the repository:

git clone https://github.com/thexento/ngxctl.git
cd ngxctl

Install in editable mode:

pip install -e .

Quick Start

Launch the interactive setup wizard:

ngxctl create

The wizard will guide you through:

  • Site name
  • Domain name
  • Site type
  • Backend or root directory
  • Automatic privilege elevation
  • Validation
  • Nginx reload

Usage

Reverse Proxy

ngxctl create reverse-proxy \
    --site-name my-api \
    --domain api.example.com \
    --port 3000

Using a custom backend URL:

ngxctl create reverse-proxy \
    --domain api.example.com \
    --port http://127.0.0.1:8080

Enable WebSockets:

ngxctl create reverse-proxy \
    --domain socket.example.com \
    --port 3000 \
    --websocket

Static Website

ngxctl create static \
    --site-name my-site \
    --domain example.com \
    --root /var/www/my-site

SPA with a custom entrypoint:

ngxctl create static \
    --site-name my-app \
    --domain app.example.com \
    --root /var/www/app/dist \
    --entrypoint main.html \
    --spa

PHP

ngxctl create php \
    --domain blog.example.com \
    --root /var/www/blog

Site Management

List sites:

ngxctl list

Inspect a site:

ngxctl inspect my-site

Enable a site:

ngxctl enable my-site

Disable a site:

ngxctl disable my-site

Nginx Operations

Validate:

ngxctl test

Reload:

ngxctl reload

Restart:

ngxctl restart

Backup Management

Create a backup:

ngxctl backup create my-site

List backups:

ngxctl backup list

Restore:

ngxctl backup restore my-site

Environment Variables

Variable Description Default
NGXCTL_NGINX_DIR Base Nginx directory /etc/nginx
NGXCTL_SITES_AVAILABLE Sites Available /etc/nginx/sites-available
NGXCTL_SITES_ENABLED Sites Enabled /etc/nginx/sites-enabled
NGXCTL_CONF_D conf.d directory /etc/nginx/conf.d
NGXCTL_BACKUP_DIR Backup location ~/.config/ngxctl/backups

Design Principles

  • Keep commands intuitive.
  • Generate clean, readable configurations.
  • Avoid unnecessary complexity.
  • Never apply invalid configurations.
  • Keep everything modular.
  • Produce standard Nginx files.
  • Allow manual editing.

Example Workflow

Generate a configuration:

ngxctl create

Validate it:

ngxctl test

Reload Nginx:

ngxctl reload

Contributing

git clone https://github.com/thexento/ngxctl.git
cd ngxctl

git checkout -b feature/my-feature

# Make your changes

git commit -m "Add my feature"
git push origin feature/my-feature

Open a Pull Request describing your changes.


Frequently Asked Questions

Does ngxctl replace Nginx?

No.

It generates and manages Nginx configuration files while Nginx continues serving traffic.

Are generated configurations editable?

Yes.

Every generated file is a standard Nginx configuration that can be edited manually.

Does ngxctl overwrite existing files?

Only when instructed. Backup snapshots are created before overwriting existing configurations.

Which operating systems are supported?

Currently Linux systems running Nginx.


License

This project is licensed under the MIT License.

See the LICENSE file for details.


Developed and maintained by Xento

GitHub

⭐ If you find this project useful, consider giving it a star.

Metadata

Release files for ngxctl-cli 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ngxctl-cli 1.0.2
File Size Uploaded
ngxctl_cli-1.0.2.tar.gz 2.7 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for ngxctl-cli 1.0.2
File Interpreter ABI Platform
ngxctl_cli-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 2.8 MB

Release files / ngxctl_cli-1.0.2.tar.gz

Download URL ngxctl_cli-1.0.2.tar.gz
Size 2.7 MB
Tags Source
SHA-256 checksum
How to use checksums
8bfec014c65f5fbf459f7837a144abf82479ce42e655d69ac41d42de814a43ce
BLAKE2b-256 checksum
How to use checksums
c403c1c55d59de6376fb1e82526384c59ffdfeb320d73e9ef5a24285361426b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.5

Release files / ngxctl_cli-1.0.2-py3-none-any.whl

Download URL ngxctl_cli-1.0.2-py3-none-any.whl
Size 27.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af7c061bdff5f54345b144852d2c963c9a4c1840073010219cfc99145d41e699
BLAKE2b-256 checksum
How to use checksums
8c142c002e46c523554600a99726b5c783649553f23943a0f7242b4ba2f3ef7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.5

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page