Self-Hosting with Cloudflare and Nginx-Proxy-Manager
Hosting Your Website: Cloudflare and Nginx Made Simple
Step 1
Buy a domain on Cloudflare
Step 2
Click on Websites and then click your website.
Step 3
Click on DNS Records and add your server ip address or ISP domain name.
Step 4
Forward ports 80 and 443 on the router.
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:
Step 6
Build the Nginx Proxy Manager by running:
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
The End
You website should now be accessible using your Cloudflare Domain, in my case: https://crismuscalu.com and https://www.crismuscalu.com