Skip to content

kizhonorium/bash-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Bash Scripts

Setup a Domain with Nginx & SSL

This script installs Nginx and Certbot, configures a reverse proxy for a given domain and port, and automatically sets up HTTPS with free Let's Encrypt SSL.

Requirements

  • Ubuntu/Debian-based system
  • sudo privileges
  • A domain name pointing to your server's IP

Usage

  1. Clone this repository

    git clone https://github.com/kizhonorium/bash-scripts.git
    cd bash-scripts
  2. Make the script executable

    chmod +x setup-domain.sh
  3. Run the script

    ./setup-domain.sh <your-domain> <port>

    Example:

    ./setup-domain.sh example.com 9000

Notes

  • Ensure your domain's DNS A record points to your server before running.
  • The script appends a certbot renewal job to root’s crontab:
    0 0 * * * /usr/bin/certbot renew --quiet
    
  • To manually renew certificates:
    sudo certbot renew

About

Useful bash scripts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages