WEBサーバーでPort:80とPort:443を有効にしておきます。
(自動更新用にPort:80のrootディレクトリは777とかに設定しておく。)
$ chmod -R 777 /var/www/public_html
letsencryptのダウンロードとインストールを実行します。
$ git clone https://github.com/letsencrypt/letsencrypt
$ ./letsencrypt/letsencrypt-auto
ドメイン名とかメールアドレスを入力してインストールが終わると証明書ファイルが以下のディレクトリに生成されます。
$ cd /etc/letsencrypt/live/YOUR_HOSTNAME/ ; ls
cert.pem
chain.pem
fullchain.pem
privkey.pem
自動更新を設定するためにクーロンを追加します。
$ crontab -e
以下の通り反映されました。(毎月1日に更新)
* * 1 * * /path_to_letsencrypt/letsencrypt-auto certonly --webroot -w /var/www/letsencrypt -d [YOURDOMAIN] --renew-by-default && service restart nginx
これで完了です。