Installing RamTV on Ubuntu 24.04 LTS
A clean VPS to a running platform, from the command line
This guide takes an existing Ubuntu 24.04 LTS server to a working RamTV installation with Apache, PHP 8.3, and a local MariaDB database. It gives the Ubuntu commands that matter to RamTV; it does not cover creating a VPS, managing SSH keys, or operating a Linux server generally. Use it alongside RamTV's standard installation steps. The sample commands use music.example.com and /var/www/ramtv; Section 1 explains how to use the main domain example.com instead.
Ubuntu 24.04 LTS is used here because its packaged PHP version is 8.3 and it remains within Ubuntu's standard support window. A newer Ubuntu release may ship a newer PHP version; RamTV's installer checks only a minimum version and required extensions, so that check alone does not prove compatibility with every newer PHP release. See Ubuntu's release cycle and 24.04 PHP packages.
Before you start
- Have a VPS or dedicated server with Ubuntu 24.04 LTS, a sudo-capable login, the complete RamTV release package and purchase code, a registered domain, and a Cloudflare account. The domain can remain registered with your current registrar while Cloudflare manages its DNS. This is a single-server example: Apache, PHP, the RamTV files, and MariaDB all live on that server.
- Choose the final public hostname before activation. RamTV's licence terms bind a purchase code to one domain/IP address; a move to another address may need a reset. In the installer, use the final
https://URL, with the trailing slash. - Keep the domain reachable on ports 80 and 443. If your provider has a cloud firewall as well as Ubuntu's firewall, both must permit web traffic. Keep SSH access available while changing firewall rules. Ubuntu's firewall guide covers UFW in more depth.
1. Set up the domain in Cloudflare DNS
Use Cloudflare as the domain's authoritative DNS provider. Add the domain (example.com) to Cloudflare and choose a plan. Decide whether RamTV will use the main domain (example.com) or a subdomain (music.example.com); the DNS name, Apache hostname, certificate, and RamTV licence URL must all match that choice. Cloudflare assigns two nameservers; the domain can remain with its present registrar. Follow Cloudflare's current primary DNS setup guide. Prepare the DNS records before changing nameservers so the domain and its mail keep working during the switch.
- In Cloudflare, review the imported DNS records and add anything its scan missed. Preserve existing apex,
www, MX, SPF, DKIM, DMARC, and verification records that your domain actually uses. Cloudflare warns that its quick scan can miss records; compare with the old DNS provider before switching. See Review your DNS records. - Go to DNS → Records → Add record. For RamTV on the main domain, create or edit an A record with Name
@and IPv4 address set to the Ubuntu server's public IPv4 address. For RamTV onmusic.example.com, use Namemusicinstead. Cloudflare may already have imported an apex A record; edit that record if it points elsewhere instead of leaving a conflicting old address. Add an AAAA record for the same name only if the server has working public IPv6. Set the chosen RamTV web record to DNS only (gray cloud) during installation and leave TTL at Auto. See Cloudflare's zone apex instructions, subdomain instructions, and proxy status explanation. - If DNSSEC is active at the current registrar, follow Cloudflare's instructions to remove the old DS record before changing nameservers. At the registrar, replace the existing authoritative nameservers with the exact two assigned by Cloudflare. If the domain is registered with Cloudflare Registrar, it already uses Cloudflare nameservers. Wait until Cloudflare shows the zone as Active. From then on, make this domain's A/AAAA changes in Cloudflare, rather than at the old DNS provider.

Cloudflare's DNS Records page: choose Add record or edit an existing A record. Its sample addresses and proxy statuses are illustrative; set your RamTV record to DNS only for installation. Screenshot: Cloudflare DNS changelog, 20 May 2026.

Cloudflare calls out the root domain as a separate record from www. This is an earlier dashboard layout; use the current Records page shown above. Screenshot: Cloudflare Blog.
For the main domain, enter @ only in Cloudflare's Name field. Cloudflare uses it for the zone apex, so an A record named @ in the example.com zone makes example.com resolve to your server. After saving, the record list may display example.com instead of @. @ is not part of a web address, Apache ServerName, certificate command, or RamTV licence URL. Cloudflare's official apex example uses exactly this name.
Type: A
Name: @
IPv4 address: YOUR_SERVER_PUBLIC_IP
Proxy status: DNS only
TTL: AutoIf you choose the main domain, substitute example.com for every later music.example.com example in this guide, including Apache's ServerName, the Certbot -d value, the installer and licence URLs, and the Server step's self-check URL. If you want www.example.com too, add a separate CNAME record with Name www and Target example.com (or an A record pointing to the same public IP) and configure Apache and the TLS certificate for that hostname as well; the @ record alone does not cover www.
While the RamTV record is DNS only, confirm your chosen hostname (example.com for @, or music.example.com for music) resolves to the server's public IP from another network and from the Ubuntu server. Run the corresponding command below. The hostname must also connect from that server: RamTV later requests its own /api/client_config URL to verify Apache rewriting. If it does not resolve, check the assigned nameservers, zone status, and old DNSSEC DS record before continuing.
# Main domain (@):
getent ahostsv4 example.com
# Subdomain (music):
getent ahostsv4 music.example.comIf UFW is in use, allow SSH and HTTP/HTTPS before enabling it. The exact SSH profile may differ if you changed the SSH port; confirm access in another session. Ubuntu documents UFW commands and application profiles. Your provider's network firewall needs equivalent access.
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw status2. Install the web stack RamTV needs
Install Ubuntu's Apache module for PHP 8.3, the CLI interpreter for RamTV's scheduled job, MariaDB, cron, and the PHP extensions the RamTV installer checks. The MySQL package supplies MySQLi for MariaDB connections; XML supports RamTV's bundled PHP libraries. This example uses Ubuntu packages rather than an additional PHP repository; see Ubuntu's Apache and PHP guides and MariaDB's installation guide.
sudo apt update
sudo apt install apache2 mariadb-server cron \
libapache2-mod-php8.3 php8.3-cli php8.3-curl php8.3-mysql \
php8.3-mbstring php8.3-gd php8.3-zip php8.3-xml
sudo systemctl enable --now apache2 mariadb cron
sudo a2enmod rewrite headers access_compat
sudo systemctl restart apache2The rewrite and headers modules are needed by RamTV's unchanged root .htaccess. Some protected RamTV directories also contain Apache's older Order/Deny directives, so access_compat is needed for those files on Apache 2.4. Apache documents the compatibility module; Ubuntu documents a2enmod.
Check that the CLI version is 8.3 and contains the extensions. The browser installer checks the Apache PHP configuration separately. If the Requirements step reports allow_url_fopen disabled, enable it in the active Apache PHP configuration (normally /etc/php/8.3/apache2/php.ini), restart Apache, and refresh the installer. For the cron interpreter, use php8.3 --ini to locate its separate CLI configuration.
php8.3 -v
php8.3 -m
sudo systemctl status apache2 mariadb cron --no-pager3. Put the RamTV release in the document root
Create the site directory, then copy the contents of the release package's script directory into it. Use your actual unpacked release path in the second command. cp -a .../. includes hidden files, including .htaccess. The result should contain /var/www/ramtv/index.php, /var/www/ramtv/api/, /var/www/ramtv/admin/, /var/www/ramtv/installer/, and /var/www/ramtv/.htaccess directly under the site root. An extra script/ level changes all URLs. Use the complete release package, not a development checkout with symlinks to directories outside it.
sudo mkdir -p /var/www/ramtv
sudo cp -a /path/to/unpacked-release/script/. /var/www/ramtv/
ls -la /var/www/ramtvKeep the original .htaccess files byte-for-byte: RamTV's installer checks hashes for the root, API, admin, and framework rules. Do not paste rewrite rules from a generic PHP tutorial into them. Configure Apache around the package instead.
Apache's PHP process runs as www-data in this example. It needs read access to the application, permanent write access to files/ for uploaded and generated media, and temporary write access to api/app/ during installation so it can create or update config_user.php and config_license.php. The commands below assume you are deploying from a normal sudo-capable account. If either config file already exists, grant group write on that file for the installer too. Do not make the whole site world-writable.
sudo chown -R "$USER":www-data /var/www/ramtv
sudo chmod -R g+rwX /var/www/ramtv/files
sudo chmod g+w /var/www/ramtv/api/app
for file in /var/www/ramtv/api/app/config_user.php /var/www/ramtv/api/app/config_license.php; do
if [ -f "$file" ]; then sudo chmod g+w "$file"; fi
done4. Give Apache a site for that hostname
Save this example as /etc/apache2/sites-available/ramtv.conf, using ServerName example.com if you chose the Cloudflare @ record (or replacing the hostname and path if necessary). Its DocumentRoot points at RamTV's index.php, not at api/ or the outer ZIP folder. AllowOverride All lets Apache read the packaged .htaccess files; FollowSymLinks supports their rewrite rules. Ubuntu's VirtualHost guide explains site files and a2ensite; Apache documents AllowOverride.
<VirtualHost *:80>
ServerName music.example.com
DocumentRoot /var/www/ramtv
<Directory /var/www/ramtv>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/ramtv-error.log
CustomLog ${APACHE_LOG_DIR}/ramtv-access.log combined
</VirtualHost>Enable the site and check Apache's syntax. If the default Ubuntu site is still enabled, you can disable it once your RamTV host responds correctly; it is not necessary to break other sites on a shared server. Open http://music.example.com/installer/ from outside and confirm this server answers before requesting a certificate.
sudo a2ensite ramtv.conf
sudo apache2ctl configtest
sudo systemctl reload apache25. Turn on HTTPS before activating the licence
Keep the chosen @ or music record DNS only while setting up the origin certificate, so the hostname reaches Apache directly. Use the official Certbot Apache instructions to install Certbot, issue a certificate for your chosen hostname, and configure HTTPS. Certbot's Apache method expects the HTTP site to be reachable on port 80. After Certbot is installed, its Apache command can select the site and install the certificate; follow its prompts, then check renewal as described on that page. Certbot may edit the Apache VirtualHost configuration; leave RamTV's packaged .htaccess files untouched.
sudo certbot --apache -d music.example.com
sudo certbot renew --dry-runFor the main domain, use sudo certbot --apache -d example.com instead. If you also serve www.example.com, first create its DNS record and Apache ServerAlias, then request both names with sudo certbot --apache -d example.com -d www.example.com.
Visit the HTTPS installer on your chosen hostname (https://example.com/installer/ for @, or https://music.example.com/installer/ for music) and confirm a valid certificate. At RamTV's licence step use the matching full website address with a trailing slash, such as https://example.com/ for the main domain. The installer saves that address, and its later route check requests the same address from the server. If a proxy, DNS setting, firewall, or TLS problem prevents the server from reaching itself, solve that before continuing. HTTPS also matters for browser features and external callbacks used after installation.
Cloudflare can remain the DNS provider while this record stays DNS only. If you later switch the chosen @ or music record to Proxied (orange cloud), select SSL/TLS → Overview → Full (strict) in Cloudflare after the origin has its valid Certbot certificate. Full (strict) validates the certificate between Cloudflare and Apache; Cloudflare's visitor-facing certificate alone does not secure that origin connection. Avoid Flexible mode with Apache's HTTPS redirect, which Cloudflare documents as a cause of redirect loops. See Cloudflare's Full (strict) requirements and redirect-loop guidance. Recheck RamTV's installer and API route after changing proxy status.
6. Create an empty MariaDB database
Connect as MariaDB's local administrator with sudo mariadb. Create an empty database and a dedicated local account; replace the example password with a strong unique value. Grant rights only on the RamTV database so the installer can create its tables and the application can manage them later. You do not need to import RamTV's SQL manually—the installer handles that. MariaDB documents CREATE DATABASE, CREATE USER, and database-scoped GRANT.
sudo mariadbCREATE DATABASE ramtv CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'ramtv'@'localhost' IDENTIFIED BY 'replace-with-a-strong-password';
GRANT ALL PRIVILEGES ON ramtv.* TO 'ramtv'@'localhost';
EXIT;At RamTV's Database step, use host localhost, database ramtv, user ramtv, and that password. Enter a separate admin email and password. The installer imports its schema into the empty database. If an import fails partway through, follow the installer's incomplete-database message and clear the partial tables before retrying; do not activate a partly imported database.
7. Complete RamTV's installer in order
Open the HTTPS installer and follow Requirements, Licence, and Database in that order. The requirements screen checks PHP's cURL, MySQLi, mbstring, GD, ZIP, allow_url_fopen, and PHP version. The licence screen calls Busyowl's service and writes the licensed URL. The database screen imports tables and creates the RamTV admin account. If the first screen flags an extension, install/enable it for Apache's PHP version and restart Apache; php8.3 -m only proves what the CLI sees.
Before the Server step can pass, schedule RamTV's own CLI command once per minute. It must run after the database exists. Ubuntu's cron service and the www-data account are already present in this example. Edit that account's crontab and add exactly one entry; use the absolute PHP 8.3 binary so a later change to the system's default php command cannot silently change RamTV's cron version.
sudo crontab -u www-data -e* * * * * /usr/bin/php8.3 -f /var/www/ramtv/api/admin.php bof_cronjobs=yesSave the crontab, wait a minute or two, then refresh RamTV's Server step. Its cron check reads the heartbeat written to the database; it also checks the original .htaccess files, makes a live request to the chosen hostname's , and checks the database/PHP timezone. If the heartbeat stays red, run the same command manually as the scheduled account to see the error, then check /api/client_config URL (for example, https://example.com/api/client_config when using @)systemctl status cron and the PHP CLI configuration. Keep only one scheduler entry for this installation.
sudo -u www-data /usr/bin/php8.3 -f /var/www/ramtv/api/admin.php bof_cronjobs=yes8. Finish the site, uploads, and media tools
When the installer finishes, remove the installer/ directory and continue with First run. Remove the temporary web-server write permission from api/app/ and return the generated config files to your deployment account while retaining www-data read access. Keep files/ writable for media. If you later install plugins or themes through RamTV, those directories may need write access for that operation.
sudo rm -rf /var/www/ramtv/installer
sudo chown "$USER":www-data /var/www/ramtv/api/app/config_user.php /var/www/ramtv/api/app/config_license.php
sudo chmod 640 /var/www/ramtv/api/app/config_user.php /var/www/ramtv/api/app/config_license.php
sudo chmod g-w /var/www/ramtv/api/appFor uploads larger than PHP's defaults, set upload_max_filesize and a slightly larger post_max_size in Apache's active /etc/php/8.3/apache2/php.ini, then restart Apache. Set limits for the largest files your users may upload and the server's available resources. If RamTV cannot write an upload, inspect /var/www/ramtv/files/ permissions and disk space before changing the whole site's permissions.
Cloudflare's proxy has its own upload and connection limits in addition to PHP's. Cloudflare currently lists a 100 MB maximum upload on Free and Pro plans and documents a proxy read timeout; either can matter for RamTV media. If you need larger uploads, leave this RamTV hostname DNS only or choose a Cloudflare plan and upload design that supports the real file sizes. Test an actual upload and playback before enabling the orange-cloud proxy. See Cloudflare's upload limit and connection limits.
FFmpeg and other extra services can be added after RamTV's core installation. The Optional tools on Ubuntu section below gives the Ubuntu checks and exact RamTV Admin controls.
Back up the MariaDB database and /var/www/ramtv/files/, plus the generated config files and any custom plugins/themes. Confirm a restore procedure before relying on backups. This guide does not choose a backup provider or retention policy; Ubuntu's backup documentation covers one system-level option.
If something stays red
- Requirements: check the Apache PHP module version and active
php.ini; install the missingphp8.3-*package, restart Apache, and refresh the page. The CLI module list can differ from Apache's. - Cloudflare DNS, licence or HTTPS: confirm the Cloudflare zone is Active and the chosen
@ormusicA record points to this server. If DNS only, the hostname should resolve to the origin IP. If proxied, check Cloudflare Full (strict), the origin certificate, and the request path from the server to its own public URL. RamTV ties the purchase code to the submitted host and must reach the same URL for its route check. - Database: confirm MariaDB is running, the empty
ramtvdatabase exists, and the'ramtv'@'localhost'account has privileges onramtv.*. An incomplete import must be cleared before retrying. - .htaccess: restore any missing or edited file from the original release. If the files pass but API routes fail, check the correct VirtualHost,
AllowOverride All,rewrite,headers,access_compat, and Apache's site error log at/var/log/apache2/ramtv-error.log. - Cron: check that the job runs as
www-datawith/usr/bin/php8.3, the script path is correct, and MariaDB is available. Run the command manually as shown above to see the error.
Optional tools on Ubuntu
These tools are optional for the basic RamTV installation. Add the ones your video and catalogue workflows use, and run them as the same web-server account that processes uploads.
FFmpeg and FFprobe
Install FFmpeg for video conversion, thumbnails and HLS output. The same Ubuntu package provides FFprobe, which inspects a video before RamTV decides whether it can copy the stream or needs to encode it.
sudo apt install ffmpeg
command -v ffmpeg
command -v ffprobe
sudo -u www-data /usr/bin/ffmpeg -version
sudo -u www-data /usr/bin/ffprobe -version
In Setting → General → External Tools, set the absolute paths for FFmpeg and FFprobe, run each Test, and enable them only after the tests pass. Choose the video conversion and upload policies separately under Setting → Files → Upload Setting.
Search and image tools
Meilisearch is optional for larger catalogues. If you use it, follow the official installation guide, keep the service and master key private, then configure and test its endpoint in Admin → Settings → General → Search. The default PHP search engine does not need Meilisearch.
Image optimizers, Imagick, yt-dlp and Node.js are feature-specific additions. Install them only for RamTV features you enable, and verify the executable paths and PHP extensions in the matching Admin settings. Keep the once-per-minute RamTV cron task running for background processing.