Ampache is an open-source and web-based audio/video streaming application that allows you to access your music & videos from anywhere over the internet. Ampache provides a platform to host and manage your digital music collection on your own server. With Ampache, you can stream your music to your smartphone, tablet, and smart TV.
In this post, we will show you how to install the Ampache Music Streaming server on Debian 10.
- A fresh Debian 10 server on the Atlantic.Net Cloud Platform
- A root password configured on your server
Step 1 – Create Atlantic.Net Cloud Server
First, log in to your Atlantic.Net Cloud Server. Create a new server, choosing Debian 10 as the operating system with at least 2GB RAM. Connect to your Cloud Server via SSH and log in using the credentials highlighted at the top of the page.
Once you are logged in to your Debian 10 server, run the following command to update your base system with the latest available packages.
apt-get update -y
Step 2 – Install LAMP Server
Ampache requires an Apache web server, Database server, PHP. So you will need to install the LAMP server and other PHP dependencies in your server. You can install all of them with the following command:
apt-get install apache2 mariadb-server php libapache2-mod-php php-cli php-common php-json php-gd php-xmlrpc php-curl php-intl php-imagick php-mysql php-zip php-xml php-mbstring php-bcmath unzip ffmpeg -y
After installing all packages, edit the php.ini file and make some changes:
Change the following lines:
short_open_tag = On memory_limit = 256M cgi.fix_pathinfo = 0 max_execution_time = 360 upload_max_filesize = 64M post_max_size = 64M
Save and close the file then restart the Apache service to apply the changes:
systemctl restart apache2
Step 3 – Configure MariaDB Database
Next, you will need to create a database and user for Ampache.
First, connect to MariaDB with the following command:
Next, create a database and user with the following command:
CREATE DATABASE ampachedb; CREATE USER 'ampache'@'%' IDENTIFIED BY 'passsword';
Next, grant all the privileges to ampachedb with the following command:
GRANT ALL PRIVILEGES ON ampachedb.* TO 'ampache'@'%' WITH GRANT OPTION;
Next, flush the privileges and exit from MariaDB with the following command:
FLUSH PRIVILEGES; EXIT;
Step 4 – Install Ampache
Next, download the latest version of Ampache from the Git repository:
Once the download is completed, unzip the downloaded file to the Apache web root directory:
unzip ampache-4.4.3_all.zip -d /var/www/html/ampache
Next, change the directory to the extracted directory and rename some sample .htaccess files.
cd /var/www/html/ampache mv rest/.htaccess.dist rest/.htaccess mv play/.htaccess.dist play/.htaccess mv channel/.htaccess.dist channel/.htaccess
Next, set proper ownership and permission to the Ampache directory:
chown -R www-data:www-data /var/www/html/ampache chmod -R 775 /var/www/html/ampache
Next, create a directory to store your music and set proper ownership:
mkdir -p /data/ chown -R www-data:www-data /data/
Next, enable the Apache expires and rewrite module with the following command:
a2enmod expires rewrite
Finally, restart the Apache service to apply the changes:
systemctl restart apache2
Step 5 – Access Ampache Web Interface
Now, open your web browser and access the Ampache web interface using the URL http://your-server-ip/ampache. You should see the following page:
Select your language and click on Start Configuration. You should see the following page:
Make sure all the PHP dependencies are installed then click on the Continue button. You should see the following page:
Provide your database details, uncheck “Create Database” and click on the Insert Database. You should see the following page:
Select the FFmpeg template and click on the Create Config button. You should see the following page:
Set your admin password and click on the Create Account button. You should see the following page:
Provide your admin username, password and click on the Login button. You should see the Ampache dashboard on the following page:
Congratulations! You have successfully installed the Ampache music streaming server on Debian 10. You can now store your music and audio on the Ampache server and stream them over the internet from any device. Try it on your dedicated server from Atlantic.Net.