Self-Hosting with Cloudflare and Nginx-Proxy-Manager

Self-Hosting with Cloudflare and Nginx-Proxy-Manager

Hosting Your Website: Cloudflare and Nginx Made Simple

Step 1

Buy a domain on Cloudflare

Screenshot 2024-06-12 at 16.05.31.png-img

Step 2

Click on Websites and then click your website.

Screenshot 2024-06-19 at 13.53.53.png-img

Step 3

Click on DNS Records and add your server ip address or ISP domain name.

Screenshot 2024-06-27 at 14.56.06.png-img

Step 4

Forward ports 80 and 443 on the router.

Screenshot 2024-06-27 at 14.40.18.png-img

Step 5

Install Nginx Proxy Manager on your server using Docker.

Create a /dockers folder and a add this in a new docker-compose.yml file:

Screenshot 2024-06-27 at 15.05.33.png-img
docker-compose.yml

Step 6

Build the Nginx Proxy Manager by running:

terminal

Step 7

Access Nginx Proxy Manager on port 81 ( http://192.168.1.101:81 ) using the default credentials:

Email: admin@example.com Password: changeme

Step 8

Click Hosts -> Proxy Hosts and add:

  • Domain Names, for ex: crismuscalu.com www.crismuscalu.com
  • Scheme: http
  • Forward Hostname/IP: 192.168.1.101
  • Forward Port: 1337

Click the SSL tab -> SSL ceritifcate:

  • Request new SSL Ceritifcate
  • Check Force SSL and HTTPS/2 Support
Screenshot 2024-06-27 at 15.19.44.png-img
Screenshot 2024-06-27 at 15.15.44.png-img

The End

You website should now be accessible using your Cloudflare Domain, in my case: https://crismuscalu.com and https://www.crismuscalu.com