Tube Site Script
Getting started

What hosting does a tube site need? Server, CPU, disk, bandwidth and software

What server a tube site needs: why shared hosting falls short, how to size CPU for encoding, disk and bandwidth, and the PHP, MySQL and ffmpeg stack.

Updated 4 minute read The Tube Site Script team

A tube site needs a server you control: a VPS or dedicated server with several CPU cores for video encoding, plenty of fast disk for originals and encoded files, generous bandwidth for streaming, and a software stack of PHP, MySQL or MariaDB, a web server and ffmpeg. Shared hosting is fine for reading about tube sites but not for running one, because it usually blocks long-running processes, limits CPU and forbids the tools encoding depends on.

Why shared hosting is not enough

Shared hosting is built for small websites that serve a few pages per visit. A video site does very different work:

  • Encoding runs ffmpeg for minutes per video at full CPU. Shared hosts kill long processes and often disable proc_open, which PHP needs to start ffmpeg.
  • Uploads of hundreds of megabytes or several gigabytes need raised PHP limits that shared plans rarely allow.
  • Background jobs such as encoding queues and scheduled releases need cron running every minute, which many shared plans restrict.
  • Storage and transfer limits on shared plans are usually far below what even a modest video library uses.

A small VPS removes all of these limits, and costs little more than premium shared hosting.

VPS or dedicated server

A VPS is the usual starting point. You get root access, can install ffmpeg, set PHP limits and add cron jobs, and can resize as you grow. A dedicated server makes sense when encoding volume is high or when the bandwidth included with a VPS becomes the main cost. Some operators split the work: one server for the site and database, and encoded media pushed out through a CDN.

CPU: sized for encoding

Serving pages is light work; encoding is heavy. One video encoded into several qualities can keep every core busy for longer than the video's own running time, depending on resolution and preset. Rough guidance:

StageCPURAMNotes
Testing or a small site with occasional uploads2 vCPU4 GBEncoding is slow but workable for a few videos a day
Active site or small network4 to 8 vCPU8 GBComfortable for steady imports at 480p to 1080p
Busy network, many uploads, 4K8 to 16+ cores16 GB+Consider dedicated hardware and several encoding workers

If you only hotlink or embed videos from partners, nothing is encoded locally and CPU needs drop sharply. The video encoding settings guide explains how presets and resolutions affect encoding time.

Disk space

Plan for the original upload plus every encoded quality, plus thumbnails and preview clips. A simple estimate is the sum of each quality's bitrate multiplied by the running time. At typical web bitrates, one hour of video might use roughly 0.5 GB at 480p, 1.2 GB at 720p and 2 to 3 GB at 1080p, before you count the original. SSD or NVMe storage helps the database and thumbnail serving; large media libraries can live on bigger, slower volumes or object storage behind a CDN. Keep backups somewhere other than the server itself.

Bandwidth

Bandwidth is the cost that grows with success. Every view of a 1080p video can transfer hundreds of megabytes if watched to the end. Check whether your plan is metered or unmetered, what the port speed is, and what overage costs. A pull CDN in front of your media folder spreads the load, improves speed for distant visitors and often reduces the bill. See tube site speed and mobile for more on delivery.

Software stack

  • PHP 8.1 or newer with common extensions (pdo_mysql, gd, curl, mbstring, fileinfo, json) and proc_open enabled.
  • MySQL 8 or MariaDB 10.5+ for the database.
  • Apache with mod_rewrite or nginx with php-fpm as the web server. Nginx is popular for media-heavy sites and supports signed, expiring download links.
  • ffmpeg and ffprobe built with libx264. The ffmpeg installation guide covers Ubuntu, Debian and AlmaLinux.
  • Cron, so background tasks run every minute.

Raise PHP's upload and execution limits so large files can be uploaded through the browser, for example upload_max_filesize and post_max_size of a few gigabytes and max_execution_time of an hour.

Location and security

Host close to your main audience, or use a CDN if your audience is global. Check your host's acceptable use policy, because some providers do not allow certain kinds of video content. Keep the operating system patched, use SSH keys, and run a firewall; the server security guide has a checklist.

How Tube Site Script helps

Tube Site Script runs on a standard stack: PHP 8.1+, MySQL 8 or MariaDB 10.5+, ffmpeg and ffprobe with libx264, and Apache with mod_rewrite or nginx with php-fpm. The installer checks requirements before it starts, so missing extensions or a disabled proc_open show up straight away. Background work runs from two cron lines, and on busy networks the encoding worker can run permanently as a systemd service, with several workers at once.

You can set a CDN URL in network settings so media loads from your CDN, and enable signed, expiring MP4 links with nginx secure_link. Because one install runs every site in the network, you size and maintain one server instead of one per domain. See the PHP tube script features or pricing.

Frequently asked questions

Do I need a dedicated server for a tube site?

Not at first. A VPS with a few cores is enough for most new sites; a dedicated server becomes worthwhile when encoding volume or bandwidth grows.

How much disk space does a tube site use?

Plan for the original file plus every encoded quality, thumbnails and previews. As a rough guide, one hour of 1080p at web bitrates uses a few gigabytes before counting the original.

Is a CDN necessary?

It is optional for a small site but helps once traffic grows or your audience is spread across countries. It moves video delivery off your server and usually speeds up playback.

Get three guides like this every month, plus software update notices.Subscribe →