Skip to main content

Install NGINX on Arch Linux



Fast and easy tutorial for installing a NGINX web server with HTTP/2 and TLS certificates from Let's Encrypt on Arch Linux.


pacman -S nginx-mainline certbot certbot-nginx

The default page served at is located at /usr/share/nginx/html/index.html.


DigitalOcean has provided a tool for configuring your web server over at, use it and follow the instructions to create a site. Then proceed with the instructions below.

Disable the default site

If you want to disable the default site and create a new one, instead of adding your site to the default webroot, you can disable it by removing the symlink.

rm /etc/nginx/sites-enabled/default

Automatically renew the certificates

Create a systemd service

[Unit]Description=Let’s Encrypt renewal[Service]Type=oneshotExecStart=/usr/bin/certbot renew —quiet —agree-tos —deploy-hook “systemctl reload nginx.service”

Create a timer

Make it run twice a day at random times to help reduce load on Let's Encrypt servers

[Unit]Description=Twice daily renewal of Let’s Encrypt’s certificates[Timer]OnCalendar=0/12:00:00RandomizedDelaySec=1hPersistent=true[Install]

Start and enable the service

systemctl start certbot.timersystemctl enable certbot.timer


systemctl start nginxsystemctl enable nginx


Your website should now be live at