1. Install certbot:

sudo apt install certbot

2. Shudown OpenVPN server command:

sudo systemctl stop openvpnas

3. Install Let’s Encrypt certs multi-line command:

sudo certbot certonly \
--standalone \
--non-interactive \
--agree-tos \
--email EMAIL_ADDRESS \
--domains DOMAIN_NAME \
--pre-hook 'sudo service openvpnas stop' \
--post-hook 'sudo service openvpnas start'

4. Link Let’s Encrypt certs to OpenVPN web certs commands:

sudo ln -s -f /etc/letsencrypt/live/DOMAIN_NAME/cert.pem /usr/local/openvpn_as/etc/web-ssl/server.crt

sudo ln -s -f /etc/letsencrypt/live/DOMAIN_NAME/privkey.pem /usr/local/openvpn_as/etc/web-ssl/server.key

5. Restart OpenVPN service:

sudo systemctl start openvpnas

Leave a Reply