Guide to Setting Up ClipBucket on CentOS 7
ClipBucket is a community-powered, open source platform for video sharing and media management. Initially built to mimic popular video-sharing websites, ClipBucket has matured into a powerful media distribution tool that rivals commercial solutions in functionality and flexibility.
Core Features of ClipBucket
- Integrated ads management
- Role-based content access control
- Support for HLS video streaming
- Active Directory integration on Windows Server
- Live performance analytics
- Monetization and revenue sharing options
- Video-on-demand (VOD) services
System Requirements
- CentOS 7 x64 Minimal ISO library server
- User account with sudo privileges
Step 1: System Update
Begin by logging in with a standard user account that has access to sudo. Execute the following command to clean up the system, install delta RPM support, and apply all updates:
sudo yum clean all && sudo yum install deltarpm -y && sudo yum update -y
Step 2: Adding RPMFusion Repository
The default CentOS and EPEL repositories do not offer FFmpeg (with FFProbe) or GPAC (with MP4Box). These tools are necessary for ClipBucket and are available via RPMFusion. Add the repository using:
sudo yum localinstall –nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm -y
Step 3: Installing Multimedia Backends
To enable ClipBucket to process and display web-friendly videos, install necessary backend tools like FFmpeg and MP4Box from the REMI repo using:
sudo yum install ffmpeg gpac -y
Step 4: Ruby and Dependencies Installation
Install the libyaml library before setting up Ruby, which is essential for ClipBucket functionality:
sudo yum install libyaml -y
Now, download and install Ruby version 2.5.x:
sudo rpm -ivh https://github.com/feedforce/ruby-rpm/releases/download/2.5.0/ruby-2.5.0-1.el7.centos.x86_64.rpm
Step 5: Installing RubyGems and FLVTool2
Install the RubyGems package management system first:
sudo yum install rubygems -y
Then install the FLVTool2 gem for processing Flash video metadata:
sudo gem install flvtool2
Step 6: Install Additional Utilities
Complete the setup by installing ImageMagick for image processing, MediaInfo for metadata inspection, and MPlayer/Mencoder for media playback and encoding:
sudo yum install ImageMagick mediainfo mplayer -y
Install and Configure the Web Server Backend for ClipBucket
Step 1: Install the Latest MariaDB Database Server
By default, CentOS 7 provides MariaDB version 5.5.x. To use the latest 10.x.x release, you must manually configure the MariaDB repository.
Create a new file named MariaDB.repo
inside the /etc/yum.repos.d/
directory using the sed
command:
sudo su -c “echo -e ‘[mariadb]\nname = MariaDB\nbaseurl = http://yum.mariadb.org/10.2/centos7-amd64\ngpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB\ngpgcheck=1’ > /etc/yum.repos.d/MariaDB.repo”
Now install MariaDB and accept the GPG key when prompted:
sudo yum install MariaDB-server -y
Start the MariaDB service:
sudo systemctl start mysql
Secure the database by running a manual configuration equivalent to mysql_secure_installation
. Replace ********
with your desired root password:
sudo mysql -e “UPDATE mysql.user SET Password=PASSWORD(‘********’) WHERE User=’root’;DELETE FROM mysql.user WHERE User=’root’ AND Host NOT IN (‘localhost’, ‘127.0.0.1’, ‘::1’);DELETE FROM mysql.user WHERE User=”;DELETE FROM mysql.db WHERE Db IN(‘test’, ‘test\_%’);DROP DATABASE test;FLUSH PRIVILEGES”
Backup the existing server.cnf
file:
sudo mv /etc/my.cnf.d/server.cnf /root/server.cnf.original
Generate a new server.cnf
configuration file optimized for UTF-8 and tuned for performance:
sudo su -c “echo -e ‘[mysqld]\nbinlog_format\t\t\t\t\t= mixed\ncharacter-set-client-handshake\t\t\t= FALSE\n…’ > /etc/my.cnf.d/server.cnf”
Create a logging directory and assign the correct ownership:
sudo mkdir /var/log/mysql && sudo chown mysql.mysql /var/log/mysql
Restart MariaDB to apply changes:
sudo systemctl restart mysql
Step 2: Install PHP-FPM 7.0.x and Required PHP Modules
To run PHP scripts, you must install PHP-FPM version 7.0 or newer. Begin by adding the REMI repository and then installing the necessary PHP extensions:
sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm -y && sudo yum install php70-php-cli php70-php-pecl-imagick php70-php-fpm php70-php-mysql php70-php-opcache -y
Backup the original PHP-FPM configuration file:
sudo mv /etc/opt/remi/php70/php-fpm.conf /etc/opt/remi/php70/php-fpm.conf.original
Create a new php-fpm.conf
with performance settings:
sudo su -c “echo -e ‘include=/etc/opt/remi/php70/php-fpm.d/*.conf\n[global]\ndaemonize = yes\nemergency_restart_threshold = 2\nemergency_restart_interval = 1m\nerror_log = /var/log/php-fpm/php-fpm-7.0-error.log\npid = /var/run/php-fpm-7.0.pid\nprocess_control_timeout = 10s’ > /etc/opt/remi/php70/php-fpm.conf”
Backup and recreate the www.conf
pool configuration file:
sudo mv /etc/opt/remi/php70/php-fpm.d/www.conf /etc/opt/remi/php70/php-fpm.d/www.conf.original
sudo su -c “echo -e ‘[www]\ngroup = apache\nlisten = /var/run/php-fpm-7.0.sock\nlisten.backlog = 65536\nlisten.owner = apache\nlisten.group = apache\npm = static\npm.max_children = 2\npm.max_requests = 10240\nuser = apache’ > /etc/opt/remi/php70/php-fpm.d/www.conf”
Backup and regenerate the php.ini
configuration with your desired upload sizes and time zone:
sudo mv /etc/opt/remi/php70/php.ini /etc/opt/remi/php70/php.ini.original
sudo su -c “echo -e ‘[PHP]\nallow_url_fopen = On\nalways_populate_raw_post_data = -1\ndisplay_errors = Off\nerror_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT\nexpose_php = Off\nlog_errors = On\nmax_execution_time = 7201\nmemory_limit = 256M\noutput_buffering = 4096\npost_max_size = 256M\nregister_argc_argv = Off\nrequest_order = \”GP\”\nupload_max_filesize = 256M\nvariables_order = \”GPCS\”\n[Date]\ndate.timezone = America/New_York\n[Session]\nsession.cache_limiter =\nsession.gc_divisor = 1000\nsession.hash_bits_per_character = 5\nsession.save_handler = files\nsession.save_path = \”/var/opt/remi/php70/lib/php/session/\”\nurl_rewriter.tags = \”a=href,area=href,frame=src,input=src,form=fakeentry\”‘ > /etc/opt/remi/php70/php.ini”
Create a directory for PHP-FPM logs:
sudo mkdir /var/log/php-fpm/
Enable and start the PHP-FPM service:
sudo systemctl enable php70-php-fpm && sudo systemctl start php70-php-fpm
Final Steps: Installing and Setting Up ClipBucket
To install ClipBucket, begin by downloading the latest version and extracting its contents into the /var/www/html
directory:
sudo su – apache -c “wget -N -P /tmp/ https://github.com/arslancb/clipbucket/archive/4881.tar.gz -q” -s /bin/bash && sudo mkdir -p /var/www/html && sudo chown -R apache.apache /var/www/html && sudo su – apache -c “tar -C /var/www/html -zxf /tmp/4881.tar.gz clipbucket-4881/upload/ –strip-components=2” -s /bin/bash && sudo rm /tmp/4881.tar.gz
Create the ClipBucket Database
Now set up a new database and user account. Update the placeholder password and domain name to reflect your actual settings:
sudo mysql -u root -p -e “CREATE DATABASE clipbucket_example_com; GRANT ALTER,CREATE,DELETE,DROP,INDEX,INSERT,SELECT,UPDATE ON clipbucket_example_com.* TO clipbucket_example_com_admin@localhost IDENTIFIED BY ‘********’”
Allow HTTP Traffic Through the Firewall
If your browser shows an error like “Unable to connect”, open port 80 using this command:
sudo firewall-cmd –permanent –zone=public –add-service=http && sudo firewall-cmd –reload
Complete the Web-Based Installation
- Open your browser and navigate to
http://www.example.com
. - Click Ok, I agree, Now let me Continue!.
- Click Continue To Next Step.
- Ensure all permissions are green-checked, then continue.
- Enter your database details and check the connection.
- Provide the admin username, password, and email.
- Set the site title, slogan, and URL.
- Skip registration or proceed, then finalize installation.
Clean Up Installation Files
Delete the installation folder to secure your ClipBucket site:
sudo rm -rf /var/www/html/cb_install
Back in your browser, click Continue to Admin Area and log in using the admin credentials.
Configure Uploading and Conversion Settings
- In the admin panel, go to Website Configurations.
- Open the Uploading and Conversion Settings tab.
- Update the following paths:
- Use Crons: Yes
- FFMPEG Path: /usr/bin/ffmpeg
- PHP Path: /usr/bin/php70
- MP4Box Path: /usr/bin/MP4Box
- MPlayer Path: /usr/bin/mplayer
- Click Update Settings to apply changes.
Validate Server Upload Limits
To confirm upload size limits, navigate to Tool Box > Server Modules Info. Make sure the POST MAX SIZE, UPLOAD MAX FILESIZE, and MEMORY LIMIT match the values in your php.ini
and nginx.conf
.
Verify Conversion Tools
In the admin panel, under Server Conversion Info, confirm that the tools (FFMPEG, PHP CLI, Media Info, MP4Box, ImageMagick, FFProbe) all have green checks.
Set Up Cron Jobs for Background Video Processing
Run the following command to set up cron jobs for conversion and stats updating:
sudo su -c “echo -e ‘* * * * * /usr/bin/php70 -q /var/www/html/actions/video_convert.php\n* * * * * /usr/bin/php70 -q /var/www/html/actions/verify_converted_videos.php\n0 0,12,13 * * * /usr/bin/php70 -q /var/www/html/actions/update_cb_stats.php’ > /var/spool/cron/apache” -s /bin/bash && sudo chown apache.apache /var/spool/cron/apache
Conclusion
You’ve now completed the full setup and configuration of ClipBucket on CentOS 7, including all backend services, video processing tools, and cron automation. ClipBucket is now ready for uploading, converting, and managing videos. For further enhancements and customization options, refer to the official ClipBucket documentation.