
This article provides a production-ready, step-by-step guide to deploy Castopod on AlmaLinux VPS using Nginx + PHP-FPM + MariaDB + HTTPS.
What is Castopod?
Castopod is an open-source podcast hosting platform designed to give podcasters control over their content while supporting the latest podcasting innovations, such as Podcasting 2.0 features. It’s a self-hosted solution, meaning that users can install and run Castopod on their own servers, offering them full ownership of their podcasts and data, unlike hosted platforms where the hosting service owns the platform infrastructure (which creates a vendor lock-in scenario for podcaster).
Additionally, Castopod supports federation via ActivityPub, the decentralized social networking protocol, also known as the Fediverse. This means podcasts hosted on Castopod can be followed and interacted with from compatible social networks, broadening the reach and engagement of podcast content.
Pre-requisites
Minimum VPS specs (recommended):
- AlmaLinux 9
- 2 vCPU
- 2 GB RAM (4 GB ideal)
- 20+ GB NVMe storage
- Root or sudo access
- A domain or subdomain (e.g.
podcast.example.com)
Compare AlmaLinux VPS Plans
How to Deploy Castopod on AlmaLinuux VPS
To deploy Castopod on AlmaLinux VPS, follow the steps below:
-
Prepare the AlmaLinux VPS
Update the system and install core utilities:
dnf update -y dnf install -y epel-release unzip wget curl firewalld nano systemctl enable --now firewalld
Open HTTP and HTTPS:
firewall-cmd --permanent --add-service=http firewall-cmd --permanent --add-service=https firewall-cmd --reload
-
Install Nginx
dnf install -y nginx systemctl enable --now nginx
Verify:
curl http://localhost
-
Install PHP (Required Extensions)
Castopod requires PHP 8.1+.
Enable Remi repository:
dnf install -y https://rpms.remirepo.net/enterprise/remi-release-9.rpm dnf module reset php -y dnf module enable php:remi-8.2 -y
Install PHP and extensions:
dnf install -y \ php php-fpm php-mysqlnd php-intl php-mbstring php-xml \ php-gd php-curl php-zip php-opcache php-cli
Start PHP-FPM:
systemctl enable --now php-fpm
-
Install MariaDB
dnf install -y mariadb-server systemctl enable --now mariadb
Secure the database:
mysql_secure_installation
-
Create Castopod Database
mysql -u root -p
CREATE DATABASE castopod CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE USER 'castopod'@'localhost' IDENTIFIED BY 'STRONG_PASSWORD'; GRANT ALL PRIVILEGES ON castopod.* TO 'castopod'@'localhost'; FLUSH PRIVILEGES; EXIT;
-
Download Castopod
cd /var/www wget https://code.castopod.org/-/project/2/uploads/db9596e195aa5c9eb652427a0060c253/castopod-1.14.1.zip unzip castopod-1.14.1.zip mv castopod podcast chown -R nginx:nginx podcast chmod -R 755 podcast
-
Configure PHP Permissions
chcon -R -t httpd_sys_rw_content_t /var/www/podcast setsebool -P httpd_can_network_connect 1
-
Configure Nginx Virtual Host
Create config:
nano /etc/nginx/conf.d/podcast.conf
server { listen 80; server_name podcast.example.com; root /var/www/podcast/public; index index.php; client_max_body_size 2G; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { include fastcgi_params; fastcgi_pass unix:/run/php-fpm/www.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } location ~* \.(mp3|m4a|ogg|wav)$ { expires 30d; add_header Cache-Control "public"; } }Test and reload:
nginx -t systemctl reload nginx
-
Install HTTPS (Let’s Encrypt)
dnf install -y certbot python3-certbot-nginx certbot --nginx -d podcast.example.com
Enable auto-renewal:
systemctl enable certbot-renew.timer
-
Web Installer (Final Setup)
Open in browser:
https://podcast.example.com
Provide:
- Database name:
castopod - Database user:
castopod - Password:
STRONG_PASSWORD - Admin email & password
- Podcast metadata
Complete installation.
- Database name:
-
Optimize for Production
PHP Tuning
Edit:
nano /etc/php.ini
Recommended:
memory_limit = 512M upload_max_filesize = 2048M post_max_size = 2048M max_execution_time = 300
Restart PHP:
systemctl restart php-fpm
-
Enable Background Jobs (Recommended)
Castopod relies on scheduled tasks.
crontab -u nginx -e
* * * * * php /var/www/podcast/spark castopod:scheduled
-
Optional Enhancements
- Object storage (S3-compatible) for episode media
- CDN for audio delivery
- Redis for caching
- Fail2Ban for admin protection
- Daily database + media backups
- HTTP/3 (QUIC) via Nginx + Cloudflare
Common Troubleshooting
502 Bad Gateway
- PHP-FPM not running
- Socket mismatch (
/run/php-fpm/www.sock)
Uploads failing
- Increase
client_max_body_size - Check PHP upload limits
SELinux blocking access
audit2allow -w -a
Final Notes
You now have a secure, scalable Castopod deployment on AlmaLinux suitable for:
- Independent podcasters
- Hosting providers
- Media networks
- White-label podcast platforms
Conclusion
You now know how to deploy Castopod on AlmaLinux VPS.









