SHOUTcast is a free and open-source Streaming Server. Cross-platform streaming media server
1. Prerequisites
2. Supported Operating Systems
This guide supports installation on:
3. Installation
RHEL/CentOS/Rocky Linux/AlmaLinux
bash
# Install EPEL repository if needed
sudo dnf install -y epel-release
# Install shoutcast
sudo dnf install -y shoutcast none
# Enable and start service
sudo systemctl enable --now sc_serv
# Configure firewall
sudo firewall-cmd --permanent --add-service=shoutcast
sudo firewall-cmd --reload
# Verify installation
shoutcast --version || systemctl status sc_serv
Debian/Ubuntu
bash
# Update package index
sudo apt update
# Install shoutcast
sudo apt install -y shoutcast none
# Enable and start service
sudo systemctl enable --now sc_serv
# Configure firewall
sudo ufw allow 8000
# Verify installation
shoutcast --version || systemctl status sc_serv
Arch Linux
bash
# Install shoutcast
sudo pacman -S shoutcast
# Enable and start service
sudo systemctl enable --now sc_serv
# Verify installation
shoutcast --version || systemctl status sc_serv
Alpine Linux
bash
# Install shoutcast
apk add --no-cache shoutcast
# Enable and start service
rc-update add sc_serv default
rc-service sc_serv start
# Verify installation
shoutcast --version || rc-service sc_serv status
openSUSE/SLES
bash
# Install shoutcast
sudo zypper install -y shoutcast none
# Enable and start service
sudo systemctl enable --now sc_serv
# Configure firewall
sudo firewall-cmd --permanent --add-service=shoutcast
sudo firewall-cmd --reload
# Verify installation
shoutcast --version || systemctl status sc_serv
macOS
bash
# Using Homebrew
brew install shoutcast
# Start service
brew services start shoutcast
# Verify installation
shoutcast --version
FreeBSD
bash
# Using pkg
pkg install shoutcast
# Enable in rc.conf
echo 'sc_serv_enable="YES"' >> /etc/rc.conf
# Start service
service sc_serv start
# Verify installation
shoutcast --version || service sc_serv status
Windows
powershell
# Using Chocolatey
choco install shoutcast
# Or using Scoop
scoop install shoutcast
# Verify installation
shoutcast --version
Initial Configuration
Basic Configuration
bash
# Create configuration directory if needed
sudo mkdir -p /opt/shoutcast
# Set up basic configuration
sudo tee /opt/shoutcast/shoutcast.conf << 'EOF'
# SHOUTcast Configuration
maxuser=1000
EOF
# Test configuration
sudo shoutcast -t || sudo sc_serv configtest
# Reload service
sudo systemctl reload sc_serv
Security Hardening
bash
# Set appropriate permissions
sudo chown -R shoutcast:shoutcast /opt/shoutcast
sudo chmod 750 /opt/shoutcast
# Enable security features
# See security section for detailed hardening steps
5. Service Management
systemd (RHEL, Debian, Ubuntu, Arch, openSUSE)
bash
# Enable service
sudo systemctl enable sc_serv
# Start service
sudo systemctl start sc_serv
# Stop service
sudo systemctl stop sc_serv
# Restart service
sudo systemctl restart sc_serv
# Reload configuration
sudo systemctl reload sc_serv
# Check status
sudo systemctl status sc_serv
# View logs
sudo journalctl -u sc_serv -f
OpenRC (Alpine Linux)
bash
# Enable service
rc-update add sc_serv default
# Start service
rc-service sc_serv start
# Stop service
rc-service sc_serv stop
# Restart service
rc-service sc_serv restart
# Check status
rc-service sc_serv status
rc.d (FreeBSD)
bash
# Enable in /etc/rc.conf
echo 'sc_serv_enable="YES"' >> /etc/rc.conf
# Start service
service sc_serv start
# Stop service
service sc_serv stop
# Restart service
service sc_serv restart
# Check status
service sc_serv status
launchd (macOS)
bash
# Using Homebrew services
brew services start shoutcast
brew services stop shoutcast
brew services restart shoutcast
# Check status
brew services list | grep shoutcast
Windows Service Manager
powershell
# Start service
net start sc_serv
# Stop service
net stop sc_serv
# Using PowerShell
Start-Service sc_serv
Stop-Service sc_serv
Restart-Service sc_serv
# Check status
Get-Service sc_serv
Advanced Configuration
Performance Optimization
bash
# Configure performance settings
cat >> /opt/shoutcast/shoutcast.conf << 'EOF'
maxuser=1000
EOF
# Apply system tuning
sudo sysctl -w net.core.somaxconn=65535
sudo sysctl -w net.ipv4.tcp_max_syn_backlog=65535
# Restart service
sudo systemctl restart sc_serv
Clustering and High Availability
bash
# Configure clustering (if supported)
# See official documentation for cluster setup
# Basic load balancing setup example
# Configure multiple instances on different ports
Reverse Proxy Setup
nginx Configuration
nginx
upstream shoutcast_backend {
server 127.0.0.1:8000;
server 127.0.0.1:{default_port}1 backup;
}
server {
listen 80;
server_name shoutcast.example.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
server_name shoutcast.example.com;
ssl_certificate /etc/ssl/certs/shoutcast.example.com.crt;
ssl_certificate_key /etc/ssl/private/shoutcast.example.com.key;
location / {
proxy_pass http://shoutcast_backend;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# WebSocket support (if needed)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
Apache Configuration
apache
<VirtualHost *:80>
ServerName shoutcast.example.com
Redirect permanent / https://shoutcast.example.com/
</VirtualHost>
<VirtualHost *:443>
ServerName shoutcast.example.com
SSLEngine on
SSLCertificateFile /etc/ssl/certs/shoutcast.example.com.crt
SSLCertificateKeyFile /etc/ssl/private/shoutcast.example.com.key
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8000/
ProxyPassReverse / http://127.0.0.1:8000/
# WebSocket support (if needed)
RewriteEngine on
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule ^/?(.*) "ws://127.0.0.1:8000/$1" [P,L]
</VirtualHost>
HAProxy Configuration
haproxy
frontend shoutcast_frontend
bind *:80
bind *:443 ssl crt /etc/ssl/certs/shoutcast.pem
redirect scheme https if !{ ssl_fc }
default_backend shoutcast_backend
backend shoutcast_backend
balance roundrobin
option httpchk GET /health
server shoutcast1 127.0.0.1:8000 check
server shoutcast2 127.0.0.1:{default_port}1 check backup
Security Configuration
Basic Security Setup
bash
# Set appropriate permissions
sudo chown -R shoutcast:shoutcast /opt/shoutcast
sudo chmod 750 /opt/shoutcast
# Configure firewall
sudo firewall-cmd --permanent --add-service=shoutcast
sudo firewall-cmd --reload
# Enable SELinux policies (if applicable)
sudo setsebool -P httpd_can_network_connect on
# Configure fail2ban
sudo tee /etc/fail2ban/jail.d/shoutcast.conf << 'EOF'
[shoutcast]
enabled = true
port = 8000
filter = shoutcast
logpath = /var/log/shoutcast/*.log
maxretry = 5
bantime = 3600
EOF
SSL/TLS Configuration
bash
# Generate SSL certificates
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
-keyout /etc/ssl/private/shoutcast.key \
-out /etc/ssl/certs/shoutcast.crt
# Configure SSL in shoutcast
# See official documentation for SSL configuration
Database Setup
PostgreSQL Backend (if applicable)
bash
# Create database and user
sudo -u postgres psql << EOF
CREATE DATABASE shoutcast_db;
CREATE USER shoutcast_user WITH ENCRYPTED PASSWORD 'secure_password';
GRANT ALL PRIVILEGES ON DATABASE shoutcast_db TO shoutcast_user;
EOF
# Configure shoutcast to use PostgreSQL
# See official documentation for database configuration
MySQL/MariaDB Backend (if applicable)
bash
# Create database and user
sudo mysql << EOF
CREATE DATABASE shoutcast_db;
CREATE USER 'shoutcast_user'@'localhost' IDENTIFIED BY 'secure_password';
GRANT ALL PRIVILEGES ON shoutcast_db.* TO 'shoutcast_user'@'localhost';
FLUSH PRIVILEGES;
EOF
Performance Optimization
System Tuning
bash
# Kernel parameters
sudo tee -a /etc/sysctl.conf << EOF
net.core.somaxconn = 65535
net.ipv4.tcp_max_syn_backlog = 65535
net.ipv4.ip_local_port_range = 1024 65535
net.core.netdev_max_backlog = 5000
vm.swappiness = 10
EOF
sudo sysctl -p
# SHOUTcast specific tuning
maxuser=1000
Resource Limits
bash
# Configure system limits
sudo tee -a /etc/security/limits.conf << EOF
shoutcast soft nofile 65535
shoutcast hard nofile 65535
shoutcast soft nproc 32768
shoutcast hard nproc 32768
EOF
Monitoring
Prometheus Integration
yaml
# prometheus.yml configuration
scrape_configs:
- job_name: 'shoutcast'
static_configs:
- targets: ['localhost:8000']
metrics_path: '/metrics'
Health Checks
bash
# Basic health check script
#!/bin/bash
if systemctl is-active --quiet sc_serv; then
echo "SHOUTcast is running"
exit 0
else
echo "SHOUTcast is not running"
exit 1
fi
Log Monitoring
bash
# Configure log rotation
sudo tee /etc/logrotate.d/shoutcast << 'EOF'
/var/log/shoutcast/*.log {
daily
rotate 14
compress
delaycompress
missingok
notifempty
create 0640 shoutcast shoutcast
postrotate
systemctl reload sc_serv > /dev/null 2>&1 || true
endscript
}
EOF
9. Backup and Restore
Backup Script
bash
#!/bin/bash
# SHOUTcast backup script
BACKUP_DIR="/backup/shoutcast"
DATE=$(date +%Y%m%d_%H%M%S)
mkdir -p "$BACKUP_DIR"
# Stop service (if required)
systemctl stop sc_serv
# Backup configuration
tar -czf "$BACKUP_DIR/shoutcast-config-$DATE.tar.gz" /opt/shoutcast
# Backup data (adjust paths as needed)
tar -czf "$BACKUP_DIR/shoutcast-data-$DATE.tar.gz" /var/lib/shoutcast
# Start service
systemctl start sc_serv
# Clean old backups (keep 30 days)
find "$BACKUP_DIR" -name "*.tar.gz" -mtime +30 -delete
echo "Backup completed: $BACKUP_DIR"
Restore Procedure
bash
# Stop service
sudo systemctl stop sc_serv
# Restore configuration
sudo tar -xzf /backup/shoutcast/shoutcast-config-*.tar.gz -C /
# Restore data
sudo tar -xzf /backup/shoutcast/shoutcast-data-*.tar.gz -C /
# Set permissions
sudo chown -R shoutcast:shoutcast /opt/shoutcast
sudo chown -R shoutcast:shoutcast /var/lib/shoutcast
# Start service
sudo systemctl start sc_serv
6. Troubleshooting
Common Issues
1. Service won't start:
bash
# Check logs
sudo journalctl -u sc_serv -n 100
sudo tail -f /var/log/shoutcast/*.log
# Check configuration
sudo shoutcast -t || sudo sc_serv configtest
# Check permissions
ls -la /opt/shoutcast
ls -la /var/lib/shoutcast
2. Connection refused:
bash
# Check if service is listening
sudo ss -tlnp | grep 8000
sudo netstat -tlnp | grep 8000
# Check firewall
sudo firewall-cmd --list-all
sudo iptables -L -n
# Test connection
telnet localhost 8000
nc -zv localhost 8000
3. Performance issues:
bash
# Check resource usage
top -p $(pgrep sc_serv)
htop -p $(pgrep sc_serv)
# Check connections
ss -ant | grep :8000 | wc -l
# Monitor I/O
iotop -p $(pgrep sc_serv)
Debug Mode
bash
# Run in debug mode
sudo shoutcast -d
# or
sudo sc_serv debug
# Increase log verbosity
# Edit configuration to enable debug logging
Integration Examples
Docker Compose
yaml
version: '3.8'
services:
shoutcast:
image: shoutcast:latest
container_name: shoutcast
ports:
- "8000:8000"
volumes:
- ./config:/opt/shoutcast
- ./data:/var/lib/shoutcast
environment:
- shoutcast_CONFIG=/opt/shoutcast/shoutcast.conf
restart: unless-stopped
networks:
- shoutcast_net
networks:
shoutcast_net:
driver: bridge
Kubernetes Deployment
yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: shoutcast
spec:
replicas: 3
selector:
matchLabels:
app: shoutcast
template:
metadata:
labels:
app: shoutcast
spec:
containers:
- name: shoutcast
image: shoutcast:latest
ports:
- containerPort: 8000
volumeMounts:
- name: config
mountPath: /opt/shoutcast
volumes:
- name: config
configMap:
name: shoutcast-config
---
apiVersion: v1
kind: Service
metadata:
name: shoutcast
spec:
selector:
app: shoutcast
ports:
- port: 8000
targetPort: 8000
type: LoadBalancer
Ansible Playbook
yaml
---
- name: Install and configure SHOUTcast
hosts: all
become: yes
tasks:
- name: Install shoutcast
package:
name: shoutcast
state: present
- name: Configure shoutcast
template:
src: shoutcast.conf.j2
dest: /opt/shoutcast/shoutcast.conf
owner: shoutcast
group: shoutcast
mode: '0640'
notify: restart shoutcast
- name: Start and enable shoutcast
systemd:
name: sc_serv
state: started
enabled: yes
handlers:
- name: restart shoutcast
systemd:
name: sc_serv
state: restarted
Maintenance
Update Procedures
bash
# RHEL/CentOS/Rocky/AlmaLinux
sudo dnf update shoutcast
# Debian/Ubuntu
sudo apt update && sudo apt upgrade shoutcast
# Arch Linux
sudo pacman -Syu shoutcast
# Alpine Linux
apk update && apk upgrade shoutcast
# openSUSE
sudo zypper update shoutcast
# FreeBSD
pkg update && pkg upgrade shoutcast
# Always backup before updates
tar -czf /backup/shoutcast-pre-update-$(date +%Y%m%d).tar.gz /opt/shoutcast
# Restart after updates
sudo systemctl restart sc_serv
Regular Maintenance Tasks
bash
# Clean logs
find /var/log/shoutcast -name "*.log" -mtime +30 -delete
# Verify integrity
sudo shoutcast --verify || sudo sc_serv check
# Update databases (if applicable)
sudo shoutcast-update-db
# Optimize performance
sudo shoutcast-optimize
# Check for security updates
sudo shoutcast --security-check
Additional Resources
---
Note: This guide is part of the HowToMgr collection. Always refer to official documentation for the most up-to-date information.