Install on Ubuntu 26.04
How to install Ampache on Ubuntu 26.04 LTS
Ubuntu 26.04 LTS ("Resolute Raccoon") ships PHP 8.5 in the main archive, which is exactly what Ampache8 needs. That makes it the easiest Ubuntu release to install a current Ampache on: no third party PHP repository required.
This guide sets up Apache, MariaDB and PHP 8.5, installs Ampache and gets you to the web installer.
Installing on an older Ubuntu? Use the Ubuntu 22.04 guide instead, or run the Docker image which brings its own PHP.
Prerequisites
- A server running Ubuntu 26.04 LTS
- sudo access
Most of these commands need root. Either prefix each one with sudo, or become root once:
sudo su -
Update the system
apt update
apt upgrade -y
Install the server packages
Apache, MariaDB, PHP 8.5 and the transcoding tools:
apt install apache2 mariadb-server \
php8.5 php8.5-cli php8.5-curl php8.5-gd php8.5-intl php8.5-mbstring php8.5-mysql php8.5-xml php8.5-zip \
ffmpeg flac lame vorbis-tools inotify-tools zip unzip curl
php8.5-ldap is only needed if you plan to use LDAP authentication.
If a later Ubuntu moves on from PHP 8.5, or you need a version the archive does not carry, Sury (ppa:ondrej/php) packages every current PHP release for Ubuntu and installs beside the system one.
Check what you got:
php -v
If you have more than one PHP installed, point the php command at the right one:
update-alternatives --set php /usr/bin/php8.5
Tune php.ini
nano /etc/php/8.5/apache2/php.ini
Raise the limits if you want to upload or download large files:
upload_max_filesize = 500M
post_max_size = 500M
memory_limit = 512M
And set your timezone (list of supported values):
date.timezone = Australia/Brisbane
Restart Apache when you are done:
systemctl restart apache2
NOTE the CLI uses a different file, /etc/php/8.5/cli/php.ini. Catalog scans and the cron jobs read that one.
Secure MariaDB
mariadb-secure-installation
Answer as follows:
Enter current password for root (enter for none): <press enter>
Switch to unix_socket authentication [Y/n] N
Change the root password? [Y/n] Y
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
On Ubuntu the root password is not always enforced by that script, because the root account is still set to unix_socket authentication. Check by logging in with the password you just set:
mysql -u root -p
If that fails, log in over the socket and set it by hand:
mysql -u root mysql
ALTER USER 'root'@'localhost' IDENTIFIED VIA mysql_native_password USING PASSWORD('YOURPASSWORD');
FLUSH PRIVILEGES;
Type exit to leave the shell. The web installer needs an account it can log in to with a password, so this has to work before you go on.
Install Ampache
Two ways to do this. Pick one.