All Posts

How I Host a Free Video & Photo Gallery Using Hugging Face + cPanel

If you’ve ever hosted a website on **cPanel**, you know storage and bandwidth can get expensive—especially for **videos and high-resolution images**. Most shared hosting plans...

How I Host a Free Video & Photo Gallery Using Hugging Face + cPanel

If you’ve ever hosted a website on **cPanel**, you know storage and bandwidth can get expensive—especially for **videos and high-resolution images**. Most shared hosting plans are optimized for websites, **not for large media files**. But here’s the trick I use 👇 Instead of storing videos and photos directly on my cPanel server, I offload them to **Hugging Face** (which provides free public storage and raw file access). My cPanel then only serves as the **frontend gallery**, while Hugging Face handles the heavy lifting of storage and streaming. This way: * ✅ I save hosting space and bandwidth * ✅ My videos load fast via Hugging Face’s CDN * ✅ I can still use my own domain and design for the gallery --- ## 🔹 Step 1: Upload Videos & Photos to Hugging Face 1. Create a **Hugging Face account** and open a new **Dataset Repo**. 2. Upload your files into folders like: ``` /videos/movie1.mp4 /videos/movie2.mp4 /photos/img1.jpg /photos/img2.png ``` 3. Hugging Face will give you **direct file URLs** like: ``` https://huggingface.co/datasets/your-username/your-repo/resolve/main/videos/movie1.mp4 https://huggingface.co/datasets/your-username/your-repo/resolve/main/photos/img1.jpg ``` These links can be used anywhere—just like files hosted on your own server. --- ## 🔹 Step 2: Build a Gallery Page on cPanel Next, I created a simple **PHP + HTML page** that pulls these Hugging Face files and displays them as a **video & photo gallery**. Here’s a minimal version you can use (save it as `gallery.php`): ```php "https://huggingface.co/datasets/your-username/your-repo/resolve/main/videos/movie1.mp4", "Movie 2" => "https://huggingface.co/datasets/your-username/your-repo/resolve/main/videos/movie2.mp4" ]; $photos = [ "Photo 1" => "https://huggingface.co/datasets/your-username/your-repo/resolve/main/photos/img1.jpg", "Photo 2" => "https://huggingface.co/datasets/your-username/your-repo/resolve/main/photos/img2.png" ]; ?>My Gallery

🎬 My Video & Photo Gallery

Videos

$url): ?>

Photos

$url): ?>" alt="">

``` Upload this file into your **public\_html** folder in cPanel, and visit: ``` https://yourdomain.com/gallery.php ``` Boom 💥 — you have a clean media gallery, hosted on your domain, but powered by Hugging Face storage. --- ## 🔹 Why This Hack Works * **Hugging Face** acts like a free CDN for static files (no extra cost). * **cPanel** only serves a lightweight frontend, so your hosting plan doesn’t choke. * You get the **best of both worlds**: a professional gallery under your brand, but with free storage behind the scenes. --- ## 🚀 Final Thoughts If you’re running on **shared hosting or small VPS plans**, this trick can save you a lot of headaches. Hugging Face handles all the media hosting, while your site remains lightweight and professional. I use this method for personal projects, client demos, and even portfolio showcases. It’s simple, fast, and free — perfect for creators and developers who want **media galleries without paying for heavy hosting**.

Enjoyed this article?

Let's connect and discuss ideas or work on something together.

Get in Touch