Use the apt-get or yum command to install Icecast2.
apt-get install icecast2 yum install icecast2
By default, the owner and group owner of the Icecast access.log and error.log is root:root. Change the owner to be icecast2:icecast2. This is necessary to prevent error "could not open access.log", which may prevent Icecast from starting.
chown -r icecast2:icecast2 /var/log/icecast2
The ps command can be used to determine if your system is using init or systemd. If PID 1 is init, then you will use the service command. If PID 1 is systemd, then you will use the systemctl command.
If your system is using systemd, use the systemctl command to start and enable icecast2.
systemctl enable icecast2 systemctl start icecast2 systemctl status icecast2
chkconfig icecast2 on service icecast2 start service icecast2 status
Type http://localhost:8080 into the Web browser.
Next we need to change the logdir, webroot and adminroot directives in the /etc/icecast2/icecast.xml file.
If Icecast is running on the same image as your Apache Web Server, Apache might be using port 8080. In this case, we would just need to give Icecast a different port, such as 8181.