Ampache is an open-source web-based music streaming and media management software. This tutorial will guide you through the process of installing Ampache on the latest version of OpenSUSE.
You need administrative access to the server that you are going to install Ampache on.
A web server (Apache or Nginx) is already installed and running.
PHP version 7.2 or above is installed on the server with the required extensions.
Before you begin installing Ampache on your OpenSUSE server, you need to install the required dependencies.
Open the terminal window and enter the following command to install packages:
sudo zypper in apache2-mod_php7 mariadb mariadb-client php7 php7-ctype php7-curl php7-dom php7-gd php7-gettext php7-json php7-maria php7-mbstring php7-mysqli php7-session php7-sockets php7-tokenizer php7-xmlreader php7-xmlwriter php7-zip
sudo wget -O ampache.tar.gz https://github.com/ampache/ampache/releases/download/4.4.4/ampache-4.4.4_all.zip
sudo tar -xvf ampache.tar.gz -C /var/www/htdocs/ && cd /var/www/htdocs/
sudo mv ampache-4.4.4_all/* ./ && rm -rf ampache-4.4.4_all/ && rm ampache.tar.gz
sudo chown -R wwwrun:www /var/www/htdocs/
sudo chmod -R 775 /var/www/htdocs/
sudo mysql -u root -p
CREATE DATABASE ampache;
CREATE USER 'ampacheuser'@'localhost' IDENTIFIED BY 'StrongPassword';
GRANT ALL PRIVILEGES ON ampache.* TO 'ampacheuser'@'localhost';
exit
sudo mv /var/www/htdocs/config/ampache.cfg.php.dist /var/www/htdocs/config/ampache.cfg.php
sudo nano /var/www/htdocs/config/ampache.cfg.php
define('AMPACHE_DB_HOST', 'localhost');
define('AMPACHE_DB_USER', 'ampacheuser');
define('AMPACHE_DB_PASS', 'StrongPassword');
define('AMPACHE_DB_NAME', 'ampache');
Now, you need to configure the web server to serve the Ampache files.
sudo nano /etc/apache2/vhosts.d/ampache.conf
<VirtualHost *:80>
ServerName YourServerName
DocumentRoot "/var/www/htdocs"
<Directory "/var/www/htdocs">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
sudo a2enmod rewrite
sudo systemctl restart apache2
sudo nano /etc/nginx/sites-available/ampache
server {
listen 80;
server_name YourServerName;
root /var/www/htdocs;
index index.php;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php7.4-fpm.sock;
}
}
sudo ln -s /etc/nginx/sites-available/ampache /etc/nginx/sites-enabled/
sudo systemctl restart nginx
You can access Ampache by going to http://YourServerName/ampache in your web browser.
The first time you access Ampache, you will be prompted to run the installation wizard.
Follow the wizard instructions to complete the installation.
Once you have completed the installation, you can start uploading and streaming your media files.
In this tutorial, you have learned how to install and configure Ampache on OpenSUSE latest. By following the instructions in this guide, you should be able to set up Ampache quickly and easily on your OpenSUSE server.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!