How to Make a Video Website Like YouTube
Run your own video site with PeerTube, MediaCMS or a PHP script. The bandwidth maths that decides everything, transcoding, storage costs and honest advice on what is realistic.
Building a video website is not hard. The software is free and installs in an afternoon. What catches people out is the running cost, because video is the one thing on the internet that is genuinely expensive to serve.
So we start with the maths. If the numbers work for your project, the rest of this guide gets you running.
The bandwidth maths, before anything else
Serving a video means sending the whole file to every viewer, every time.
A 10-minute video at 720p is roughly 150 MB. So:
| Views per month | Bandwidth used | Typical cost |
|---|---|---|
| 1,000 | 150 GB | Included in most VPS plans |
| 10,000 | 1.5 TB | At the edge of a $10 plan |
| 100,000 | 15 TB | $50–150 / month |
| 1,000,000 | 150 TB | $500–1,500 / month |
This is why YouTube is free and your site will not be. Google absorbs this cost with advertising at a scale you cannot match.
Self-hosted video makes sense for a course platform, a company video library, a community with a few thousand viewers, or anything where you cannot use YouTube for policy reasons. It does not make sense as an open public YouTube competitor.
Pick a host with generous bandwidth
Providers differ enormously here. Some include 20 TB on a $10 plan; others charge per gigabyte after 1 TB and the bill arrives as a shock. Check the bandwidth allowance and the overage price before you buy anything.
Which software?
| Software | Best for | Cost | Notes |
|---|---|---|---|
| PeerTube | Public video sites | Free | Viewers share bandwidth with each other, which genuinely cuts your bill |
| MediaCMS | Course and library sites | Free | Python. Clean admin, simple to run |
| Open Video CMS / PHP scripts | Shared hosting | Free–paid | Lighter, but you handle transcoding yourself |
| WordPress + a video theme | Few videos, mostly a blog | Free–paid | Fine only if videos are hosted elsewhere |
PeerTube is the interesting one. It uses peer-to-peer streaming, so when several people watch the same video at once they send pieces to each other instead of all pulling from your server. On a popular video that can cut your bandwidth bill substantially — the only self-hosted option where scale actually helps you.
What your server needs
- 4 GB RAM minimum. Transcoding is the heaviest thing your server will ever do.
- 2+ CPU cores. More cores means faster processing after upload.
- Storage for the originals and every converted version. Budget roughly 3× the raw upload size.
- Lots of bandwidth. See above.
- FFmpeg installed — every one of these tools uses it to convert video.
Shared hosting cannot do this. It blocks the long-running processes transcoding needs, and the disk and bandwidth limits are far too low.
Understanding transcoding
This is the concept that makes everything else make sense.
When someone uploads a video it arrives in one size and format — often a 2 GB phone recording. Your server must convert it into several smaller versions: 1080p, 720p, 480p, 360p. That is transcoding.
It matters for three reasons:
- It is slow. A 10-minute video can take 10 to 30 minutes to process. Users need to see a "processing" message, not a broken page.
- It uses the whole CPU. While transcoding runs, the rest of your site slows down. Limit how many run at once.
- It multiplies storage. One upload becomes four or five files.
You can switch transcoding off and serve the original file, but then someone on a phone downloads a 2 GB file to watch a short clip. Do not do that.
Step 1: Get the server ready
Start with a clean Ubuntu VPS. If you have not set one up before, how to install a LAMP server on Ubuntu covers the basics.
Then point your domain at the server and get SSL in place — see how to install a free SSL certificate on Ubuntu. Browsers restrict video features on plain HTTP, and no viewer trusts a "Not secure" warning.
Step 2: Install the platform
Both recommended options publish Docker installs, which is by far the easiest route — Docker bundles FFmpeg, the database and the web server so you are not assembling them by hand.
- PeerTube — follow the official Docker guide at docs.joinpeertube.org
- MediaCMS — a single install script, documented at github.com/mediacms-io/mediacms
Both ask for your domain, an admin email and a password. Both are running in under an hour on a prepared server.
Step 3: Configure before you invite anyone
- Maximum upload size. Cap it. One person uploading a 20 GB raw file will fill the disk and jam the transcode queue.
- Transcoding resolutions. 480p and 720p are enough to start. Adding 1080p and 4K multiplies both processing time and storage.
- Concurrent transcodes. Set this to one or two. Leave it unlimited and five uploads will freeze the server.
- Who can upload. Open uploads on a public video site attract piracy and worse, quickly. Start invite-only.
- Email. Configure SMTP so sign-up and "your video is ready" notifications actually arrive.
Step 4: Cut the bandwidth bill
Three things make a real difference:
- Put a CDN in front. Cloudflare's free tier does not allow heavy video, but their paid Stream product or Bunny CDN will serve video far more cheaply than your VPS.
- Serve lower resolutions by default. 480p looks fine on a phone and uses a third of the data of 1080p.
- Use PeerTube's peer-to-peer mode if your audience watches the same videos at the same time.
Common problems
Uploads fail on large files
Raise the web server and PHP limits — client_max_body_size in Nginx, or upload_max_filesize and post_max_size in PHP. Also raise the timeout, because a long upload can exceed it.
Videos upload but never finish processing
The transcode queue is stuck or FFmpeg is missing. Check the worker logs. On a small server, several simultaneous transcodes can exhaust the memory and kill the process.
Playback stutters
Either bandwidth or transcoding. If only some viewers are affected it is their connection, so offer a lower resolution. If everyone is affected, your server is saturated.
The server slows to a crawl after an upload
Transcoding is taking all the CPU. Limit concurrent jobs, or give FFmpeg a lower priority so the website stays responsive.
The bandwidth bill is far higher than expected
Check whether anyone is hotlinking your videos on another site. Block that in the server configuration, and consider requiring a signed URL for playback.
The honest summary
Self-hosted video works well when the audience is known and limited: a course platform, a company library, a club, a paid membership site. In those cases you control the cost and the numbers make sense.
As an open public video site, the bandwidth will outpace you long before the software does. If that is the goal, look seriously at embedding video hosted elsewhere and keeping only the website on your server.
For something far lighter to run, a file sharing site gives people a way to share media without the transcoding and streaming load.