The ultimate command-line companion for managing web server configurations and Let's Encrypt SSL certificates.
dencrypt takes the hassle out of adding new domains to your Linux server. Whether you're running Nginx or Apache, dencrypt automates the entire process: creating virtual hosts, setting up document roots, and provisioning Let's Encrypt SSL certificates via certbot—all with a single command!
- 🚀 Automated Configuration: Generates optimized Nginx or Apache server blocks instantly.
- 📁 Smart Provisioning: Automatically sets up the document root (
/var/www/domain/html) with proper permissions. - 🔐 One-Click SSL: Seamlessly integrates with
certbotto provision Let's Encrypt certificates and auto-configure HTTP-to-HTTPS redirection. - 🩺 Health Checks: Built-in commands to verify your web server syntax and configuration status.
- 🧠 Auto-Detection: Intelligently detects your active web server so you don't have to specify it manually.
Before you begin, ensure you have the following on your Linux server:
- Root access (
sudoprivileges) - Python 3 installed
- Nginx or Apache2 installed
- Certbot installed (
sudo apt install certbot python3-certbot-nginx python3-certbot-apache)
Get up and running in seconds. Clone the repository and install the package globally:
git clone https://github.com/yourusername/dencrypt.git
cd dencrypt
sudo python3 setup.py install
⚠️ Note:dencryptmodifies protected system files (/etc/nginx,/etc/apache2) and runscertbot. It must be executed with root privileges (sudo).
Set up a new domain from scratch. This command generates the config, creates the web root, enables the site, reloads the server, and provisions an SSL certificate.
sudo dencrypt add example.comCustomization Flags:
--server [nginx|apache]: Force a specific web server (useful if both are installed).--no-ssl: Skip SSL provisioning (useful for local testing or pre-DNS configuration).
Example (Nginx without SSL):
sudo dencrypt add example.com --server nginx --no-sslAlready have a configuration set up but need to secure it? Provision a Let's Encrypt certificate effortlessly:
sudo dencrypt ssl example.comEnsure your server is healthy and configurations are syntax-error free:
sudo dencrypt checkYou can optionally check the SSL expiration status for a specific domain:
sudo dencrypt check example.com- Config Generation: Creates standard HTTP configuration files in
/etc/nginx/sites-available/or/etc/apache2/sites-available/. - Document Root: Scaffolds the directory structure at
/var/www/<domain>/htmlcomplete with a defaultindex.html. - Site Enablement: Creates safe symlinks to
sites-enabled/(or utilizesa2ensitefor Apache environments). - SSL Provisioning: Uses the respective
certbotplugin (--nginxor--apache) to fetch certificates securely and safely updates your config to redirect HTTP to HTTPS.