Install Lego

  1. Open a terminal using an account with elevated rights.

  2. Download the Lego client to the /tmp directory.

    cd /tmp
    sudo wget https://github.com/go-acme/lego/releases/download/v4.2.0/lego_v4.2.0_linux_amd64.tar.gz -qO- | tar -C /tmp -xz lego
  3. Move the contents of the /tmp/lego directory to /etc/lego.

    mkdir /etc/lego
    chmod 655 /etc/lego
    mv /tmp/lego /etc/lego/
  4. Navigate to etc/lego.

  5. Execute the lego command to view the syntax.

    ./lego
    AME:
        lego - Let's Encrypt client written in Go
    
    USAGE:
        lego [global options] command [command options] [arguments...]
    
    VERSION: 4.2.0
    
    COMMANDS:
        run     Register an account, then create and install a certificate
        revoke  Revoke a certificate
        renew   Renew a certificate
        dnshelp Shows additional help for the '--dns' global option
        list    Display certificates and accounts information
        help, h Shows a list of commands or help for one command