How to Install Ampache on Debian Latest

Ampache is a powerful and flexible web-based music streaming server application that allows you to access your music collection from anywhere in the world, using any device with a web browser. It can stream MP3, Ogg Vorbis, FLAC, AAC, and other audio formats, and it can be installed on various platforms, including Debian.

In this tutorial, we will show you how to install Ampache on Debian latest.

Prerequisites

Before you begin, you need to have the following:

  1. A Debian latest system with root access
  2. A user account with sudo privileges

Step 1 - Update the system

Firstly, you need to update your system to ensure that all of the packages and dependencies are up to date.

$ sudo apt update && sudo apt upgrade

Step 2 - Install Apache

Ampache is a web-based application, so you need to install Apache, which is a popular web server application.

$ sudo apt install apache2

Step 3 - Install PHP and Required Extensions

Ampache is written in PHP, so you will need to install PHP and some extensions that are required by Ampache, you can install them using the following command:

$ sudo apt install php libapache2-mod-php php-mysql php-xml php-curl php-gd php-ldap

Step 4 - Install MySQL

Ampache requires database system, so you will need to install MySQL:

$ sudo apt install mariadb-server mariadb-client

After installing MySQL, you need to secure it by running the command below, which will set the root password and remove some insecure default settings that come with the installation:

$ sudo mysql_secure_installation

Step 5 - Create a Database and a User for Ampache

Now that we have installed MySQL, we can create a database and a user for Ampache.

Log in to the MySQL server as the root user:

$ sudo mysql -u root -p

Create a new database called "ampache":

mysql> CREATE DATABASE ampache;

Create a new user called "ampache_user" with a password:

mysql> CREATE USER 'ampache_user'@'localhost' IDENTIFIED BY 'password';

Grant the user full privileges to the database:

mysql> GRANT ALL PRIVILEGES ON ampache.* TO 'ampache_user'@'localhost';

Flush the privileges to apply the changes:

mysql> FLUSH PRIVILEGES;

Exit the MySQL shell:

mysql> exit;

Step 6 - Install Ampache

Now that we have Apache, PHP, and MySQL installed, we can proceed with the installation of Ampache.

Download the Ampache archive file:

$ sudo wget https://github.com/ampache/ampache/releases/download/4.4.4/ampache-4.4.4_all.zip

Extract the archive file:

$ sudo unzip ampache-4.4.4_all.zip -d /var/www/html/

Rename the Ampache directory to "ampache":

$ sudo mv /var/www/html/ampache-4.4.4 /var/www/html/ampache

Change the ownership and permissions of the Ampache directory:

$ sudo chown -R www-data:www-data /var/www/html/ampache

$ sudo chmod -R 755 /var/www/html/ampache

Step 7 - Finish the installation using the wizard

Open a web browser and navigate to http://SERVER_IP_ADDRESS/ampache. You will be greeted with the Ampache installation wizard. Follow the installation steps, configuring the database and the user you have created in step 5.

After the installation, log in to the Ampache web interface using the account you have created.

Congratulations! You have successfully installed Ampache on Debian latest. You can now upload your music collection and start streaming your music to any device from anywhere in the world.

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!