👨‍🏫 Tutorial Publish your site using Raspberry PI + Free domain with Cloudflare

mangmangkit

Grasshopper
Sa mga hindi makapag portforwarding jan dahil usually si ISP gumamit ng CGNAT para mablock ung mga port 80,443, 22 etc.
So share ko lang itong method ko ng paghost ng website gamit ang Raspberry.
  • Bumili lang ako ng domain for US$5 for 2 ρáíd slot. (as advertised its free-for-life) Dont worry, they have free 1 slot
    Create an account first. you can use my link You do not have permission to view the full content of this post. Log in or register now.
    also can increase 1 more slot by "Star the repository" on github You do not have permission to view the full content of this post. Log in or register now.
    1778330868905.webp

    We will be needing your dns later for the next configuration.
    Once have an account, create na kayo ng desired domain name nyo.
  • Next, Register an account sa You do not have permission to view the full content of this post. Log in or register now.
    Then go to Domains > Registration on the left side
    Then search your domain (domain na ginawa nyo sa digitalplat domain)




    1778331924596.webp

    Then once you add your domain in the cloudflare, need natin ichange ung nameserver sa digitalplat domain
    How to do:
    1. Click Domains > Overview (or click Account Home) makikita nyo jan ung domain nyo. click nyo lang
    2. Click DNS > Records on the left side. Then sa baba ng page may makikita kayong "Cloudfare Nameservers"
    there will 2 atleast 2 name servers listed.
    3. Copy each and paste on the digitalplat domain.
    In digitalplat domian. Click nyo ung "Domain List" sa left side then lalabas ung domain na nacreate nyo earlier.
    Click nyo lang sya.
    4. Dun sa Nameservers na tab Paste nyo sa Name Server 1 and 2 ung nameserver from cloudflare
    5. Then Click Update nameservers.
  • Once done, proceed na tayo sa medyo technical parts

 
Part 2: Setting Up your Raspberry Pi

1. Install Cloudflared on the Pi
Code:
sudo apt update
sudo apt install cloudflared
2. Create UUID sa cloudflare. Go to your cloudflare dashboard. then click Zero Trust > access >Tunnels on left side
Then Create Tunnel and copy your UUID
3. Next on your Raspberry Pi. Type in your terminal sudo nano /etc/cloudflared/config.yml
you can see your json file in "/home/pi/"
/home/pi/.cloudflared/<UUID>.json
Code:
tunnel: mypi
credentials-file: /home/pi/.cloudflared/<UUID>.json

ingress:
  # Web server (Apache/Nginx)
  - hostname: {your domain}
    service: http://localhost:80

  # SSH service
  - hostname: {ssh subdmain}
    service: ssh://localhost:22

  # Database service (MariaDB/MySQL on Pi port 3306)
  - hostname: {db subdomain}
    service: tcp://localhost:3306

  # Catch-all rule
  - service: http_status:404
3. Enabled and start your cloudflared
Code:
sudo systemctl restart cloudflared
sudo systemctl status cloudflared
4. Add DNS Records in your cloudflare. On left side, Click DNS > Records
Then click Add Record Button
Code:
[LIST]
[*]Type: CNAME
[*]Name: www, ssh, db
[*]Target: <UUID>.cfargotunnel.com (your tunnel ID hostname)
[*]Proxy status: Proxied (orange cloud)
[/LIST]
1778333560752.webp

Then Click Save.
Once naadd nyo na like ssh, db, your webapp
ganito makikita nyo
1778333677573.webp


You can now see your site.
1778333739244.webp


BTW, nagtry din ako maghost ng WordPress sa Rasberrypi ko
1778333840275.webp


Yun lang, if my explanation finds you a bit difficult for you, i can help naman.
But all of these instruction was provided to be by AI.

So you can ask also there AI to help you on the setup.
Its good for home projects or hobbies. Make sure lang na naka open lagi ung device nyo para maacess nyo.
Also this is not intended for production mode.
Good for practices lang ito para sa mga gusto maghost na sarili nila at ndi na magwwory pa sa monthly bills sa mga hosting side.
 

Similar threads

About this Thread

  • 1
    Replies
  • 145
    Views
  • 1
    Participants
Last reply from:
mangmangkit

Online now

Members online
368
Guests online
631
Total visitors
999

Forum statistics

Threads
2,274,606
Posts
28,957,170
Members
1,234,347
Latest member
Ynotzai
Back
Top