PlayTube is a complete, self‑hosted PHP video CMS and video sharing platform — the fastest way to build your own YouTube‑style website for uploading, streaming, and monetizing video. It ships as a ready‑to‑deploy PHP script with a full admin panel, a multi‑theme front end, and an advanced REST API that powers native mobile apps.
Out of the box you get user channels, subscriptions, comments, playlists, live streaming, Shorts, monetization (Pro plans, paid videos, wallet, ads & affiliates), and social login — backed by a MySQL database and FFmpeg transcoding. A lightweight Node.js + Socket.IO service adds real‑time features on top of the core PHP application.
PlayTube is built for content creators, startups, agencies, and media companies who want to own their platform instead of relying on third‑party hosts. It is fast, secure, regularly updated, and designed to scale from a single‑server install to a full production deployment behind Apache or Nginx.
🔎 Keywords: PHP video CMS, video sharing platform, YouTube clone, video streaming script, self‑hosted video site, live streaming PHP, video monetization, REST API video app, FFmpeg transcoding, PlayTube.
- 🎥 Video sharing & streaming — upload, transcode (FFmpeg), and stream videos with adaptive playback.
- 📡 Live streaming & Shorts — go live and publish short‑form vertical videos.
- 👤 Channels & subscriptions — user channels, subscribe feeds, watch history, liked & saved videos.
- 💬 Engagement — comments, posts/timeline, articles, hashtags, and notifications.
- 💰 Monetization — Pro upgrades, paid videos, wallet & transactions, ads, and an affiliate system.
- 📱 Native mobile app support — a full versioned REST API (
app_api/v1.0) for iOS/Android clients. - 🔐 Social login & 2FA — sign in via popular providers plus two‑factor authentication.
- 💳 Payment gateways — Stripe, Braintree, Authorize.Net, PayFast, 2Checkout, SecurionPay, iyzico, QIWI, Alipay and more.
- ☁️ Flexible storage — local, FTP, or Amazon S3 video storage.
- 🛠️ Powerful admin panel — dashboards, content moderation, analytics, and site configuration.
- 🎨 Multi‑theme front end — ships with
defaultandyouplaythemes. - ⚡ Real‑time layer — optional Node.js + Socket.IO service for live updates.
- 🌍 Multi‑language — English, Persian, and Kurdish documentation included.
| Layer | Technology |
|---|---|
| Backend | PHP 7.1+ (MySQLi) |
| Database | MySQL (playtube.sql schema) |
| Media | FFmpeg, getID3 |
| Real‑time | Node.js, Express, Socket.IO |
| Front end | JavaScript, HTML, CSS, theme engine |
| API | Versioned REST API for mobile apps |
| Web server | Apache (.htaccess) or Nginx (nginx.conf) |
- PHP 7.1 or higher
- MySQLi
- PHP extensions: GD Library, mbstring, calendar
- cURL enabled, with
allow_url_fopen - The
shell_execPHP function enabled (for FFmpeg) - A web server (Apache or Nginx) and a MySQL database
-
Upload all script files to your web server root (via FTP) or place them in your localhost root directory.
-
Open your browser and navigate to:
http://www.YOURSITE.com/install -
Accept the Terms of Use and continue.
-
Make sure your server meets the listed requirements (the installer verifies them).
-
Fill in the installation form:
- Purchase Code — your Envato purchase code
- SQL Host / Username / Password / Database — your MySQL connection details
- Site URL — e.g.
https://yoursite.com - Site Name, Site Title, Site E‑mail (use a server email, not Gmail/Hotmail)
- Admin Username and Admin Password
-
Click Install and wait — installation can take up to ~5 minutes.
Copy the contents of the bundled nginx.conf into your server's root nginx.conf
(usually /etc/nginx/nginx.conf), then reload Nginx.
After installation, add this to your server's crontab so background tasks run:
*/15 * * * * php -f {PATH_TO_SCRIPT}/cronjob.php > /dev/null 2>&1Replace {PATH_TO_SCRIPT} with the absolute path, e.g. /home/playtube/public_html.
cd nodejs
npm install
npm startplaytube/
├── index.php # Front controller
├── admincp.php # Admin control panel
├── api.php # API entry point
├── ajax.php # AJAX endpoints
├── cronjob.php # Scheduled background tasks
├── secure_video.php # Secure video delivery
├── playtube.sql # Database schema
├── nginx.conf # Nginx configuration sample
├── admin-panel/ # Admin dashboard UI & assets
├── app_api/v1.0/ # Versioned REST API for mobile apps
├── sources/ # Page/feature modules (watch, upload, live, shorts, …)
├── assets/libs/ # Payment, storage, social & media libraries
├── themes/ # Front-end themes (default, youplay)
├── nodejs/ # Node.js + Socket.IO real-time service
├── install/ # Web installer
└── upload/ # User uploads & screenshots
v3.1.1
Contributions are welcome! Read CONTRIBUTING.md and the
Code of Conduct, then open an
issue or submit a pull request.
Please report security issues responsibly as described in SECURITY.md.
Distributed under the MIT License. See LICENSE for details.





